From 23bc0134d69bbdd7553e5ca0239e1850b16eef27 Mon Sep 17 00:00:00 2001 From: Daniel Nitsikopoulos Date: Sun, 31 Mar 2024 09:24:25 +1100 Subject: [PATCH] Clean up reactions --- slices/main/actions/posts/react.rb | 3 +++ slices/main/templates/shared/_reactions.html.slim | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/slices/main/actions/posts/react.rb b/slices/main/actions/posts/react.rb index 8944dd7..48e4e26 100644 --- a/slices/main/actions/posts/react.rb +++ b/slices/main/actions/posts/react.rb @@ -16,6 +16,9 @@ module Main res.body = "👍 #{reaction_count}" res.status = 201 + + rescue + res.status = 400 end end end diff --git a/slices/main/templates/shared/_reactions.html.slim b/slices/main/templates/shared/_reactions.html.slim index e10fa62..c43d590 100644 --- a/slices/main/templates/shared/_reactions.html.slim +++ b/slices/main/templates/shared/_reactions.html.slim @@ -1,3 +1,3 @@ -button hx-post="/posts/#{post.slug}/react" hx-trigger="click" class="px-2 py-1 border rounded border-indigo-900 hover:border-indigo-400 text-indigo-200 mr-2" 👍 #{post.reactions.count} +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} - 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