<% # Clients of this partial must supply the following variables: # thread %> <% can_subscribe = thread.can_subscribe?(@commontator) %> <% can_edit = thread.can_be_edited_by?(@commontator) %> <% if can_subscribe %> <%= render :partial => 'commontator/subscriptions/link', :locals => {:thread => thread} %> <% end %>   <% if can_edit %> <% is_closed = thread.is_closed? <% close_string = is_closed ? "reopen" : "close" %> <%= link_to close_string.capitalize, polymorphic_path([close_string, thread]), :confirm => (!is_closed ? \ 'Are you sure you want to close this thread' : nil), :method => :put, :id => "thread_#{thread.id.to_s}_#{close_string}_link", :class => "thread_#{close_string}_link", :remote => true %> <% end %>