From 594d176d39691ff46b2c99fdfaa4299a4ea43616 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Thu, 15 Mar 2018 23:36:16 -0400 Subject: prepare home page for upcoming beta (#457) --- src/SMAPI.Web/ViewModels/IndexModel.cs | 28 ++++++------------ src/SMAPI.Web/ViewModels/IndexVersionModel.cs | 41 +++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 19 deletions(-) create mode 100644 src/SMAPI.Web/ViewModels/IndexVersionModel.cs (limited to 'src/SMAPI.Web/ViewModels') diff --git a/src/SMAPI.Web/ViewModels/IndexModel.cs b/src/SMAPI.Web/ViewModels/IndexModel.cs index 6d3da91e..4268c878 100644 --- a/src/SMAPI.Web/ViewModels/IndexModel.cs +++ b/src/SMAPI.Web/ViewModels/IndexModel.cs @@ -6,17 +6,11 @@ namespace StardewModdingAPI.Web.ViewModels /********* ** Accessors *********/ - /// The latest SMAPI version. - public string LatestVersion { get; set; } + /// The latest stable SMAPI version. + public IndexVersionModel StableVersion { get; set; } - /// The Markdown description for the release. - public string Description { get; set; } - - /// The main download URL. - public string DownloadUrl { get; set; } - - /// The for-developers download URL. - public string DevDownloadUrl { get; set; } + /// The latest prerelease SMAPI version (if newer than ). + public IndexVersionModel BetaVersion { get; set; } /********* @@ -26,16 +20,12 @@ namespace StardewModdingAPI.Web.ViewModels public IndexModel() { } /// Construct an instance. - /// The latest SMAPI version. - /// The Markdown description for the release. - /// The main download URL. - /// The for-developers download URL. - internal IndexModel(string latestVersion, string description, string downloadUrl, string devDownloadUrl) + /// The latest stable SMAPI version. + /// The latest prerelease SMAPI version (if newer than ). + internal IndexModel(IndexVersionModel stableVersion, IndexVersionModel betaVersion) { - this.LatestVersion = latestVersion; - this.Description = description; - this.DownloadUrl = downloadUrl; - this.DevDownloadUrl = devDownloadUrl; + this.StableVersion = stableVersion; + this.BetaVersion = betaVersion; } } } diff --git a/src/SMAPI.Web/ViewModels/IndexVersionModel.cs b/src/SMAPI.Web/ViewModels/IndexVersionModel.cs new file mode 100644 index 00000000..4f63b979 --- /dev/null +++ b/src/SMAPI.Web/ViewModels/IndexVersionModel.cs @@ -0,0 +1,41 @@ +namespace StardewModdingAPI.Web.ViewModels +{ + /// The fields for a SMAPI version. + public class IndexVersionModel + { + /********* + ** Accessors + *********/ + /// The release version. + public string Version { get; set; } + + /// The Markdown description for the release. + public string Description { get; set; } + + /// The main download URL. + public string DownloadUrl { get; set; } + + /// The for-developers download URL (not applicable for prerelease versions). + public string DevDownloadUrl { get; set; } + + + /********* + ** Public methods + *********/ + /// Construct an instance. + public IndexVersionModel() { } + + /// Construct an instance. + /// The release number. + /// The Markdown description for the release. + /// The main download URL. + /// The for-developers download URL (not applicable for prerelease versions). + internal IndexVersionModel(string version, string description, string downloadUrl, string devDownloadUrl) + { + this.Version = version; + this.Description = description; + this.DownloadUrl = downloadUrl; + this.DevDownloadUrl = devDownloadUrl; + } + } +} -- cgit