diff options
| author | Jake Mannens <jake@asger.xyz> | 2023-08-30 01:12:27 +1000 |
|---|---|---|
| committer | Jake Mannens <jake@asger.xyz> | 2025-08-20 00:48:44 +1000 |
| commit | ec8d0a280640e9e1722bc55f2ab609061a5a39a6 (patch) | |
| tree | a7377777d5270fbfe0f80afece84dd1d48ac7532 /Pages | |
| parent | 907ff70c379f2f44f5306e79f6eef93eae685747 (diff) | |
Made tag names in TagDefinitions clickable
Diffstat (limited to 'Pages')
| -rw-r--r-- | Pages/Component/MediaTagTable.razor | 2 | ||||
| -rw-r--r-- | Pages/Component/MediaTagTable.razor.css | 8 | ||||
| -rw-r--r-- | Pages/TagDefinitions.razor | 37 |
3 files changed, 30 insertions, 17 deletions
diff --git a/Pages/Component/MediaTagTable.razor b/Pages/Component/MediaTagTable.razor index dedf865..e367f7f 100644 --- a/Pages/Component/MediaTagTable.razor +++ b/Pages/Component/MediaTagTable.razor @@ -19,7 +19,7 @@ } </td> <td> - <a href="/Gallery?q=@(e.tagDef.Name)"> + <a href="/Gallery?q=@(e.tagDef.Name)" class="nondecorated"> @if(e.isImplicit) { <i>@e.tagDef.Name</i> } else { diff --git a/Pages/Component/MediaTagTable.razor.css b/Pages/Component/MediaTagTable.razor.css index 3b5cffe..dcf5e09 100644 --- a/Pages/Component/MediaTagTable.razor.css +++ b/Pages/Component/MediaTagTable.razor.css @@ -1,11 +1,3 @@ td { font-size: 8pt; } - -td:nth-child(2) a { - color: #fff; -} - -td:nth-child(2) a:hover { - color: #999; -} diff --git a/Pages/TagDefinitions.razor b/Pages/TagDefinitions.razor index fad1450..f5339e7 100644 --- a/Pages/TagDefinitions.razor +++ b/Pages/TagDefinitions.razor @@ -9,10 +9,10 @@ <link rel="stylesheet" type="text/css" href="@(nameof(HyperBooru)).styles.css"/> <ButtonContainer> - <button @onclick=@(() => createTagDialog.Show())>Create</button> + <button @onclick=PromptToCreate>Create</button> </ButtonContainer> -<TabContainer> +<TabContainer @ref=tabContainer> @foreach(var ns in tagNamespaces) { <TabPane Title="@(ns ?? "Default")"> <table id="tag-definitions" class="data-table"> @@ -25,17 +25,32 @@ @foreach(var tagDef in tagDefinitions.Where(td => td.Namespace == ns)) { <tr data-guid="@tagDef.Guid"> <td>@tagDef.Alias</td> - <td>@tagDef.Name</td> + <td> + <a href="/Gallery?q=@tagDef.Name" class="nondecorated"> + @tagDef.Name + </a> + </td> <td> <i> - @(string.Join(", ", tagDef.ImplicitTags + @{ + var implicitTags = tagDef.ImplicitTags + .Where(td => td.Source == TagSource.UserTag); + foreach(var tag in implicitTags) { + <a href="/Gallery?q=@tag.Name" class="nondecorated"> + @tag.Name + </a> + if(tag != implicitTags.Last()) + @(", ") + } + } + +@* @(string.Join(", ", tagDef.ImplicitTags .Where(it => it.Source == TagSource.UserTag) .Select(it => it.Name) .Order())) - </i> +*@ </i> </td> - <td> - <a href="/Gallery?q=@tagDef.Name">Search</a> + <td class="actions"> <a href="javascript:;" @onclick=@(() => PromptToEdit(tagDef))>Edit</a> <a href="javascript:;" @onclick=@(() => PromptToDelete(tagDef))> Delete @@ -97,7 +112,8 @@ OnSubmit=SetImplicitTags @ref=implicitTagDialog /> - @code { +@code { + private TabContainer tabContainer; private Dialog createTagDialog; private Dialog deleteTagDialog; private Dialog editTagDialog; @@ -146,6 +162,11 @@ .ToArray(); } + private void PromptToCreate() { + var curTitle = tabContainer.ActivePane?.Title; + tagNamespace = curTitle == "Default" ? null : curTitle; + createTagDialog.Show(); + } private void CreateTagDefinition() { if(string.IsNullOrEmpty(tagNamespace)) |
