From adee66b3b4ea111b0082a31108e55726fab10643 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 25 Dec 2017 01:47:10 -0500 Subject: add basic download page (#411) --- src/SMAPI.Web/Views/Index/Index.cshtml | 73 ++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 src/SMAPI.Web/Views/Index/Index.cshtml (limited to 'src/SMAPI.Web/Views') diff --git a/src/SMAPI.Web/Views/Index/Index.cshtml b/src/SMAPI.Web/Views/Index/Index.cshtml new file mode 100644 index 00000000..b2b8c0dd --- /dev/null +++ b/src/SMAPI.Web/Views/Index/Index.cshtml @@ -0,0 +1,73 @@ +@{ + ViewData["Title"] = "SMAPI"; +} +@model StardewModdingAPI.Web.ViewModels.IndexModel + + + +

+ SMAPI is the modding API for Stardew Valley. It works fine with Steam achievements and the + overlay, you can uninstall it anytime, and there's a friendly community if you need help. It's + a cool boy. +

+ +

Download and links

+ + +

What's new in SMAPI @Model.LatestVersion?

+
+ @Html.Raw(Markdig.Markdown.ToHtml(Model.Description)) +
+ +

Support SMAPI ♥

+ + +

+ Special thanks to + acerbicon, + ChefRude, + jwdred, + Karmylla, + OfficialPiAddict, + Robby LaFarge, + and a few anonymous users for supporting SMAPI; you're awesome! +

+ +

For mod creators

+ -- cgit From 70cbfa541dade1822394f81bd1d5b6baa18e51e9 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 25 Dec 2017 01:53:10 -0500 Subject: support contextual nav URLs, update nav menu (#411) --- src/SMAPI.Web/Controllers/LogParserController.cs | 10 +++++----- src/SMAPI.Web/Framework/ConfigModels/ContextConfig.cs | 15 +++++++++++++++ src/SMAPI.Web/Framework/ConfigModels/LogParserConfig.cs | 12 ------------ src/SMAPI.Web/Startup.cs | 2 +- src/SMAPI.Web/Views/Shared/_Layout.cshtml | 10 +++++++--- src/SMAPI.Web/appsettings.Development.json | 7 ++++--- src/SMAPI.Web/appsettings.json | 7 ++++--- 7 files changed, 36 insertions(+), 27 deletions(-) create mode 100644 src/SMAPI.Web/Framework/ConfigModels/ContextConfig.cs delete mode 100644 src/SMAPI.Web/Framework/ConfigModels/LogParserConfig.cs (limited to 'src/SMAPI.Web/Views') diff --git a/src/SMAPI.Web/Controllers/LogParserController.cs b/src/SMAPI.Web/Controllers/LogParserController.cs index ad979397..04a11a82 100644 --- a/src/SMAPI.Web/Controllers/LogParserController.cs +++ b/src/SMAPI.Web/Controllers/LogParserController.cs @@ -19,7 +19,7 @@ namespace StardewModdingAPI.Web.Controllers ** Properties *********/ /// The log parser config settings. - private readonly LogParserConfig Config; + private readonly ContextConfig Config; /// The underlying Pastebin client. private readonly IPastebinClient Pastebin; @@ -36,11 +36,11 @@ namespace StardewModdingAPI.Web.Controllers ** Constructor ***/ /// Construct an instance. - /// The log parser config settings. + /// The context config settings. /// The Pastebin API client. - public LogParserController(IOptions configProvider, IPastebinClient pastebin) + public LogParserController(IOptions contextProvider, IPastebinClient pastebin) { - this.Config = configProvider.Value; + this.Config = contextProvider.Value; this.Pastebin = pastebin; } @@ -54,7 +54,7 @@ namespace StardewModdingAPI.Web.Controllers [Route("log/{id}")] public ViewResult Index(string id = null) { - return this.View("Index", new LogParserModel(this.Config.SectionUrl, id)); + return this.View("Index", new LogParserModel(this.Config.LogParserUrl, id)); } /*** diff --git a/src/SMAPI.Web/Framework/ConfigModels/ContextConfig.cs b/src/SMAPI.Web/Framework/ConfigModels/ContextConfig.cs new file mode 100644 index 00000000..117462f4 --- /dev/null +++ b/src/SMAPI.Web/Framework/ConfigModels/ContextConfig.cs @@ -0,0 +1,15 @@ +namespace StardewModdingAPI.Web.Framework.ConfigModels +{ + /// The config settings for the app context. + public class ContextConfig // must be public to pass into views + { + /********* + ** Accessors + *********/ + /// The root URL for the app. + public string RootUrl { get; set; } + + /// The root URL for the log parser. + public string LogParserUrl { get; set; } + } +} diff --git a/src/SMAPI.Web/Framework/ConfigModels/LogParserConfig.cs b/src/SMAPI.Web/Framework/ConfigModels/LogParserConfig.cs deleted file mode 100644 index 198274b2..00000000 --- a/src/SMAPI.Web/Framework/ConfigModels/LogParserConfig.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace StardewModdingAPI.Web.Framework.ConfigModels -{ - /// The config settings for the log parser. - internal class LogParserConfig - { - /********* - ** Accessors - *********/ - /// The root URL for the log parser controller. - public string SectionUrl { get; set; } - } -} diff --git a/src/SMAPI.Web/Startup.cs b/src/SMAPI.Web/Startup.cs index c6e3f85d..e5e759e7 100644 --- a/src/SMAPI.Web/Startup.cs +++ b/src/SMAPI.Web/Startup.cs @@ -48,7 +48,7 @@ namespace StardewModdingAPI.Web // init configuration services .Configure(this.Configuration.GetSection("ModUpdateCheck")) - .Configure(this.Configuration.GetSection("LogParser")) + .Configure(this.Configuration.GetSection("Context")) .Configure(options => options.ConstraintMap.Add("semanticVersion", typeof(VersionConstraint))) .AddMemoryCache() .AddMvc() diff --git a/src/SMAPI.Web/Views/Shared/_Layout.cshtml b/src/SMAPI.Web/Views/Shared/_Layout.cshtml index 547a8178..ac98c71b 100644 --- a/src/SMAPI.Web/Views/Shared/_Layout.cshtml +++ b/src/SMAPI.Web/Views/Shared/_Layout.cshtml @@ -1,3 +1,7 @@ +@using Microsoft.Extensions.Options +@using StardewModdingAPI.Web.Framework.ConfigModels +@inject IOptions ContextConfig + @@ -10,9 +14,9 @@
diff --git a/src/SMAPI.Web/appsettings.Development.json b/src/SMAPI.Web/appsettings.Development.json index 45fc30f3..495af120 100644 --- a/src/SMAPI.Web/appsettings.Development.json +++ b/src/SMAPI.Web/appsettings.Development.json @@ -16,14 +16,15 @@ "Microsoft": "Information" } }, + "Context": { + "RootUrl": "http://localhost:59482/", + "LogParserUrl": "http://localhost:59482/log/" + }, "ApiClients": { "GitHubUsername": null, "GitHubPassword": null, "PastebinUserKey": null, "PastebinDevKey": null - }, - "LogParser": { - "SectionUrl": "http://localhost:59482/log/" } } diff --git a/src/SMAPI.Web/appsettings.json b/src/SMAPI.Web/appsettings.json index 69b3b4f8..9758f4a7 100644 --- a/src/SMAPI.Web/appsettings.json +++ b/src/SMAPI.Web/appsettings.json @@ -13,6 +13,10 @@ "Default": "Warning" } }, + "Context": { + "RootUrl": null, // see top note + "LogParserUrl": null // see top note + }, "ApiClients": { "UserAgent": "SMAPI/{0} (+https://github.com/Pathoschild/SMAPI)", @@ -41,8 +45,5 @@ "ChucklefishKey": "Chucklefish", "GitHubKey": "GitHub", "NexusKey": "Nexus" - }, - "LogParser": { - "SectionUrl": null // see top note } } -- cgit From 05136e69f10a40998181423a6e507386d620ff98 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 25 Dec 2017 10:26:31 -0500 Subject: prettify download page (#411) --- src/SMAPI.Web/Views/Index/Index.cshtml | 46 +++++++++-------------- src/SMAPI.Web/wwwroot/Content/css/index.css | 58 +++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 28 deletions(-) create mode 100644 src/SMAPI.Web/wwwroot/Content/css/index.css (limited to 'src/SMAPI.Web/Views') diff --git a/src/SMAPI.Web/Views/Index/Index.cshtml b/src/SMAPI.Web/Views/Index/Index.cshtml index b2b8c0dd..93dd389f 100644 --- a/src/SMAPI.Web/Views/Index/Index.cshtml +++ b/src/SMAPI.Web/Views/Index/Index.cshtml @@ -2,38 +2,26 @@ ViewData["Title"] = "SMAPI"; } @model StardewModdingAPI.Web.ViewModels.IndexModel +@section Head { + +} - -

- SMAPI is the modding API for Stardew Valley. It works fine with Steam achievements and the - overlay, you can uninstall it anytime, and there's a friendly community if you need help. It's - a cool boy. -

- -

Download and links

+

Find help

@@ -43,8 +31,10 @@ @Html.Raw(Markdig.Markdown.ToHtml(Model.Description))
+

See the release notes for more info.

+

Support SMAPI ♥

-
    +