From bdd371592aad2b37f3079ffb5c2665af0b488cb7 Mon Sep 17 00:00:00 2001 From: adelikat Date: Mon, 2 Sep 2024 09:12:04 -0500 Subject: [PATCH] fix publications/catalog, "Show Verified" -> "Show Sync Verified", remove console.logs --- TASVideos/Pages/Submissions/Index.cshtml.cs | 1 + TASVideos/wwwroot/js/catalog.js | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/TASVideos/Pages/Submissions/Index.cshtml.cs b/TASVideos/Pages/Submissions/Index.cshtml.cs index edf6aa5d8..6c2de3441 100644 --- a/TASVideos/Pages/Submissions/Index.cshtml.cs +++ b/TASVideos/Pages/Submissions/Index.cshtml.cs @@ -112,6 +112,7 @@ public SubmissionSearchRequest() public string? GameId { get; set; } public int? StartType { get; set; } + [Display(Name = "Show Sync Verified")] public bool? ShowVerified { get; set; } public ICollection Statuses { get; set; } = []; diff --git a/TASVideos/wwwroot/js/catalog.js b/TASVideos/wwwroot/js/catalog.js index af7042eba..933f6410e 100644 --- a/TASVideos/wwwroot/js/catalog.js +++ b/TASVideos/wwwroot/js/catalog.js @@ -14,7 +14,7 @@ function enableCataloging() { const returnUrlPath = returnUrlPathAndQuery[0]; const returnUrlQuery = returnUrlPathAndQuery[1] ?? ""; const verifiedCheckbox = document.getElementById('Catalog_SyncVerified'); - const origSyncVerified = verifiedCheckbox.checked; + const origSyncVerified = verifiedCheckbox?.checked; systemModel.onchange = function () { if (this.value) { @@ -41,7 +41,6 @@ function enableCataloging() { } gameModel.onchange = function () { - console.log('gamemodel changed') if (this.value) { createVersionBtn?.removeAttribute('disabled'); createVersionBtn?.classList.remove('disabled'); @@ -73,10 +72,9 @@ function enableCataloging() { } versionModel.onchange = function() { - console.log('version changed') setSyncVerifiedCheckbox(); } - console.log('versionModel', versionModel) + document.getElementById('create-version')?.addEventListener('click', function () { document.location = `/Games/${gameModel.value}/Versions/Edit?SystemId=${systemModel.value}&returnUrl=${generateCurrentReturnUrl() }`; }); @@ -109,6 +107,10 @@ function enableCataloging() { function setSyncVerifiedCheckbox() { const verifiedCheckbox = document.getElementById('Catalog_SyncVerified'); + if (!verifiedCheckbox) { + return; + } + const emulatorInput = document.getElementById('Catalog_Emulator'); const canVerify = systemModel.value && frameRateModel.value && gameModel.value && versionModel.value && emulatorInput.value; @@ -118,7 +120,5 @@ function enableCataloging() { verifiedCheckbox.checked = origSyncVerified; verifiedCheckbox.disabled = true; } - - } } \ No newline at end of file