% # Clients of this partial must supply the following variables:
# thread
# user
# page
# per_page
# Optionally, they can also supply the following variable:
show_all ||= false
%>
<% can_subscribe = thread.can_subscribe?(user)
can_edit = thread.can_be_edited_by?(user) %>
<%= link_to t('commontator.thread.actions.show'),
'#',
id: "thread_#{thread.id.to_s}_show_link",
class: "thread_show_link" %>
<%= link_to t('commontator.thread.actions.hide'),
'#',
id: "thread_#{thread.id.to_s}_hide_link",
class: "thread_hide_link" %>
<% if can_subscribe %>
<%= render :partial => 'commontator/subscriptions/link',
:locals => { :thread => thread,
:user => user } %>
<% end %>
<% if can_edit %>
<% filter_string = show_all ? 'filter' : 'show_all'
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 => "thread_#{thread.id.to_s}_#{filter_string}_link",
:class => "thread_#{filter_string}_link",
:remote => true %>
<% end %>
<%= link_to t("commontator.thread.actions.#{close_string}"),
commontator.polymorphic_path([close_string, thread]),
:confirm => (!is_closed ? t('commontator.thread.actions.confirm_close') : nil),
:method => :put,
:id => "thread_#{thread.id.to_s}_#{close_string}_link",
:class => "thread_#{close_string}_link",
:remote => true %>
<% end %>
<% if thread.config.comment_order == :l %>
<%= render :partial => 'commontator/threads/reply',
:locals => { :thread => thread, :user => user, :per_page => per_page } %>
<% end %>
<% if thread.will_paginate? && !show_all %>
<% end %>
<% if thread.config.comment_order != :l %>
<%= render :partial => 'commontator/threads/reply',
:locals => { :thread => thread, :user => user, :per_page => per_page } %>
<% end %>