Fix admin tag pages

This commit is contained in:
2023-09-24 10:06:14 +10:00
parent 4317455ea4
commit 8b280afc75
3 changed files with 10 additions and 10 deletions

View File

@@ -28,12 +28,12 @@ html
a href="/" rel="me" class="u-url u-uid"
h1 class="p-name uppercase text-sm md:text-sm text-gray-400 dark:text-gray-400" = Hanami.app.settings.site_name
nav class="space-x-1 text-sm md:text-sm uppercase md:block"
a class="p-1 rounded text-gray-400 hover:bg-red-100 hover:text-red-400 dark:hover:bg-red-200 #{link_active?('about') ? 'text-red-600 dark:text-red-400' : ''}" href="/admin" Admin
a class="p-1 rounded text-gray-400 hover:bg-red-100 hover:text-red-400 dark:hover:bg-red-200 #{context.current_path == '/admin' ? 'text-red-600 dark:text-red-400' : ''}" href="/admin" Admin
span class="text-gray-400 dark:text-gray-600"
= "/"
a class="p-1 rounded text-gray-400 hover:bg-red-100 hover:text-red-400 dark:hover:bg-red-200 #{link_active?('about') ? 'text-red-600 dark:text-red-400' : ''}" href="/admin/tags" Tags
a class="p-1 rounded text-gray-400 hover:bg-red-100 hover:text-red-400 dark:hover:bg-red-200 #{context.current_path.include?('/admin/tags') ? 'text-red-600 dark:text-red-400' : ''}" href="/admin/tags" Tags
span class="text-gray-400 dark:text-gray-600"
= "/"
a class="p-1 rounded text-gray-400 hover:bg-red-100 hover:text-red-400 dark:hover:bg-red-200 #{link_active?('about') ? 'text-red-600 dark:text-red-400' : ''}" href="/admin/bookmarks" Bookmarks
a class="p-1 rounded text-gray-400 hover:bg-red-100 hover:text-red-400 dark:hover:bg-red-200 #{context.current_path.include?('/bookmarks') ? 'text-red-600 dark:text-red-400' : ''}" href="/admin/bookmarks" Bookmarks
== yield

View File

@@ -1,4 +1,4 @@
li id="tag-#{tag.id}" class="text-gray-800 dark:text-gray-200"
= "#{tag.label} (#{tag.posts.count})"
li id="tag-#{post_tag.id}" class="text-gray-800 dark:text-gray-200"
= "#{post_tag.label} (#{post_tag.posts.count})"
= " — "
button hx-delete="/admin/tags/#{tag.id}" hx-target="#tag-#{tag.id}" delete
button hx-delete="/admin/tags/#{post_tag.id}" hx-target="#tag-#{post_tag.id}" delete

View File

@@ -3,13 +3,13 @@ div class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:
div class="max-w-prose mx-auto"
ul
- unused_tags.each do |tag|
== render "shared/tag", tag: tag
- unused_tags.each do |post_tag|
== render "shared/tag", post_tag: post_tag
- if !unused_tags.empty?
li class="py-2"
hr
- used_tags.each do |tag|
== render "shared/tag", tag: tag
- used_tags.each do |post_tag|
== render "shared/tag", post_tag: post_tag
div class="max-w-screen-md mx-auto border-t-4 border-solid border-gray-400 dark:border-gray-600"