<% if user_signed_in? %>
<%= t('comments.comment.votes', count: comment.total_votes) %>
|
<% if can?(:vote, comment) %>
<%= link_to vote_comment_path(comment, value: 'yes'),
method: "post", remote: true do %>
<% end %>
<% else %>
<% end %>
<%= comment.total_likes %>
<% if can?(:vote, comment) %>
<%= link_to vote_comment_path(comment, value: 'no'),
method: "post", remote: true do %>
<% end %>
<% else %>
<% end %>
<%= comment.total_dislikes %>
<% elsif !user_signed_in? %>
<%= t('comments.comment.votes', count: comment.total_votes) %>
|
<% if can?(:vote, comment) %>
<%= link_to vote_comment_path(comment, value: 'yes'),
method: "post", remote: true do %>
<% end %>
<% else %>
<% end %>
<%= comment.total_likes %>
<% if can?(:vote, comment) %>
<%= link_to vote_comment_path(comment, value: 'no'),
method: "post", remote: true do %>
<% end %>
<% else %>
<% end %>
<%= comment.total_dislikes %>
<%= t("votes.comment_unauthenticated",
signin: link_to(t("votes.signin"), new_user_session_path),
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
<% end %>