diff options
| author | Jake Mannens <jake@asger.xyz> | 2023-08-30 01:12:27 +1000 |
|---|---|---|
| committer | Jake Mannens <jake@asger.xyz> | 2023-08-30 01:15:43 +1000 |
| commit | 78fa94a78958d976127555d64f2758c56f399fea (patch) | |
| tree | 74b95b4cd00a5f7674862902526a72f34abcc258 | |
| parent | 35e98d66a2b2f3cff2a9a9b9905cba270b6c6cc3 (diff) | |
Made tag names in TagDefinitions clickable
| -rw-r--r-- | Pages/Component/MediaTagTable.razor | 2 | ||||
| -rw-r--r-- | Pages/Component/MediaTagTable.razor.css | 8 | ||||
| -rw-r--r-- | Pages/TagDefinitions.razor | 37 | ||||
| -rw-r--r-- | Todo.md | 4 | ||||
| -rw-r--r-- | wwwroot/styles/data-table.css | 2 | ||||
| -rw-r--r-- | wwwroot/styles/global.css | 13 |
6 files changed, 46 insertions, 20 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)) @@ -4,16 +4,16 @@ - Tag selection dialog has no max height - Setting implicit tags removes builtin tags - UserService listeners don't seem to be removed after disposal + - Cancelling tag creation creates the tag anyway # Short-term Features - - Store original filesize as part of uploaded files - Progressive page loading - Proper thumbnail generation - Video support - User/security support # Long-term Features - - Search engine includes implicit tags + - Enlarge image view in ViewMedia - Periodic thumbnail scrubbing - Loading animations - Keyboard shortcuts diff --git a/wwwroot/styles/data-table.css b/wwwroot/styles/data-table.css index 6256fc7..994d625 100644 --- a/wwwroot/styles/data-table.css +++ b/wwwroot/styles/data-table.css @@ -13,7 +13,7 @@ table.data-table > tr > td { } table.data-table > tr:nth-child(2n) { - background: rgba(255, 255, 255, 0.2); + background: rgba(255, 255, 255, 0.1); } table.data-table > tr > td:not(:last-child) { diff --git a/wwwroot/styles/global.css b/wwwroot/styles/global.css index de0a0ac..c0dbe3f 100644 --- a/wwwroot/styles/global.css +++ b/wwwroot/styles/global.css @@ -46,6 +46,19 @@ a:hover { filter: brightness(1.5); } +a::selection { + background: var(--col-accent-pri); + color: #fff; +} + +a.nondecorated { + color: #fff; +} + +a.nondecorated:hover { + color: #999; +} + button, input[type=submit] { color: white; background: var(--col-button-pri); |
