Improved Manage Category page

This commit is contained in:
Mia Rose Winter 2024-03-27 10:25:19 +01:00
parent bd0d69cdc3
commit a056039654
Signed by: miawinter
GPG key ID: 4B6F6A83178F595E
3 changed files with 28 additions and 8 deletions

View file

@ -56,26 +56,28 @@ bg-error text-error-content
-->
<div class="overflow-x-auto">
<table class="table">
<tr class="border-b-2 border-current">
<table class="table table-zebra">
<thead>
<tr>
<th>@Localizer["Name"]</th>
<th>@Localizer["Type"]</th>
<th></th>
</tr>
</thead>
@foreach (var category in Categories) {
string postfix = CategoryUtilities.GetCssClassPostfixForColor(category.Color);
<tr class="border-b-2">
<tr>
<td>@category.Name</td>
<td>
<span class="badge badge-@postfix">@category.Color.Humanize()</span>
<span class="badge badge-@postfix">@Localizer[$"Category_Color_{category.Color}"]</span>
</td>
<td>
<form method="post" @formname="@category.Id.ToString()" @onsubmit="@DeleteCategory">
<AntiforgeryToken/>
<input type="hidden" name="category-id" value="@category.Id" required />
<button type="submit" class="btn btn-sm btn-square btn-error" title="delete">
<button type="submit" class="btn btn-sm btn-square btn-error" title="@Localizer["Delete_Label"]">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="w-5 h-5">
<path fill-rule="evenodd" d="M8.75 1A2.75 2.75 0 0 0 6 3.75v.443c-.795.077-1.584.176-2.365.298a.75.75 0 1 0 .23 1.482l.149-.022.841 10.518A2.75 2.75 0 0 0 7.596 19h4.807a2.75 2.75 0 0 0 2.742-2.53l.841-10.52.149.023a.75.75 0 0 0 .23-1.482A41.03 41.03 0 0 0 14 4.193V3.75A2.75 2.75 0 0 0 11.25 1h-2.5ZM10 4c.84 0 1.673.025 2.5.075V3.75c0-.69-.56-1.25-1.25-1.25h-2.5c-.69 0-1.25.56-1.25 1.25v.325C8.327 4.025 9.16 4 10 4ZM8.58 7.72a.75.75 0 0 0-1.5.06l.3 7.5a.75.75 0 1 0 1.5-.06l-.3-7.5Zm4.34.06a.75.75 0 1 0-1.5-.06l-.3 7.5a.75.75 0 1 0 1.5.06l.3-7.5Z" clip-rule="evenodd"/>
</svg>

View file

@ -143,4 +143,13 @@
<data name="Category_Delete_Error" xml:space="preserve">
<value>Konnte Kategorie nicht löschen, wird sie noch verwendet?</value>
</data>
<data name="Delete_Label" xml:space="preserve">
<value>Kategorie löschen</value>
</data>
<data name="Name" xml:space="preserve">
<value>Bezeichnung der Kategorie</value>
</data>
<data name="Type" xml:space="preserve">
<value>Art der Kategorie</value>
</data>
</root>

View file

@ -143,4 +143,13 @@
<data name="Category_Delete_Error" xml:space="preserve">
<value>Could not delete Category, is it still used?</value>
</data>
<data name="Delete_Label" xml:space="preserve">
<value>Delete category</value>
</data>
<data name="Name" xml:space="preserve">
<value>Name of Category</value>
</data>
<data name="Type" xml:space="preserve">
<value>Type of Category</value>
</data>
</root>