summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Pages/Component/MediaTagTable.razor2
-rw-r--r--Pages/Component/MediaTagTable.razor.css8
-rw-r--r--Pages/TagDefinitions.razor37
-rw-r--r--wwwroot/styles/data-table.css2
-rw-r--r--wwwroot/styles/global.css13
5 files changed, 44 insertions, 18 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))
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);