diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-12-03 23:06:42 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2019-12-03 23:06:42 -0500 |
commit | 8ddb60cee636cc17291100c316df4786eb3bb448 (patch) | |
tree | ae86b8f6ccc482a913aeabe04b9a72dd2fa5d02e /src | |
parent | 2b1f607d41b3d4d071c0db0671dbc99b6982909f (diff) | |
download | SMAPI-8ddb60cee636cc17291100c316df4786eb3bb448.tar.gz SMAPI-8ddb60cee636cc17291100c316df4786eb3bb448.tar.bz2 SMAPI-8ddb60cee636cc17291100c316df4786eb3bb448.zip |
move supporter list into environment config
Diffstat (limited to 'src')
-rw-r--r-- | src/SMAPI.Web/Controllers/IndexController.cs | 2 | ||||
-rw-r--r-- | src/SMAPI.Web/Framework/ConfigModels/SiteConfig.cs | 3 | ||||
-rw-r--r-- | src/SMAPI.Web/ViewModels/IndexModel.cs | 7 | ||||
-rw-r--r-- | src/SMAPI.Web/Views/Index/Index.cshtml | 24 | ||||
-rw-r--r-- | src/SMAPI.Web/appsettings.Development.json | 5 | ||||
-rw-r--r-- | src/SMAPI.Web/appsettings.json | 5 |
6 files changed, 22 insertions, 24 deletions
diff --git a/src/SMAPI.Web/Controllers/IndexController.cs b/src/SMAPI.Web/Controllers/IndexController.cs index 4e3602d5..a887f14a 100644 --- a/src/SMAPI.Web/Controllers/IndexController.cs +++ b/src/SMAPI.Web/Controllers/IndexController.cs @@ -72,7 +72,7 @@ namespace StardewModdingAPI.Web.Controllers : null; // render view - var model = new IndexModel(stableVersionModel, betaVersionModel, this.SiteConfig.BetaBlurb); + var model = new IndexModel(stableVersionModel, betaVersionModel, this.SiteConfig.BetaBlurb, this.SiteConfig.SupporterList); return this.View(model); } diff --git a/src/SMAPI.Web/Framework/ConfigModels/SiteConfig.cs b/src/SMAPI.Web/Framework/ConfigModels/SiteConfig.cs index d379c423..43969f51 100644 --- a/src/SMAPI.Web/Framework/ConfigModels/SiteConfig.cs +++ b/src/SMAPI.Web/Framework/ConfigModels/SiteConfig.cs @@ -11,5 +11,8 @@ namespace StardewModdingAPI.Web.Framework.ConfigModels /// <summary>A short sentence shown under the beta download button, if any.</summary> public string BetaBlurb { get; set; } + + /// <summary>A list of supports to credit on the main page, in Markdown format.</summary> + public string SupporterList { get; set; } } } diff --git a/src/SMAPI.Web/ViewModels/IndexModel.cs b/src/SMAPI.Web/ViewModels/IndexModel.cs index 82c4e06f..450fdc0e 100644 --- a/src/SMAPI.Web/ViewModels/IndexModel.cs +++ b/src/SMAPI.Web/ViewModels/IndexModel.cs @@ -15,6 +15,9 @@ namespace StardewModdingAPI.Web.ViewModels /// <summary>A short sentence shown under the beta download button, if any.</summary> public string BetaBlurb { get; set; } + /// <summary>A list of supports to credit on the main page, in Markdown format.</summary> + public string SupporterList { get; set; } + /********* ** Public methods @@ -26,11 +29,13 @@ namespace StardewModdingAPI.Web.ViewModels /// <param name="stableVersion">The latest stable SMAPI version.</param> /// <param name="betaVersion">The latest prerelease SMAPI version (if newer than <paramref name="stableVersion"/>).</param> /// <param name="betaBlurb">A short sentence shown under the beta download button, if any.</param> - internal IndexModel(IndexVersionModel stableVersion, IndexVersionModel betaVersion, string betaBlurb) + /// <param name="supporterList">A list of supports to credit on the main page, in Markdown format.</param> + internal IndexModel(IndexVersionModel stableVersion, IndexVersionModel betaVersion, string betaBlurb, string supporterList) { this.StableVersion = stableVersion; this.BetaVersion = betaVersion; this.BetaBlurb = betaBlurb; + this.SupporterList = supporterList; } } } diff --git a/src/SMAPI.Web/Views/Index/Index.cshtml b/src/SMAPI.Web/Views/Index/Index.cshtml index ec9cfafe..5d91dc84 100644 --- a/src/SMAPI.Web/Views/Index/Index.cshtml +++ b/src/SMAPI.Web/Views/Index/Index.cshtml @@ -1,3 +1,4 @@ +@using Markdig @using Microsoft.Extensions.Options @using StardewModdingAPI.Web.Framework @using StardewModdingAPI.Web.Framework.ConfigModels @@ -94,29 +95,22 @@ else </li> <li> <a href="https://ko-fi.com/pathoschild" class="donate-button"> - <img src="Content/images/ko-fi.png"/> Buy me a coffee + <img src="Content/images/ko-fi.png" /> Buy me a coffee </a> </li> <li> <a href="https://www.paypal.me/pathoschild" class="donate-button"> - <img src="Content/images/paypal.png"/> Donate via PayPal + <img src="Content/images/paypal.png" /> Donate via PayPal </a> </li> </ul> -<p> - Special thanks to - <a href="https://www.nexusmods.com/users/65566526?tab=user+files">bwdy</a>, - hawkfalcon, - <a href="https://twitter.com/iKeychain">iKeychain</a>, - jwdred, - <a href="https://www.nexusmods.com/users/12252523">Karmylla</a>, - <a href="https://www.nexusmods.com/stardewvalley/users/51777556">minervamaga</a>, - Pucklynn, - Renorien, - Robby LaFarge, - and a few anonymous users for their ongoing support on Patreon; you're awesome! -</p> +@if (!string.IsNullOrWhiteSpace(Model.SupporterList)) +{ + @Html.Raw(Markdig.Markdown.ToHtml( + $"Special thanks to {Model.SupporterList}, and a few anonymous users for their ongoing support on Patreon; you're awesome!" + )) +} <h2 id="modcreators">For mod creators</h2> <ul> diff --git a/src/SMAPI.Web/appsettings.Development.json b/src/SMAPI.Web/appsettings.Development.json index 6b32f4ab..74ded25d 100644 --- a/src/SMAPI.Web/appsettings.Development.json +++ b/src/SMAPI.Web/appsettings.Development.json @@ -8,11 +8,6 @@ */ { - "Site": { - "BetaEnabled": false, - "BetaBlurb": null - }, - "ApiClients": { "AmazonAccessKey": null, "AmazonSecretKey": null, diff --git a/src/SMAPI.Web/appsettings.json b/src/SMAPI.Web/appsettings.json index b3567469..2e20b299 100644 --- a/src/SMAPI.Web/appsettings.json +++ b/src/SMAPI.Web/appsettings.json @@ -16,8 +16,9 @@ }, "Site": { - "BetaEnabled": null, - "BetaBlurb": null + "BetaEnabled": false, + "BetaBlurb": null, + "SupporterList": null }, "ApiClients": { |