diff options
Diffstat (limited to 'src/SMAPI.Web/Views/JsonValidator/Index.cshtml')
-rw-r--r-- | src/SMAPI.Web/Views/JsonValidator/Index.cshtml | 11 |
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 /> |