This repository has been archived on 2020-05-27. You can view files and clone it, but cannot push or open issues/pull-requests.
tuxbliki/app/views/pages/_comments.html.erb

19 lines
945 B
Plaintext

<% if !@page.comments.empty? -%>
<h3>Comments</h3>
<ol id="comments" class="comments">
<% @page.comments.each_with_index do |comment, position| -%>
<li class="comment" id="comment-<%= comment.id %>">
<span style="float: right"><% if allowed_to?(:delete_comment, comment) -%><a href="<%= url(:delete_comment, comment) -%>" onclick="if(!confirm('Are you sure you want to delete this comment?')){return false;}" rel="nofollow"><img src="/images/edit-delete.png" /></a><% end -%></span>
<div class="author">
<cite><%= position + 1 -%>. <%= (comment.url.blank?) ? h(comment.name) : "<a href='#{comment.url}'>#{h(comment.name)}</a>" %></cite>
<abbr title="<%= comment.created_at %>">said <%= time_lost_in_words comment.page.created_at, comment.created_at %> later:</abbr>
</div>
<div class="content">
<%= h(comment.comment) %>
</div>
</li>
<% end -%>
</ol>
<br />
<% end -%>