2023-10-31 15:32:36 -07:00
|
|
|
- if type == "Answer"
|
|
|
|
= button_to destroy_reactions_path(id: target.id, username: target.user.screen_name),
|
|
|
|
method: :delete,
|
2023-12-20 14:53:22 -08:00
|
|
|
form: { class: "d-inline-block",
|
|
|
|
id: "reaction-#{type}-#{target.id}",
|
|
|
|
data: { controller: :reaction, action: "turbo:submit-start->reaction#disable turbo:submit-end->reaction#enable" } },
|
|
|
|
class: "btn btn-link answerbox__action unsmile",
|
|
|
|
data: { reaction_target: :button } do
|
2024-03-02 12:29:47 -08:00
|
|
|
%i.fa.fa-smile-o
|
2023-10-31 15:32:36 -07:00
|
|
|
%span= target.smile_count
|
|
|
|
|
|
|
|
- if type == "Comment"
|
|
|
|
= button_to destroy_comment_reactions_path(id: target.id, username: target.user.screen_name),
|
|
|
|
method: :delete,
|
2023-12-20 14:53:22 -08:00
|
|
|
form: { class: "d-inline-block",
|
|
|
|
id: "reaction-#{type}-#{target.id}",
|
|
|
|
data: { controller: :reaction, action: "turbo:submit-start->reaction#disable turbo:submit-end->reaction#enable" } },
|
|
|
|
class: "btn btn-link answerbox__action unsmile",
|
|
|
|
data: { reaction_target: :button } do
|
2024-03-02 12:29:47 -08:00
|
|
|
%i.fa.fa-smile-o
|
2023-10-31 15:32:36 -07:00
|
|
|
%span= target.smile_count
|