disables voting on comments for not allowed users

This commit is contained in:
Juanjo Bazán
2015-09-02 12:23:56 +02:00
parent 8915ce7ffd
commit 5c10435064

View File

@@ -3,17 +3,25 @@
</span> </span>
&nbsp;|&nbsp; &nbsp;|&nbsp;
<span class="in_favor"> <span class="in_favor">
<%= link_to vote_comment_path(comment, value: 'yes'), <% if can?(:vote, comment) %>
method: "post", remote: true do %> <%= link_to vote_comment_path(comment, value: 'yes'),
<i class="icon-angle-up"></i> method: "post", remote: true do %>
<i class="icon-angle-up"></i>
<% end %>
<% else %>
<i class="icon-angle-up"></i>
<% end %> <% end %>
<%= comment.total_likes %> <%= comment.total_likes %>
</span> </span>
<span class="against"> <span class="against">
<%= link_to vote_comment_path(comment, value: 'no'), <% if can?(:vote, comment) %>
method: "post", remote: true do %> <%= link_to vote_comment_path(comment, value: 'no'),
<i class="icon-angle-down"></i> method: "post", remote: true do %>
<i class="icon-angle-down"></i>
<% end %>
<% else %>
<i class="icon-angle-down"></i>
<% end %> <% end %>
<%= comment.total_dislikes %> <%= comment.total_dislikes %>
</span> </span>