cirandas.net

ref: master

app/views/profile/_comment.html.erb


<% Comment %>
<% Profile %>
<% Person %>

  • <% if comment.author %> <%= link_to image_tag(profile_icon(comment.author, :minor)), 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 ), 'icon-user-unknown'] %> <%= link_to( image_tag(url_image, :onerror=>'gravatarCommentFailback(this)', 'data-gravatar'=>gravatar_profile_image_url(comment.email)) + content_tag('span', comment.author_name, :class => 'comment-info') + content_tag('span', comment.message, :class => 'comment-user-status comment-user-status-wall ' + status_class), gravatar_profile_url(comment.email), :target => '_blank', :class => 'comment-picture', :title => '%s %s' % [comment.author_name, comment.message] )%> <% end %>
    <%= comment.author.present? ? link_to(comment.author_name, comment.author.url) : content_tag('strong', comment.author_name) %> <% unless comment.title.blank? %> <%= comment.title %>
    <% end %> <%= txt2html comment.body %>
    <%= time_ago_in_words(comment.created_at) %>
    <% if logged_in? && (user == profile || user == comment.author || user.has_permission?(:moderate_comments, profile)) %> <%= button_bar(:style => 'float: right; margin-top: 0px;') do %> <%= link_to_function(_('Remove'), 'remove_item_wall(this, \'%s\', \'%s\', \'%s\'); return false ;' % [".article-comment", url_for(:profile => params[:profile], :action => :remove_comment, :comment_id => comment.id, :view => params[:view]), _('Are you sure you want to remove this comment and all its replies?')], :class => 'button icon-button icon-delete') %> <% end %> <% end %>
    <% if @comment && @comment.errors.any? && @comment.reply_of_id.to_i == comment.id %> <%= error_messages_for :comment %> <% end %> <%= report_abuse(comment.author, :comment_link, comment) if comment.author %> <% if comment.author && comment.author == user %> <%= expirable_comment_link comment, :edit, _('Edit'), {:action => 'edit_comment', :id => comment.id, :profile => profile.identifier} %> <%= content_tag('span', ' | ', :class => 'comment-footer comment-footer-hide') %> <% end %> <%= link_to_function _('Reply'), "var f = add_comment_reply_form(this, %s); f.find('input[name=comment[title]], textarea').val(''); return false" % comment.id, :class => 'comment-footer comment-footer-link comment-footer-hide', :id => 'comment-reply-to-' + comment.id.to_s %>
    <% unless comment.replies.blank? %>
      <% comment.replies.each do |reply| %> <%= render :partial => 'comment', :locals => { :comment => reply } %> <% end %>
    <% end %>