% # Clients of this partial must supply the following variables: # thread # user %> <% can_subscribe = thread.can_subscribe?(user) %> <% can_edit = thread.can_be_edited_by?(user) %> <%= thread.config.comment_name.capitalize.pluralize + (thread.is_closed? ? ' (closed)' : '') %> <% if can_subscribe %> <%= render :partial => 'commontator/subscriptions/link', :locals => {:thread => thread, :user => user} %> <% end %> <% if can_edit %> <% is_closed = thread.is_closed? %> <% close_string = is_closed ? "reopen" : "close" %> <%= link_to close_string.capitalize, commontator.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" %> <% end %>
<%= thread.config.comment_name.capitalize.pluralize %> cannot be <%= thread.config.comment_create_verb_past %> at this time.
<% else %> <%= link_to thread.config.comment_create_verb_present.capitalize + ' ' + thread.config.comment_name, commontator.new_thread_comment_path(thread), :remote => true %> <% end %>