Files
danbooru/app/views/comments/partials/show/_comment.html.erb
2013-01-22 15:28:12 -05:00

28 lines
1.3 KiB
Plaintext

<article class="comment" data-post-id="<%= comment.post_id %>" data-comment-id="<%= comment.id %>" data-score="<%= comment.score %>">
<div class="author">
<h1><%= link_to comment.creator_name, user_path(comment.creator_id) %></h1>
<p>
<%= time_ago_in_words_tagged(comment.created_at) %> ago
</p>
</div>
<div class="content">
<div class="body prose">
<%= format_text(comment.body) %>
</div>
<menu>
<li><%= link_to "Reply", new_comment_path(:post_id => comment.post_id), :class => "reply-link", "data-comment-id" => comment.id %></li>
<% if comment.editable_by?(CurrentUser.user) %>
<li><%= link_to "Delete", comment_path(comment.id), :confirm => "Do you really want to delete this comment?", :method => :delete, :remote => true %></li>
<li><%= link_to "Edit", edit_comment_path(comment.id) %></li>
<% end %>
<li><%= link_to "Vote up", comment_votes_path(:comment_id => comment.id, :score => "up"), :method => :post, :remote => true %></li>
<li><%= link_to "Vote down", comment_votes_path(:comment_id => comment.id, :score => "down"), :method => :post, :remote => true %></li>
<% if @comment %>
<li><%= link_to "View post", post_path(post) %></li>
<% end %>
</menu>
</div>
<div class="clearfix"></div>
</article>