<% # Controllers that use this partial must supply the following variables: # user # comment # nested_children or page # show_all thread = comment.thread nested_children ||= begin children = thread.paginated_comments(page, comment.id, show_all) thread.nested_comments_for(user, children, show_all) end creator = comment.creator link = Commontator.commontator_link(creator, main_app) name = Commontator.commontator_name(creator) || '' %>
<%= link.blank? ? name : link_to(name, link) %> <%= link_to( t('commontator.comment.actions.edit'), commontator.edit_comment_path(comment), id: "commontator-comment-#{comment.id}-edit", class: 'edit', remote: true ) if comment.can_be_edited_by?(user) %> <% if comment.can_be_deleted_by?(user) %> <% is_deleted = comment.is_deleted? %> <% del_string = is_deleted ? 'undelete' : 'delete' %> <%= link_to t("commontator.comment.actions.#{del_string}"), commontator.polymorphic_path([del_string, comment]), data: is_deleted ? {} : { confirm: t('commontator.comment.actions.confirm_delete') }, method: :put, id: "commontator-comment-#{comment.id}-#{del_string}", class: del_string, remote: true %> <% end %>
<%= Commontator.commontator_avatar(creator, self) %> <%= render partial: 'commontator/comments/votes', locals: { comment: comment, user: user } %>
<%= render partial: 'commontator/comments/body', locals: { comment: comment } %>
<% unless comment.is_deleted? %> <%= link_to( t('commontator.comment.actions.reply'), commontator.new_thread_comment_path(thread, comment: { parent_id: comment.id }), remote: true ) if thread.config.comment_reply_style != :n && !thread.is_closed? %> <% end %> <%= comment.created_timestamp %> <%= comment.updated_timestamp if comment.is_modified? %>
<%= render partial: 'commontator/comments/list', locals: { user: user, nested_comments: nested_children } %>