From 5247aa5a136fcf48d80c8e75625ae773a14fbd26 Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Wed, 9 Aug 2023 09:21:36 +1000 Subject: Added the ability to delete media items --- Pages/Shared/_Layout.cshtml | 2 +- Pages/TagDefinitions.cshtml | 104 ++++++++++++++++++++++++++++++++++++++++ Pages/TagDefinitions.cshtml.cs | 16 +++++++ Pages/TagDefinitions.cshtml.css | 16 +++++++ Pages/ViewMedia.cshtml | 30 +++++++++--- Pages/ViewMedia.cshtml.css | 5 ++ 6 files changed, 166 insertions(+), 7 deletions(-) create mode 100644 Pages/TagDefinitions.cshtml create mode 100644 Pages/TagDefinitions.cshtml.cs create mode 100644 Pages/TagDefinitions.cshtml.css (limited to 'Pages') diff --git a/Pages/Shared/_Layout.cshtml b/Pages/Shared/_Layout.cshtml index be445cc..9cdb952 100644 --- a/Pages/Shared/_Layout.cshtml +++ b/Pages/Shared/_Layout.cshtml @@ -16,7 +16,7 @@
@RenderBody() diff --git a/Pages/TagDefinitions.cshtml b/Pages/TagDefinitions.cshtml new file mode 100644 index 0000000..a05f5d5 --- /dev/null +++ b/Pages/TagDefinitions.cshtml @@ -0,0 +1,104 @@ +@page +@model HyperBooru.Pages.TagDefinitionsModel +@{ + ViewBag.Title = "Tag Definitions"; +} + + + + + + + + + + + + + + @foreach(var tagDef in Model.TagDefinitions) { + + + + + + + + } +
GuidSourceNamespaceName
@tagDef.Guid@tagDef.Source@tagDef.Namespace@tagDef.Name
+ +
+ +
+ +
+

Create a new tag definition

+
+
+ + + + +
+ + +
+
+
+ +
+

Are you sure you want to delete this tag definition?

+
+
+ + +
+
diff --git a/Pages/TagDefinitions.cshtml.cs b/Pages/TagDefinitions.cshtml.cs new file mode 100644 index 0000000..e2253d6 --- /dev/null +++ b/Pages/TagDefinitions.cshtml.cs @@ -0,0 +1,16 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace HyperBooru.Pages; + +public class TagDefinitionsModel : PageModel { + public IEnumerable TagDefinitions => + db.TagDefinitions; + + private HyperBooruDbContext db; + + public TagDefinitionsModel(HyperBooruDbContext db) => + this.db = db; + + public void OnGet() {} +} diff --git a/Pages/TagDefinitions.cshtml.css b/Pages/TagDefinitions.cshtml.css new file mode 100644 index 0000000..0a9e226 --- /dev/null +++ b/Pages/TagDefinitions.cshtml.css @@ -0,0 +1,16 @@ +form > input { + width: 100%; +} + +div.button-container { + display: flex; + justify-content: flex-end; +} + +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 967759b..3d0ce4a 100644 --- a/Pages/ViewMedia.cshtml +++ b/Pages/ViewMedia.cshtml @@ -17,6 +17,10 @@ } } + function showDeleteDialog(visible) { + document.getElementById('delete-dialog').classList.toggle('visible', visible); + } + function selectPane(tab) { var tabs = Array.from(document.querySelectorAll('div#metadata-header > a')); @@ -44,8 +48,8 @@
@*
@@ -54,7 +58,7 @@
*@ -
+

Upload history


@@ -75,14 +79,28 @@ }
+
+ +
-
+
Tag Name
- +
+ +
-
\ No newline at end of file +
+ +
+

Delete this media?

+
+
+ + +
+
diff --git a/Pages/ViewMedia.cshtml.css b/Pages/ViewMedia.cshtml.css index ff8a1cd..4041fa8 100644 --- a/Pages/ViewMedia.cshtml.css +++ b/Pages/ViewMedia.cshtml.css @@ -49,4 +49,9 @@ div#metadata-fileinfo > table th { div#metadata-fileinfo > table td { font-family: 'Lucida Console'; font-size: 8pt; +} + +div.button-container { + display: flex; + justify-content: flex-end; } \ No newline at end of file -- cgit v1.3