From 9560baeb71ca17c8b86b3674daddd13765ba0f24 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 9 Nov 2018 17:35:56 -0500 Subject: add filters to mod compatibility list (#597) --- docs/release-notes.md | 4 +- src/SMAPI.Web/ViewModels/ModCompatibilityModel.cs | 2 + src/SMAPI.Web/ViewModels/ModModel.cs | 3 + src/SMAPI.Web/Views/Mods/Index.cshtml | 34 +++-- src/SMAPI.Web/wwwroot/Content/css/mods.css | 47 +++++-- src/SMAPI.Web/wwwroot/Content/js/mods.js | 144 ++++++++++++++++++++-- 6 files changed, 201 insertions(+), 33 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index b9a73f99..9d587ab7 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -10,7 +10,7 @@ * You can now mark a mod folder ignored by starting the name with a dot (like `.disabled mods`). * Improved various error messages to be more clear and intuitive. * SMAPI now prevents a crash caused by mods adding dialogue the game can't parse. - * When you have an older game version, SMAPI now recommends a compatible SMAPI version in its error. + * SMAPI now recommends a compatible SMAPI version if you have an older game version. * Fixed transparency issues on Linux/Mac for some mod images. * Fixed error when a mod manifest is corrupted. * Fixed error when a mod adds an unnamed location. @@ -50,7 +50,7 @@ * Suppressed the game's 'added crickets' debug output. * Updated dependencies (Harmony 1.0.9.1 → 1.2.0.1, Mono.Cecil 0.10 → 0.10.1). * **Deprecations:** - * Non-string manifest versions are now deprecated and will no longer work in SMAPI 3.0. Affected mods should be updated to use a string version, like `"Version": "1.0.0"`. + * Non-string manifest versions are now deprecated and will stop working in SMAPI 3.0. Affected mods should use a string version, like `"Version": "1.0.0"`. * `ISemanticVersion.Build` is now deprecated and will be removed in SMAPI 3.0. Affected mods should use `ISemanticVersion.PrereleaseTag` instead. * **Breaking changes:** * `helper.ModRegistry` now returns `IModInfo` instead of `IManifest` directly. This lets SMAPI return more metadata about mods. diff --git a/src/SMAPI.Web/ViewModels/ModCompatibilityModel.cs b/src/SMAPI.Web/ViewModels/ModCompatibilityModel.cs index 61756176..85bf1e46 100644 --- a/src/SMAPI.Web/ViewModels/ModCompatibilityModel.cs +++ b/src/SMAPI.Web/ViewModels/ModCompatibilityModel.cs @@ -29,6 +29,8 @@ namespace StardewModdingAPI.Web.ViewModels public ModCompatibilityModel(WikiCompatibilityInfo info) { this.Status = info.Status.ToString(); + this.Status = this.Status.Substring(0, 1).ToLower() + this.Status.Substring(1); + this.Summary = info.Summary; this.BrokeIn = info.BrokeIn; if (info.UnofficialVersion != null) diff --git a/src/SMAPI.Web/ViewModels/ModModel.cs b/src/SMAPI.Web/ViewModels/ModModel.cs index 309ed828..0e7d2076 100644 --- a/src/SMAPI.Web/ViewModels/ModModel.cs +++ b/src/SMAPI.Web/ViewModels/ModModel.cs @@ -40,6 +40,9 @@ namespace StardewModdingAPI.Web.ViewModels /// A unique identifier for the mod that can be used in an anchor URL. public string Slug { get; set; } + /// The sites where the mod can be downloaded. + public string[] ModPageSites => this.ModPages.Select(p => p.Text).ToArray(); + /********* ** Public methods diff --git a/src/SMAPI.Web/Views/Mods/Index.cshtml b/src/SMAPI.Web/Views/Mods/Index.cshtml index b326fd36..372d6706 100644 --- a/src/SMAPI.Web/Views/Mods/Index.cshtml +++ b/src/SMAPI.Web/Views/Mods/Index.cshtml @@ -4,11 +4,11 @@ ViewData["Title"] = "SMAPI mod compatibility"; } @section Head { - + - +