docbrown/app/views/articles/_multiple_reactions.html.erb
Joshua Wehner 5188ca8138
Cleanup multiple reactions feature flag (#19257)
* Update notifications_helper

* Update notification decorator

* Removed old notifications views

* Remove flag check from _actions partial

* Remove feature flag from views

* Remove flag from model

* Update logic in reaction drawer button

* Missed this somehow

* Update app/assets/javascripts/initializers/initializeArticleReactions.js

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

* Update these tests to multiple reactions

* Adjust logged-out test to account for multiple reactions

* Removed unused

* Try to boost coverage

---------

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-04-07 17:14:10 +02:00

63 lines
2.8 KiB
Text

<div class="reaction-drawer__outer hoverdown" style="">
<button
id="reaction-drawer-trigger"
aria-label="reaction-drawer-trigger"
aria-pressed="false"
class="hoverdown-trigger crayons-reaction pseudo-reaction crayons-tooltip__activator relative">
<span class="crayons-reaction__icon crayons-reaction__icon--borderless crayons-reaction--like crayons-reaction__icon--inactive" style="width: 40px; height: 40px">
<%= crayons_icon_tag("heart-plus.svg", aria_hidden: true, height: 24, width: 24) %>
</span>
<span class="crayons-reaction__icon crayons-reaction__icon--borderless crayons-reaction__icon--active" style="width: 40px; height: 40px">
<%= image_tag "heart-plus-active.svg", aria_hidden: true, height: 24, width: 24 %>
</span>
<span class="crayons-reaction__count" id="reaction_total_count">
<span class="bg-base-40 opacity-25 p-2 inline-block radius-default"></span>
</span>
<span class="crayons-tooltip__content">
<%= t("views.reactions.drawer_button") %>
</span>
</button>
<div class="reaction-drawer" aria-expanded="false">
<div class="reaction-drawer__container">
<% ReactionCategory.for_view.each do |reaction_type| %>
<%= render partial: "articles/multireaction_button",
locals: {
category: reaction_type.slug.to_sym,
description: reaction_type.name,
image_path: "#{reaction_type.icon}.svg",
image_active_path: "#{reaction_type.icon}.svg",
aria_label: reaction_type.name
} %>
<% end %>
</div>
</div>
</div>
<button
id="reaction-butt-comment"
aria-label="<%= t("views.articles.jump_to_comments.aria_label") %>"
aria-pressed="false"
class="crayons-reaction crayons-reaction--comment crayons-tooltip__activator relative"
data-category="comment">
<span class="crayons-reaction__icon crayons-reaction__icon--borderless crayons-reaction__icon--inactive">
<%= crayons_icon_tag("comment.svg", aria_hidden: true) %>
</span>
<span class="crayons-reaction__count" id="reaction-number-comment" data-count="<%= @article.comments_count %>">
<span class="bg-base-40 opacity-25 p-2 inline-block radius-default"></span>
</span>
<span data-testid="tooltip" class="crayons-tooltip__content">
<%= t("views.articles.jump_to_comments.label") %>
</span>
</button>
<%= render partial: "articles/reaction_button",
locals: {
category: :readinglist,
description: t("views.reactions.readingList.title"),
image_path: "save.svg",
image_active_path: "save-filled.svg",
aria_label: t("views.reactions.readingList.aria_label")
} %>