From 1e81791d10271c3e3828a92a01a3aba6a74f9ba8 Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Fri, 11 Aug 2023 00:59:50 +1000 Subject: Added ability to tag media --- Pages/Shared/_Layout.cshtml.css | 2 ++ Pages/TagDefinitions.cshtml | 12 ++++++--- Pages/TagDefinitions.cshtml.css | 4 --- Pages/ViewMedia.cshtml | 59 ++++++++++++++++++++++++++++++++++------- Pages/ViewMedia.cshtml.cs | 3 +++ Pages/ViewMedia.cshtml.css | 38 +++++++++++++++++++++++++- 6 files changed, 100 insertions(+), 18 deletions(-) (limited to 'Pages') diff --git a/Pages/Shared/_Layout.cshtml.css b/Pages/Shared/_Layout.cshtml.css index 337ec17..22e36db 100644 --- a/Pages/Shared/_Layout.cshtml.css +++ b/Pages/Shared/_Layout.cshtml.css @@ -4,12 +4,14 @@ } div#navbar > a { + color: white; display: inline-block; padding: 20px 20px 20px 20px; } div#navbar > a:hover { background: rgba(255, 255, 255, 0.4); + filter: none; } div#navbar > a:active { diff --git a/Pages/TagDefinitions.cshtml b/Pages/TagDefinitions.cshtml index a05f5d5..7bf1790 100644 --- a/Pages/TagDefinitions.cshtml +++ b/Pages/TagDefinitions.cshtml @@ -27,7 +27,9 @@ async function deleteTagDefinition() { var dialog = document.getElementById('delete-dialog'); - var resp = await fetch(`/api/tag/def/${dialog.dataset.guid}`, { + var tagDefId = dialog.dataset.guid; + + var resp = await fetch(`/api/tag/def/${tagDefId}`, { method: 'delete' }); @@ -35,7 +37,9 @@ alert('Error deleting tag definition!'); showDeleteDialog(false); } else { - window.location.reload() + var rows = Array.from(document.getElementsByTagName('tr')); + rows.find(r => r.dataset.guid == tagDefId).remove(); + showDeleteDialog(false); } } @@ -65,12 +69,12 @@ @foreach(var tagDef in Model.TagDefinitions) { - + @tagDef.Guid @tagDef.Source @tagDef.Namespace @tagDef.Name - + Delete } diff --git a/Pages/TagDefinitions.cshtml.css b/Pages/TagDefinitions.cshtml.css index 0a9e226..93001c7 100644 --- a/Pages/TagDefinitions.cshtml.css +++ b/Pages/TagDefinitions.cshtml.css @@ -9,8 +9,4 @@ div.button-container { table#tag-definitions td:first-child { font-family: 'Lucida Console'; -} - -table#tag-definitions td > button { - margin-top: 0; } \ No newline at end of file diff --git a/Pages/ViewMedia.cshtml b/Pages/ViewMedia.cshtml index 0bf58cd..e37bbf1 100644 --- a/Pages/ViewMedia.cshtml +++ b/Pages/ViewMedia.cshtml @@ -7,8 +7,9 @@