Files
fetsite/app/views/comments/_comments_block.html.erb
2015-08-10 18:03:03 +02:00

16 lines
1.0 KiB
Plaintext

<%= link_to "Comments:.."+ comments_block.comments.count().to_s, comments_path(commentable_type: comments_block.class.to_s.gsub("::","_"), commentable_id: comments_block.id), remote:true, id: Comment.switchshowid_for( comments_block) %> <%# load the comments in the comments block %>
<%= link_to content_tag(:span, content_tag(:i,"",class:"fa fa-comment-o fa-stack-2x")+ content_tag(:i,"",class:"fa fa-plus-square-o fa-stack-1x"),class:"fa-stack")+ "Comment" , new_comment_path( commentable_type: comments_block.class.to_s.gsub("::","_"), commentable_id: comments_block.id), remote:true if can? :comment, comments_block %> <%# This is the button to add a new comment %>
<div id="<%= divid_for(comments_block,"newform") %>">
</div>
<div id="<%= Comment.wrapid_for( comments_block)%>">
<% unless comments_block.comments.roots.empty? %>
<%= render partial:"comments/comments", object: comments_block.comments.order(:created_at).roots.reverse_order if params[:show_comments] %><%# can? fehlt!%>
<% end %>
</div>