summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Views/JsonValidator
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-08-06 01:31:15 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-09-14 19:06:09 -0400
commit74e86de01e0f3fc7424a9dd0e7fa43853b35ae1e (patch)
tree0a5958f54ca2f727a4b7f218fe3179e3fa844849 /src/SMAPI.Web/Views/JsonValidator
parent2cc183b48ba33488f3f475a0ab4d931ee6cf2d58 (diff)
downloadSMAPI-74e86de01e0f3fc7424a9dd0e7fa43853b35ae1e.tar.gz
SMAPI-74e86de01e0f3fc7424a9dd0e7fa43853b35ae1e.tar.bz2
SMAPI-74e86de01e0f3fc7424a9dd0e7fa43853b35ae1e.zip
when uploading a new file to the JSON validator, prefill previous schema type by default (#654)
Diffstat (limited to 'src/SMAPI.Web/Views/JsonValidator')
-rw-r--r--src/SMAPI.Web/Views/JsonValidator/Index.cshtml13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/SMAPI.Web/Views/JsonValidator/Index.cshtml b/src/SMAPI.Web/Views/JsonValidator/Index.cshtml
index 6e5da7e5..34c1c1f3 100644
--- a/src/SMAPI.Web/Views/JsonValidator/Index.cshtml
+++ b/src/SMAPI.Web/Views/JsonValidator/Index.cshtml
@@ -3,6 +3,11 @@
@{
ViewData["Title"] = "JSON validator";
+
+ 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;
}
@section Head {
@@ -37,8 +42,8 @@ else if (Model.ParseError != null)
{
<div class="banner error">
<strong>Oops, couldn't parse that JSON.</strong><br />
- Share this link to let someone see this page: <code>@(new Uri(new Uri(Model.SectionUrl), Model.PasteID))</code><br />
- (Or <a href="@Model.SectionUrl">validate a new file</a>.)<br />
+ Share this link to let someone see this page: <code>@curPageUrl</code><br />
+ (Or <a href="@newUploadUrl">validate a new file</a>.)<br />
<br />
<small v-pre>Error details: @Model.ParseError</small>
</div>
@@ -46,8 +51,8 @@ else if (Model.ParseError != null)
else if (Model.PasteID != null)
{
<div class="banner success">
- <strong>Share this link to let someone else see this page:</strong> <code>@(new Uri(new Uri(Model.SectionUrl), $"{Model.SchemaName}/{Model.PasteID}"))</code><br />
- (Or <a href="@Model.SectionUrl">validate a new file</a>.)
+ <strong>Share this link to let someone else see this page:</strong> <code>@curPageUrl</code><br />
+ (Or <a href="@newUploadUrl">validate a new file</a>.)
</div>
}