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 %>
<%= sanitize(t("votes.comment_unauthenticated", signin: link_to_signin, signup: link_to_signup)) %>
diff --git a/spec/support/common_actions/votes.rb b/spec/support/common_actions/votes.rb
index 37a9eb485..378f7dc67 100644
--- a/spec/support/common_actions/votes.rb
+++ b/spec/support/common_actions/votes.rb
@@ -8,8 +8,6 @@ module Votes
within(".participation-not-allowed") do
expect(page).to have_content "You must sign in or sign up to vote"
end
-
- expect(page).not_to have_selector(".participation-allowed")
end
def expect_message_to_many_anonymous_votes