summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Views/JsonValidator
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-12-02 22:48:00 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2019-12-02 22:48:00 -0500
commitd34f369d35290bca96cc7225d9765d1a8a66fa8b (patch)
tree141bc6b30760bf5745b7adb9ce60f0cf6c8fa720 /src/SMAPI.Web/Views/JsonValidator
parenta3f21685049cabf2d824c8060dc0b1de47e9449e (diff)
parent1128451acf56cf479864047c0bb8bb18e232fa00 (diff)
downloadSMAPI-d34f369d35290bca96cc7225d9765d1a8a66fa8b.tar.gz
SMAPI-d34f369d35290bca96cc7225d9765d1a8a66fa8b.tar.bz2
SMAPI-d34f369d35290bca96cc7225d9765d1a8a66fa8b.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI.Web/Views/JsonValidator')
-rw-r--r--src/SMAPI.Web/Views/JsonValidator/Index.cshtml11
1 files changed, 6 insertions, 5 deletions
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 />