show link to sign in for no connect users
This commit is contained in:
@@ -1,27 +1,65 @@
|
||||
<span>
|
||||
<%= t('comments.comment.votes', count: comment.total_votes) %>
|
||||
</span>
|
||||
|
|
||||
<span class="in_favor">
|
||||
<% if can?(:vote, comment) %>
|
||||
<%= link_to vote_comment_path(comment, value: 'yes'),
|
||||
method: "post", remote: true do %>
|
||||
<i class="icon-angle-up"></i>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<i class="icon-angle-up"></i>
|
||||
<% end %>
|
||||
<%= comment.total_likes %>
|
||||
</span>
|
||||
<div class="votes">
|
||||
<% if user_signed_in? %>
|
||||
<%= t('comments.comment.votes', count: comment.total_votes) %>
|
||||
|
|
||||
|
||||
<span class="against">
|
||||
<% if can?(:vote, comment) %>
|
||||
<%= link_to vote_comment_path(comment, value: 'no'),
|
||||
method: "post", remote: true do %>
|
||||
<span class="in_favor">
|
||||
<% if can?(:vote, comment) %>
|
||||
<%= link_to vote_comment_path(comment, value: 'yes'),
|
||||
method: "post", remote: true do %>
|
||||
<i class="icon-angle-up"></i>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<i class="icon-angle-up"></i>
|
||||
<% end %>
|
||||
<%= comment.total_likes %>
|
||||
</span>
|
||||
|
||||
<span class="against">
|
||||
<% if can?(:vote, comment) %>
|
||||
<%= link_to vote_comment_path(comment, value: 'no'),
|
||||
method: "post", remote: true do %>
|
||||
<i class="icon-angle-down"></i>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<i class="icon-angle-down"></i>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<i class="icon-angle-down"></i>
|
||||
<% end %>
|
||||
<%= comment.total_dislikes %>
|
||||
</span>
|
||||
|
||||
<% elsif !user_signed_in? %>
|
||||
|
||||
<div class="logged" >
|
||||
<%= t('comments.comment.votes', count: comment.total_votes) %>
|
||||
|
|
||||
|
||||
<span class="in_favor">
|
||||
<% if can?(:vote, comment) %>
|
||||
<%= link_to vote_comment_path(comment, value: 'yes'),
|
||||
method: "post", remote: true do %>
|
||||
<i class="icon-angle-up"></i>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<i class="icon-angle-up"></i>
|
||||
<% end %>
|
||||
<%= comment.total_likes %>
|
||||
</span>
|
||||
<span class="against">
|
||||
<% if can?(:vote, comment) %>
|
||||
<%= link_to vote_comment_path(comment, value: 'no'),
|
||||
method: "post", remote: true do %>
|
||||
<i class="icon-angle-down"></i>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<i class="icon-angle-down"></i>
|
||||
<% end %>
|
||||
<%= comment.total_dislikes %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="not-logged" style='display:none'>
|
||||
<%= 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 %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= comment.total_dislikes %>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user