diff --git a/app/assets/javascripts/votes.js b/app/assets/javascripts/votes.js index 2e8583156..c782d428b 100644 --- a/app/assets/javascripts/votes.js +++ b/app/assets/javascripts/votes.js @@ -5,11 +5,9 @@ $(document).on({ "mouseenter focus": function() { $("div.participation-not-allowed", this).show(); - $("div.participation-allowed", this).hide(); }, mouseleave: function() { $("div.participation-not-allowed", this).hide(); - $("div.participation-allowed", this).show(); } }, votes); }, diff --git a/app/components/comments/votes_component.html.erb b/app/components/comments/votes_component.html.erb index cb428eb80..a3714a63f 100644 --- a/app/components/comments/votes_component.html.erb +++ b/app/components/comments/votes_component.html.erb @@ -1,77 +1,40 @@
- <% if current_user %> - <%= t("comments.comment.votes", count: comment.total_votes) %> -  |  + <%= t("comments.comment.votes", count: comment.total_votes) %> +  |  - - <% if can?(:vote, comment) %> - <%= link_to vote_comment_path(comment, value: "yes"), - method: "post", remote: true, title: t("votes.agree") do %> - - <%= t("votes.agree") %> - - <% end %> - <% else %> - - <%= t("votes.agree") %> - - <% end %> - <%= comment.total_likes %> - - - - <% if can?(:vote, comment) %> - <%= link_to vote_comment_path(comment, value: "no"), - method: "post", remote: true, title: t("votes.disagree") do %> - - <%= t("votes.disagree") %> - - <% end %> - <% else %> - - <%= t("votes.disagree") %> - - <% end %> - <%= comment.total_dislikes %> - - <% else %> -
- <%= t("comments.comment.votes", count: comment.total_votes) %> -  |  - - - <% if can?(:vote, comment) %> - <%= link_to vote_comment_path(comment, value: "yes"), - method: "post", remote: true, title: t("votes.agree") do %> - - <%= t("votes.agree") %> - - <% end %> - <% else %> + + <% if can?(:vote, comment) %> + <%= link_to vote_comment_path(comment, value: "yes"), + method: "post", remote: true, title: t("votes.agree") do %> <%= t("votes.agree") %> - <% end %> - <%= comment.total_likes %> + <% end %> + <% else %> + + <%= t("votes.agree") %> + <% end %> + <%= comment.total_likes %> + - - <% if can?(:vote, comment) %> - <%= link_to vote_comment_path(comment, value: "no"), - method: "post", remote: true, title: t("votes.disagree") do %> - - <%= t("votes.disagree") %> - - <% end %> - <% else %> + + <% if can?(:vote, comment) %> + <%= link_to vote_comment_path(comment, value: "no"), + method: "post", remote: true, title: t("votes.disagree") do %> <%= t("votes.disagree") %> - <% end %> - <%= comment.total_dislikes %> + <% end %> + <% else %> + + <%= t("votes.disagree") %> -
+ <% end %> + <%= comment.total_dislikes %> + + <% unless current_user %>