<%= 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 %>
<% if can_subscribe %>
<%= 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? %>
<%= page_entries_info comments,
params: { controller: 'commontator/threads',
action: 'show',
id: thread.id,
page: page,
per_page: per_page } %>.
<%= will_paginate comments,
renderer: Commontator::LinkRenderer,
routes_proxy: commontator,
remote: true,
params: { controller: 'commontator/threads',
action: 'show',
id: thread.id,
page: page,
per_page: per_page } %>