<% # Views that use this partial must supply the following variables: # user # thread # page # show_all can_subscribe = thread.can_subscribe?(user) can_edit = thread.can_be_edited_by?(user) comments = thread.paginated_comments(page, nil, show_all) nested_comments = thread.nested_comments_for(user, comments, show_all) %>
<%= link_to t('commontator.thread.actions.show'), '#', id: "commontator-thread-#{thread.id}-show-link" %>
<%= link_to t('commontator.thread.actions.hide'), '#', id: "commontator-thread-#{thread.id}-hide-link" %> <% if can_subscribe %> <%= render partial: 'commontator/subscriptions/link', locals: { thread: thread, user: user } %> <% end %> <% if can_edit %> <% if show_all filter_class = filter_string = 'filter' else filter_string = 'show_all' filter_class = 'show-all' end is_closed = thread.is_closed? close_string = is_closed ? 'reopen' : 'close' %> <% if thread.is_filtered? %> <%= link_to t("commontator.thread.actions.#{filter_string}"), commontator.thread_path(thread, show_all: (show_all ? nil : true)), id: "commontator-thread-#{thread.id}-#{filter_class}-link", class: filter_class, remote: true %> <% end %> <%= link_to t("commontator.thread.actions.#{close_string}"), commontator.polymorphic_path([close_string.to_sym, thread]), data: is_closed ? {} : { confirm: t('commontator.thread.actions.confirm_close') }, method: :put, id: "commontator-thread-#{thread.id}-#{close_string}-link", class: close_string, remote: true %> <% end %> <%= t "commontator.thread.status.#{thread.is_closed? ? 'closed' : 'open'}", closer_name: (thread.is_closed? ? Commontator.commontator_name(thread.closer) : '') %>
<% if thread.config.comment_order == :l %> <%= render partial: 'commontator/threads/reply', locals: { thread: thread, user: user } %> <% end %>
<%= render partial: 'commontator/comments/list', locals: { user: user, nested_comments: nested_comments } %>
<% if thread.config.comment_order != :l %> <%= render partial: 'commontator/threads/reply', locals: { thread: thread, user: user } %> <% end %>