_comment.html.erb
2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<li id="<%= comment.anchor %>" class="article-comment">
<div class="article-comment-inner">
<div class="comment-content comment-logged-<%= comment.author ? 'in' : 'out' %> <%= 'comment-from-owner' if ( comment.author && (profile == comment.author) ) %>">
<% if comment.author %>
<%= link_to image_tag(profile_icon(comment.author, :minor)) +
content_tag('span', comment.author_name, :class => 'comment-info'),
comment.author.url,
:class => 'comment-picture',
:title => comment.author_name
%>
<% else %>
<% url_image, status_class = comment.author_id ?
[comment.removed_user_image, 'icon-user-removed'] :
[gravatar_profile_image_url( comment.email, :size => 50, :d=>404 ), 'icon-user-unknown'] %>
<%= link_to(
image_tag(url_image, :onerror=>'gravatarCommentFailback(this)',
'data-gravatar'=>gravatar_profile_image_url(comment.email, :size=>50)) +
content_tag('span', comment.author_name, :class => 'comment-info') +
content_tag('span', comment.message,
:class => 'comment-user-status ' + status_class),
gravatar_profile_url(comment.email),
:target => '_blank',
:class => 'comment-picture',
:title => '%s %s' % [comment.author_name, comment.message]
)%>
<% end %>
<% comment_balloon do %>
<div class="comment-details">
<div class="comment-header">
<%= comment_actions(comment) %>
</div>
<div class="comment-created-at">
<%= show_time(comment.created_at) %>
</div>
<h4><%= comment.title.blank? && ' ' || comment.title %></h4>
<div class="comment-text">
<p/>
<%= txt2html comment.body %>
</div>
<%= safe_join(@plugins.dispatch(:comment_extra_contents, local_assigns).collect { |content| instance_exec(&content) }, "") %>
</div>
<div class="comment_reply post_comment_box closed" id="comment_reply_to_<%= comment.id %>">
<% if @comment && @comment.errors.any? && @comment.reply_of_id.to_i == comment.id %>
<%= error_messages_for :comment %>
<script type="text/javascript">
jQuery(function() {
document.location.href = '#<%= comment.anchor %>';
add_comment_reply_form('#comment-reply-to-<%= comment.id %>', <%= comment.id %>);
});
</script>
<% end %>
</div>
<% end %>
</div>
<% unless comment.replies.blank? || comment.spam? %>
<ul class="comment-replies">
<% comment.replies.each do |reply| %>
<%= render :partial => 'comment/comment', :locals => { :comment => reply } %>
<% end %>
</ul>
<% end %>
</div>
</li>