<%# Views that use this partial must supply the following variables: thread user page per_page show_all %> <% can_subscribe = thread.can_subscribe?(user) can_edit = thread.can_be_edited_by?(user) %>
<% 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_url(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_url([close_string, 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, per_page: per_page } %> <% end %>
<% comments = thread.paginated_comments(page, per_page, show_all) %> <%= render partial: 'commontator/comments/list', locals: { comments: comments, user: user, per_page: per_page } %>
<% if thread.will_paginate? %> <% end %> <% if thread.config.comment_order != :l %> <%= render partial: 'commontator/threads/reply', locals: { thread: thread, user: user, per_page: per_page } %> <% end %>