summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Views
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI.Web/Views')
-rw-r--r--src/SMAPI.Web/Views/Index/Index.cshtml13
-rw-r--r--src/SMAPI.Web/Views/Index/Privacy.cshtml5
-rw-r--r--src/SMAPI.Web/Views/JsonValidator/Index.cshtml11
-rw-r--r--src/SMAPI.Web/Views/LogParser/Index.cshtml38
-rw-r--r--src/SMAPI.Web/Views/Shared/_Layout.cshtml9
5 files changed, 48 insertions, 28 deletions
diff --git a/src/SMAPI.Web/Views/Index/Index.cshtml b/src/SMAPI.Web/Views/Index/Index.cshtml
index f42dde3b..ec9cfafe 100644
--- a/src/SMAPI.Web/Views/Index/Index.cshtml
+++ b/src/SMAPI.Web/Views/Index/Index.cshtml
@@ -1,4 +1,5 @@
@using Microsoft.Extensions.Options
+@using StardewModdingAPI.Web.Framework
@using StardewModdingAPI.Web.Framework.ConfigModels
@inject IOptions<SiteConfig> SiteConfig
@model StardewModdingAPI.Web.ViewModels.IndexModel
@@ -44,14 +45,14 @@
}
<div><a href="https://stardewvalleywiki.com/Modding:Player_Guide" class="secondary-cta">Player guide</a></div>
<div class="sublinks">
- <a href="https://github.com/Pathoschild/SMAPI">source code</a> | <a href="@(new UriBuilder(SiteConfig.Value.RootUrl) { Path = "privacy" }.Uri)">privacy</a>
+ <a href="https://github.com/Pathoschild/SMAPI">source code</a> | <a href="@Url.PlainAction("Privacy", "Index")">privacy</a>
</div>
<img id="pufferchick" src="Content/images/pufferchick.png" />
</div>
<h2 id="help">Get help</h2>
<ul>
- <li><a href="@SiteConfig.Value.ModListUrl">Mod compatibility list</a></li>
+ <li><a href="@Url.PlainAction("Index", "Mods")">Mod compatibility list</a></li>
<li>Get help <a href="https://smapi.io/community">on Discord or in the forums</a></li>
</ul>
@@ -61,7 +62,7 @@
<div class="github-description">
@Html.Raw(Markdig.Markdown.ToHtml(Model.StableVersion.Description))
</div>
- <p>See the <a href="https://github.com/Pathoschild/SMAPI/blob/develop/docs/release-notes.md#release-notes">release notes</a> and <a href="@SiteConfig.Value.ModListUrl">mod compatibility list</a> for more info.</p>
+ <p>See the <a href="https://github.com/Pathoschild/SMAPI/blob/develop/docs/release-notes.md#release-notes">release notes</a> and <a href="@Url.PlainAction("Index", "Mods")">mod compatibility list</a> for more info.</p>
}
else
{
@@ -70,13 +71,13 @@ else
<div class="github-description">
@Html.Raw(Markdig.Markdown.ToHtml(Model.StableVersion.Description))
</div>
- <p>See the <a href="https://github.com/Pathoschild/SMAPI/blob/develop/docs/release-notes.md#release-notes">release notes</a> and <a href="@SiteConfig.Value.ModListUrl">mod compatibility list</a> for more info.</p>
+ <p>See the <a href="https://github.com/Pathoschild/SMAPI/blob/develop/docs/release-notes.md#release-notes">release notes</a> and <a href="@Url.PlainAction("Index", "Mods")">mod compatibility list</a> for more info.</p>
<h3>SMAPI @Model.BetaVersion.Version?</h3>
<div class="github-description">
@Html.Raw(Markdig.Markdown.ToHtml(Model.BetaVersion.Description))
</div>
- <p>See the <a href="https://github.com/Pathoschild/SMAPI/blob/develop/docs/release-notes.md#release-notes">release notes</a> and <a href="@SiteConfig.Value.ModListUrl">mod compatibility list</a> for more info.</p>
+ <p>See the <a href="https://github.com/Pathoschild/SMAPI/blob/develop/docs/release-notes.md#release-notes">release notes</a> and <a href="@Url.PlainAction("Index", "Mods")">mod compatibility list</a> for more info.</p>
}
<h2 id="donate">Support SMAPI ♥</h2>
@@ -105,10 +106,12 @@ else
<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,
diff --git a/src/SMAPI.Web/Views/Index/Privacy.cshtml b/src/SMAPI.Web/Views/Index/Privacy.cshtml
index 914384a8..7327de3d 100644
--- a/src/SMAPI.Web/Views/Index/Privacy.cshtml
+++ b/src/SMAPI.Web/Views/Index/Privacy.cshtml
@@ -1,4 +1,5 @@
@using Microsoft.Extensions.Options
+@using StardewModdingAPI.Web.Framework
@using StardewModdingAPI.Web.Framework.ConfigModels
@inject IOptions<SiteConfig> SiteConfig
@{
@@ -8,7 +9,7 @@
<link rel="stylesheet" href="~/Content/css/privacy.css" />
}
-&larr; <a href="@SiteConfig.Value.RootUrl">back to SMAPI page</a>
+&larr; <a href="@Url.PlainAction("Index", "Index")">back to SMAPI page</a>
<p>SMAPI is an <a href="https://github.com/Pathoschild/SMAPI">open-source</a> and non-profit project. Your privacy is important, so this page explains what information SMAPI uses and transmits. <strong>This page is informational only, it's not a legal document.</strong></p>
@@ -34,7 +35,7 @@
</ol>
<h3>Log parser</h3>
-<p>The <a href="https://log.smapi.io/">log parser page</a> lets you store a log file for analysis and sharing. The log data is stored indefinitely in an obfuscated form as unlisted pastes in <a href="https://pastebin.com/">Pastebin</a>. No personal information is stored by the log parser beyond what you choose to upload, but see <em><a href="#web-logging">web logging</a></em> and the <a href="https://pastebin.com/doc_privacy_statement">Pastebin Privacy Statement</a>.</p>
+<p>The <a href="https://smapi.io/log">log parser page</a> lets you store a log file for analysis and sharing. The log data is stored indefinitely in an obfuscated form as unlisted pastes in <a href="https://pastebin.com/">Pastebin</a>. No personal information is stored by the log parser beyond what you choose to upload, but see <em><a href="#web-logging">web logging</a></em> and the <a href="https://pastebin.com/doc_privacy_statement">Pastebin Privacy Statement</a>.</p>
<h3>Multiplayer sync</h3>
<p>As part of its multiplayer API, SMAPI transmits basic context to players you connect to (mainly your OS, SMAPI version, game version, and installed mods). This is used to enable multiplayer features like inter-mod messages, compatibility checks, etc. Although this information is normally hidden from players, it may be visible due to mods or configuration changes.</p>
diff --git a/src/SMAPI.Web/Views/JsonValidator/Index.cshtml b/src/SMAPI.Web/Views/JsonValidator/Index.cshtml
index 3143fad9..de6b06a2 100644
--- a/src/SMAPI.Web/Views/JsonValidator/Index.cshtml
+++ b/src/SMAPI.Web/Views/JsonValidator/Index.cshtml
@@ -1,10 +1,11 @@
+@using StardewModdingAPI.Web.Framework
@using StardewModdingAPI.Web.ViewModels.JsonValidator
@model JsonValidatorModel
@{
// get view data
- string curPageUrl = new Uri(new Uri(Model.SectionUrl), $"{Model.SchemaName}/{Model.PasteID}").ToString();
- string newUploadUrl = Model.SchemaName != null ? new Uri(new Uri(Model.SectionUrl), Model.SchemaName).ToString() : Model.SectionUrl;
+ string curPageUrl = this.Url.PlainAction("Index", "JsonValidator", new { schemaName = Model.SchemaName, id = Model.PasteID });
+ string newUploadUrl = this.Url.PlainAction("Index", "JsonValidator", new { schemaName = Model.SchemaName });
string schemaDisplayName = null;
bool isValidSchema = Model.SchemaName != null && Model.SchemaFormats.TryGetValue(Model.SchemaName, out schemaDisplayName) && schemaDisplayName != "None";
@@ -34,8 +35,8 @@
<script src="https://cdn.jsdelivr.net/gh/tmont/sunlight@1.22.0/src/lang/sunlight.javascript.min.js" crossorigin="anonymous"></script>
<script src="~/Content/js/json-validator.js"></script>
<script>
- $(function () {
- smapi.jsonValidator(@Json.Serialize(Model.SectionUrl), @Json.Serialize(Model.PasteID));
+ $(function() {
+ smapi.jsonValidator(@Json.Serialize(this.Url.PlainAction("Index", "JsonValidator", values: null)), @Json.Serialize(Model.PasteID));
});
</script>
}
@@ -70,7 +71,7 @@ else if (Model.PasteID != null)
@if (Model.Content == null)
{
<h2>Upload a JSON file</h2>
- <form action="@Model.SectionUrl" method="post">
+ <form action="@this.Url.PlainAction("PostAsync", "JsonValidator")" method="post">
<ol>
<li>
Choose the JSON format:<br />
diff --git a/src/SMAPI.Web/Views/LogParser/Index.cshtml b/src/SMAPI.Web/Views/LogParser/Index.cshtml
index f98ffdf9..439167bc 100644
--- a/src/SMAPI.Web/Views/LogParser/Index.cshtml
+++ b/src/SMAPI.Web/Views/LogParser/Index.cshtml
@@ -1,5 +1,7 @@
+@using Humanizer
@using Newtonsoft.Json
@using StardewModdingAPI.Toolkit.Utilities
+@using StardewModdingAPI.Web.Framework
@using StardewModdingAPI.Web.Framework.LogParsing.Models
@model StardewModdingAPI.Web.ViewModels.LogParserModel
@@ -18,7 +20,7 @@
{
<meta name="robots" content="noindex" />
}
- <link rel="stylesheet" href="~/Content/css/log-parser.css?r=20190515" />
+ <link rel="stylesheet" href="~/Content/css/log-parser.css?r=20191127" />
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js" crossorigin="anonymous"></script>
<script src="~/Content/js/log-parser.js?r=20190515"></script>
@@ -31,7 +33,7 @@
showSections: @Json.Serialize(Enum.GetNames(typeof(LogSection)).ToDictionary(section => section, section => false), noFormatting),
showLevels: @Json.Serialize(defaultFilters, noFormatting),
enableFilters: @Json.Serialize(!Model.ShowRaw)
- }, '@Model.SectionUrl');
+ }, '@this.Url.PlainAction("Index", "LogParser", values: null)');
});
</script>
}
@@ -48,8 +50,8 @@ else if (Model.ParseError != null)
{
<div class="banner error" v-pre>
<strong>Oops, couldn't parse that log. (Make sure you upload the log file, not the console text.)</strong><br />
- Share this URL when asking for help: <code>@(new Uri(new Uri(Model.SectionUrl), Model.PasteID))</code><br />
- (Or <a href="@Model.SectionUrl">upload a new log</a>.)<br />
+ Share this URL when asking for help: <code>https://@this.Context.Request.Host.ToUriComponent()@this.Url.PlainAction("Index", "LogParser", new { id = Model.PasteID }))</code><br />
+ (Or <a href="@this.Url.PlainAction("Index", "LogParser", values: null)">upload a new log</a>.)<br />
<br />
<small v-pre>Error details: @Model.ParseError</small>
</div>
@@ -57,8 +59,20 @@ else if (Model.ParseError != null)
else if (Model.ParsedLog?.IsValid == true)
{
<div class="banner success" v-pre>
- <strong>Share this link to let someone else see the log:</strong> <code>@(new Uri(new Uri(Model.SectionUrl), Model.PasteID))</code><br />
- (Or <a href="@Model.SectionUrl">upload a new log</a>.)
+ <strong>Share this link to let someone else see the log:</strong> <code>https://@this.Context.Request.Host.ToUriComponent()@this.Url.PlainAction("Index", "LogParser", new { id = Model.PasteID })</code><br />
+ (Or <a href="@this.Url.PlainAction("Index", "LogParser", values: null)">upload a new log</a>.)
+ </div>
+}
+
+@* save warnings *@
+@if (Model.UploadWarning != null || Model.Expiry != null)
+{
+ <div class="save-metadata" v-pre>
+ @if (Model.Expiry != null)
+ {
+ <text>This log will expire in @((DateTime.UtcNow - Model.Expiry.Value).Humanize()). </text>
+ }
+ <!--@Model.UploadWarning-->
</div>
}
@@ -71,7 +85,7 @@ else if (Model.ParsedLog?.IsValid == true)
@foreach (Platform platform in new[] { Platform.Android, Platform.Linux, Platform.Mac, Platform.Windows })
{
<li>
- <input type="radio" name="os" value="@platform" id="os-@platform" checked="@(Model.DetectedPlatform == platform)"/>
+ <input type="radio" name="os" value="@platform" id="os-@platform" checked="@(Model.DetectedPlatform == platform)" />
<label for="os-@platform">@platform</label>
</li>
}
@@ -114,7 +128,7 @@ else if (Model.ParsedLog?.IsValid == true)
</div>
<h2>How do I share my log?</h2>
- <form action="@Model.SectionUrl" method="post">
+ <form action="@this.Url.PlainAction("PostAsync", "LogParser")" method="post">
<ol>
<li>
Drag the file onto this textbox (or paste the text in):<br />
@@ -151,7 +165,7 @@ else if (Model.ParsedLog?.IsValid == true)
<div class="content-packs">
@foreach (LogModInfo contentPack in contentPackList.Where(pack => pack.HasUpdate))
{
- <text>+ @contentPack.Name</text><br/>
+ <text>+ @contentPack.Name</text><br />
}
</div>
}
@@ -173,7 +187,7 @@ else if (Model.ParsedLog?.IsValid == true)
<div>
@foreach (LogModInfo contentPack in contentPackList.Where(pack => pack.HasUpdate))
{
- <a href="@contentPack.UpdateLink" target="_blank">@contentPack.Version → @contentPack.UpdateVersion</a><br/>
+ <a href="@contentPack.UpdateLink" target="_blank">@contentPack.Version → @contentPack.UpdateVersion</a><br />
}
</div>
}
@@ -309,12 +323,12 @@ else if (Model.ParsedLog?.IsValid == true)
}
</table>
- <small><a href="@(new Uri(new Uri(Model.SectionUrl), Model.PasteID))?raw=true">view raw log</a></small>
+ <small><a href="@this.Url.PlainAction("Index", "LogParser", new { id = Model.PasteID, raw = true })">view raw log</a></small>
}
else
{
<pre v-pre>@Model.ParsedLog.RawText</pre>
- <small><a href="@(new Uri(new Uri(Model.SectionUrl), Model.PasteID))">view parsed log</a></small>
+ <small><a href="@this.Url.PlainAction("Index", "LogParser", new { id = Model.PasteID })">view parsed log</a></small>
}
</div>
}
diff --git a/src/SMAPI.Web/Views/Shared/_Layout.cshtml b/src/SMAPI.Web/Views/Shared/_Layout.cshtml
index 87a22f06..17f1f673 100644
--- a/src/SMAPI.Web/Views/Shared/_Layout.cshtml
+++ b/src/SMAPI.Web/Views/Shared/_Layout.cshtml
@@ -1,4 +1,5 @@
@using Microsoft.Extensions.Options
+@using StardewModdingAPI.Web.Framework
@using StardewModdingAPI.Web.Framework.ConfigModels
@inject IOptions<SiteConfig> SiteConfig
@@ -15,15 +16,15 @@
<div id="sidebar">
<h4>SMAPI</h4>
<ul>
- <li><a href="@SiteConfig.Value.RootUrl">About SMAPI</a></li>
+ <li><a href="@Url.PlainAction("Index", "Index")">About SMAPI</a></li>
<li><a href="https://stardewvalleywiki.com/Modding:Index">Modding docs</a></li>
</ul>
<h4>Tools</h4>
<ul>
- <li><a href="@SiteConfig.Value.ModListUrl">Mod compatibility</a></li>
- <li><a href="@SiteConfig.Value.LogParserUrl">Log parser</a></li>
- <li><a href="@SiteConfig.Value.JsonValidatorUrl">JSON validator</a></li>
+ <li><a href="@Url.PlainAction("Index", "Mods")">Mod compatibility</a></li>
+ <li><a href="@Url.PlainAction("Index", "LogParser", values: null)">Log parser</a></li>
+ <li><a href="@Url.PlainAction("Index", "JsonValidator", values: null)">JSON validator</a></li>
</ul>
</div>
<div id="content-column">