docbrown/app/views/articles/_reaction_button.html.erb

17 lines
855 B
Text

<button
id="reaction-butt-<%= category %>"
aria-label="<%= aria_label %>"
aria-pressed="false"
class="crayons-reaction crayons-reaction--<%= category %>"
data-category="<%= category %>"
title="<%= description %>">
<span class="crayons-reaction__icon crayons-reaction__icon--inactive">
<%= inline_svg_tag(image_path, aria_hidden: true, class: "crayons-icon") %>
</span>
<% if user_signed_in? # We cannot trigger the action state unless the user is signed in, so no need to render. %>
<span class="crayons-reaction__icon crayons-reaction__icon--active">
<%= inline_svg_tag(image_active_path, aria_hidden: true, class: "crayons-icon") %>
</span>
<% end %>
<span class="crayons-reaction__count" id="reaction-number-<%= category %>"><span class="bg-base-40 opacity-25 p-2 inline-block radius-default"></span></span>
</button>