From 7d1a4f726edbbfc42dbb6df6f4637840f963bdd9 Mon Sep 17 00:00:00 2001 From: Daniel Nitsikopoulos Date: Sat, 6 Apr 2024 08:38:17 +1100 Subject: [PATCH] Small UI changes --- slices/admin/templates/posts/show.html.slim | 11 ++++++----- slices/main/templates/shared/_reactions.html.slim | 12 ++++++++++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/slices/admin/templates/posts/show.html.slim b/slices/admin/templates/posts/show.html.slim index d2e7886..9c6450d 100644 --- a/slices/admin/templates/posts/show.html.slim +++ b/slices/admin/templates/posts/show.html.slim @@ -57,8 +57,9 @@ article x-data="$textHighlighter, {isOpen: false, anchorX: 0, anchorY: 0, text: button = "Delete" - div @click.outside="isOpen = false" class="p-2 bg-indigo-900 hover:bg-indigo-800 rounded text-white shadow-md shadow-indigo-500" x-show="isOpen" x-anchor.no-style="$refs.bookmarkText" :style="{ position: 'absolute', hidden: isOpen, top: isOpen ? anchorY : '0px', left: isOpen ? anchorX : '0px' }" - form method="POST" class="p-0 m-0" action="/admin/post/#{post.id}/highlight" - input type="hidden" name="post_id" value="#{post.id}" - input class="text-gray-600" type="hidden" x-model="text" name="text" - button = "Save highlight" + - if post.post_type == "bookmark" + div @click.outside="isOpen = false" class="p-2 bg-indigo-900 hover:bg-indigo-800 rounded text-white shadow-md shadow-indigo-500" x-show="isOpen" x-anchor.no-style="$refs.bookmarkText" :style="{ position: 'absolute', hidden: isOpen, top: isOpen ? anchorY : '0px', left: isOpen ? anchorX : '0px' }" + form method="POST" class="p-0 m-0" action="/admin/post/#{post.id}/highlight" + input type="hidden" name="post_id" value="#{post.id}" + input class="text-gray-600" type="hidden" x-model="text" name="text" + button = "Save highlight" diff --git a/slices/main/templates/shared/_reactions.html.slim b/slices/main/templates/shared/_reactions.html.slim index c43d590..438f167 100644 --- a/slices/main/templates/shared/_reactions.html.slim +++ b/slices/main/templates/shared/_reactions.html.slim @@ -1,3 +1,11 @@ -button hx-post="/posts/#{post.slug}/react" hx-trigger="click" class="px-2 py-1 border rounded border-blue-100 dark:border-indigo-900 hover:border-blue-200 hover:bg-blue-100 hover:dark:bg-indigo-900 hover:dark:border-indigo-400 text-gray-400 dark:text-indigo-200 mr-2 hover:scale-110 transition-all" 👍 #{post.reactions.count} +button hx-post="/posts/#{post.slug}/react" hx-trigger="click" class="group no-underline px-2 py-1 border rounded border-blue-100 hover:text-indigo-600 dark:border-indigo-900 hover:border-blue-200 hover:bg-blue-100 hover:dark:bg-indigo-900 hover:dark:border-indigo-400 text-gray-400 dark:text-indigo-200 mr-2 hover:scale-110 transition-all mr-2" + span class="inline-block group-hover:-rotate-12 transition-all" + = "👍 " + span + = " #{post.reactions.count}" - if post.webmentions && post.webmentions.count == 0 && post.commentable - a class="no-underline px-2 py-1 border rounded border-indigo-900 hover:border-indigo-400 text-indigo-200 mr-2" href="mailto:blog@dnitza.com?subject=About that post of yours&body=%0A%0A---%0A(In reply to #{post.permalink})" ✉️ Reply + a class="group no-underline px-2 py-1 border rounded border-blue-100 hover:text-indigo-600 dark:border-indigo-900 hover:border-blue-200 hover:bg-blue-100 hover:dark:bg-indigo-900 hover:dark:border-indigo-400 text-gray-400 dark:text-indigo-200 mr-2 hover:scale-110 transition-all mr-2" href="mailto:blog@dnitza.com?subject=About that post of yours&body=%0A%0A---%0A(In reply to #{post.permalink})" + span class="inline-block group-hover:-rotate-12 transition-all" + = "💌 " + span + = " Reply "