From 812eae0b5b75f24adebfe6347ecda26c04b8181b Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Thu, 10 Aug 2023 01:56:12 +1000 Subject: Added ability to tag media --- Pages/Shared/_Layout.cshtml | 2 +- Pages/Shared/_Layout.cshtml.css | 6 ++++ Pages/TagDefinitions.cshtml | 12 +++++--- Pages/TagDefinitions.cshtml.css | 4 --- Pages/ViewMedia.cshtml | 66 ++++++++++++++++++++++++++++++++++++++-- Pages/ViewMedia.cshtml.cs | 3 ++ Pages/ViewMedia.cshtml.css | 38 ++++++++++++++++++++++- wwwroot/styles/global.css | 67 +++++++++++++++++++++++++++++++++-------- 8 files changed, 173 insertions(+), 25 deletions(-) diff --git a/Pages/Shared/_Layout.cshtml b/Pages/Shared/_Layout.cshtml index 9cdb952..4c80500 100644 --- a/Pages/Shared/_Layout.cshtml +++ b/Pages/Shared/_Layout.cshtml @@ -18,7 +18,7 @@ Home Tags -
+
@RenderBody()
diff --git a/Pages/Shared/_Layout.cshtml.css b/Pages/Shared/_Layout.cshtml.css index 5b2ba65..22e36db 100644 --- a/Pages/Shared/_Layout.cshtml.css +++ b/Pages/Shared/_Layout.cshtml.css @@ -4,15 +4,21 @@ } 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 { background: #fff; color: var(--col-navbar-bg); +} + +#content { + flex: 1 1 calc(100vh - 119px); } \ No newline at end of file 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 3d0ce4a..e37bbf1 100644 --- a/Pages/ViewMedia.cshtml +++ b/Pages/ViewMedia.cshtml @@ -7,8 +7,9 @@