From 70f527e9676ea0a15c50a8f255894d3085fac272 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 26 Mar 2017 11:09:28 -0400 Subject: [PATCH] Add downloads index --- .../Controllers/DownloadController.cs | 19 ++ Project-Unite/Models/Download.cs | 64 ++++++ Project-Unite/Models/IdentityModels.cs | 1 + Project-Unite/Project-Unite.csproj | 3 + Project-Unite/Views/Download/Index.cshtml | 203 ++++++++++++++++++ Project-Unite/Views/Shared/_Layout.cshtml | 2 +- 6 files changed, 291 insertions(+), 1 deletion(-) create mode 100644 Project-Unite/Controllers/DownloadController.cs create mode 100644 Project-Unite/Models/Download.cs create mode 100644 Project-Unite/Views/Download/Index.cshtml diff --git a/Project-Unite/Controllers/DownloadController.cs b/Project-Unite/Controllers/DownloadController.cs new file mode 100644 index 0000000..58e3c36 --- /dev/null +++ b/Project-Unite/Controllers/DownloadController.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using Project_Unite.Models; + +namespace Project_Unite.Controllers +{ + public class DownloadController : Controller + { + // GET: Download + public ActionResult Index() + { + var db = new ApplicationDbContext(); + return View(db.Downloads); + } + } +} \ No newline at end of file diff --git a/Project-Unite/Models/Download.cs b/Project-Unite/Models/Download.cs new file mode 100644 index 0000000..1dcf2bb --- /dev/null +++ b/Project-Unite/Models/Download.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Web; +using System.Web.Mvc; + +namespace Project_Unite.Models +{ + public class Download + { + [Required] + public string Id { get; set; } + + [Required] + public string Name { get; set; } + + [Required] + [AllowHtml] + public string Changelog { get; set; } + + [Required] + public string DownloadUrl { get; set; } + + [Required] + public bool Obsolete { get; set; } + + [Required] + public DateTime PostDate { get; set; } + + [Required] + public string ReleasedBy { get; set; } + + public string DevUpdateId { get; set; } + + + public string ScreenshotUrl { get; set; } + + [Required] + public bool IsStable { get; set; } + } + + public class PostDownloadViewModel + { + [Required] + public string Name { get; set; } + + public HttpPostedFileBase Screenshot { get; set; } + + public string DevUpdateId { get; set; } + + [Required] + public bool IsStable { get; set; } + + [Required] + [AllowHtml] + public string Changelog { get; set; } + + [Required] + [DataType(DataType.Upload)] + public HttpPostedFileBase Download { get; set; } + + } +} \ No newline at end of file diff --git a/Project-Unite/Models/IdentityModels.cs b/Project-Unite/Models/IdentityModels.cs index 32d3d76..bb55d50 100644 --- a/Project-Unite/Models/IdentityModels.cs +++ b/Project-Unite/Models/IdentityModels.cs @@ -204,6 +204,7 @@ namespace Project_Unite.Models return new ApplicationDbContext(); } + public DbSet Downloads { get; set; } public DbSet Backups { get; set; } public DbSet AssetBackups { get; set; } public DbSet UserAvatars { get; set; } diff --git a/Project-Unite/Project-Unite.csproj b/Project-Unite/Project-Unite.csproj index 7c03cf0..3e3bd11 100644 --- a/Project-Unite/Project-Unite.csproj +++ b/Project-Unite/Project-Unite.csproj @@ -238,6 +238,7 @@ + @@ -416,6 +417,7 @@ + @@ -530,6 +532,7 @@ + diff --git a/Project-Unite/Views/Download/Index.cshtml b/Project-Unite/Views/Download/Index.cshtml new file mode 100644 index 0000000..68da565 --- /dev/null +++ b/Project-Unite/Views/Download/Index.cshtml @@ -0,0 +1,203 @@ +@model IEnumerable +@{ + ViewBag.Title = "Download"; +} + +

Download ShiftOS

+ +

So you're ready to jump into the world of ShiftOS, are you? Well, first things first, let's get you a client executable. This is the file that will let you enter the world of ShiftOS. Choose the release type that is right for you.

+ +
+
+
+

Stable releases

+

If you're looking for the most simple, bug-free way to experience ShiftOS, stable releases are for you.

+

Pros:

+
    +
  • Long-term support
  • +
  • Virtually no bugs
  • +
  • Easy to set up
  • +
+ Show stable downloads +
+
+ +
+
+

Unstable releases

+

If you're looking for a simple way to get into the game, but want cutting-edge features, and know what you're doing, unstable builds are for you.

+

Pros:

+
    +
  • Cutting-edge features
  • +
  • Released more often
  • +
  • Easy to set up
  • +
+

Cons:

+
    +
  • Can be buggy.
  • +
  • Intermediate/advanced knowledge of ShiftOS is necessary.
  • +
+ Show unstable downloads +
+
+ +
+
+

Rolling-release edition

+

Like Unstable builds, rolling-release versions of ShiftOS contain the most bleeding edge features, however they are not tested thoroughly and can contain game-breaking glitches that are in the middle of being worked on.

+

Pros:

+
    +
  • Bleeding-edge features/bugfixes
  • +
  • Compiled IMMEDIATELY after a change is made to the game
  • + +
+

Cons:

+
    +
  • Extremely buggy.
  • +
  • Unfinished features.
  • +
  • A debugging environment is recommended.
  • + +
+ Learn more +
+
+ +
+
+

Source Code

+

Know C#? Want to add to the game? Want to compile the latest source code? This option is for you.

+

Pros:

+
    +
  • Ability to add your own features.
  • +
  • Full source code of the engine, game, and server.
  • + +
+

Cons:

+
    +
  • Knowledge of C# required.
  • +
  • Visual Studio or MonoDevelop IDE required.
  • +
  • Ability to compile the source code required.
  • +
+ Learn more +
+
+
+ +
+

A brief disclaimer about ShiftOS

+

We at ShiftOS are in no way a professional game development studio. We just do this for fun and as a hobby.

+

While we do accept bug reports and attempt to fix them as soon as possible, and while we do enjoy developing the game, development may slow down due to us being busy with our lives.

+

So, if you see that we aren't making any releases or videos, please be patient with us.

+
+ +
+

Stable releases

+ +

Stable releases are the most simple way to get into ShiftOS. Here's a chronologically-ordered list of all stable releases:

+ + @{ + var stable = Model.Where(x => x.IsStable == true).OrderByDescending(x => x.PostDate); + } + + + + + + + @if(stable.Count() == 0) + { + + + + + } + + @foreach(var s in stable) + { + + + + + } +
ReleaseActions
+ No stable releases have been made yet. Check back later. +
+ + @if(s.Obsolete == true) + { + OBSOLETE: + } + @s.Name +
+

Released on @s.PostDate by @Html.UserLink(s.ReleasedBy)

+
+ Download + @Html.ActionLink("View details", "ViewDownload", "Download", new { id = s.Name }, new { @class = "btn btn-default" }) +
+
+ +
+

Unstable releases

+ +

Unstable releases are easy-to-setup ways of getting more cutting-edge features that may not be present in stable releases. They may be buggy, so try at your own risk!

+ + @{ + var unstable = Model.Where(x => x.IsStable == false).OrderByDescending(x => x.PostDate); + } + + + + + + + @if (unstable.Count() == 0) + { + + + + + } + + @foreach (var s in unstable) + { + + + + + } +
ReleaseActions
+ No unstable releases have been made yet. Check back later. +
+ + @if (s.Obsolete == true) + { + OBSOLETE: + } + @s.Name +
+

Released on @s.PostDate by @Html.UserLink(s.ReleasedBy)

+
+ Download + @Html.ActionLink("View details", "ViewDownload", "Download", new { id = s.Name }, new { @class = "btn btn-default" }) +
+
+ +
+

ShiftOS - Rolling Release Edition

+ +

Using the power of AppVeyor, we are able to give you precompiled versions of the latest source code - containing the most bleeding edge features and bugfixes, without the complication of having to compile the game yourself.

+ +

All you have to do is go to our AppVeyor page, and go to Artifacts. There, you will see the most recent successful build with download links containing various different parts of the game.

+ +

Pay attention to the build status though! If it is "Build passing", you are downloading the most recent version of the code. If it does not, AppVeyor is either still compiling the game, or it has failed, and until the issue is resolved you'll be on a slightly older version of the game.

+ +

The AppVeyor build status is shown at the top of every page.

+
+ +
+

Source code

+ +

ShiftOS is open-source software - which means our code is fully available for you to see, use, modify and distribute (as long as you abide by the @Html.ActionLink("software license", "SoftwareLicense", "Legal") and @Html.ActionLink("terms of service", "TOS", "Legal"), of course).

+ +

If you know C# and can compile Visual Studio projects, then go ahead and head over to our GitHub repository! We'll see you there!

+
\ No newline at end of file diff --git a/Project-Unite/Views/Shared/_Layout.cshtml b/Project-Unite/Views/Shared/_Layout.cshtml index 4146e13..14f3c69 100644 --- a/Project-Unite/Views/Shared/_Layout.cshtml +++ b/Project-Unite/Views/Shared/_Layout.cshtml @@ -35,7 +35,7 @@