From 0850585fb3507fbae3fe311633cc91b5a9334a00 Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Mon, 28 Aug 2023 00:39:00 +1000 Subject: Namespaces are now broken down as tabs --- Pages/TagDefinitions.razor | 80 ++++++++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 35 deletions(-) diff --git a/Pages/TagDefinitions.razor b/Pages/TagDefinitions.razor index 892ca8a..bd7394d 100644 --- a/Pages/TagDefinitions.razor +++ b/Pages/TagDefinitions.razor @@ -11,43 +11,47 @@ - - - - - - - - @foreach(var tagDef in tagDefinitions) { - - - - -
NamespaceNameImplicit Tags
@tagDef.Namespace@tagDef.Name - - @(string.Join(", ", tagDef.ImplicitTags - .Where(it => it.Source == TagSource.UserTag) - .Select(it => it.Name) - .Order())) - - - Search - PromptToEdit(tagDef))>Edit - PromptToDelete(tagDef))> - Delete - - PromptImplicitTags(tagDef))> - Implicit Tags - - @if(tagDef.ImplicitTags.Select(td => td.Guid).Contains(HBContext.NsfwTag)) { - SetNsfw(tagDef, false))>Make SFW - } else { - SetNsfw(tagDef, true))>Make NSFW + + @foreach(var ns in tagNamespaces) { + + + + + + + + @foreach(var tagDef in tagDefinitions.Where(td => td.Namespace == ns)) { + + + + + } - - +
NameImplicit Tags
@tagDef.Name + + @(string.Join(", ", tagDef.ImplicitTags + .Where(it => it.Source == TagSource.UserTag) + .Select(it => it.Name) + .Order())) + + + Search + PromptToEdit(tagDef))>Edit + PromptToDelete(tagDef))> + Delete + + PromptImplicitTags(tagDef))> + Implicit Tags + + @if(tagDef.ImplicitTags.Select(td => td.Guid).Contains(HBContext.NsfwTag)) { + SetNsfw(tagDef, false))>Make SFW + } else { + SetNsfw(tagDef, true))>Make NSFW + } +
+
} -
+
@@ -112,6 +116,12 @@ .Contains(HBContext.NsfwTag)) .ToArray(); + private string?[] tagNamespaces => tagDefinitions + .Select(td => td.Namespace) + .Order() + .Distinct() + .ToArray(); + protected override void OnInitialized() => userService.ShowNsfwChanged += ShowNsfwChanged; -- cgit v1.3