<% edition_mode = (defined? edition_mode) ? edition_mode : false %>
<% focus_on = logged_in? ? 'title' : 'name' %> <% if !edition_mode && !pass_without_comment_captcha? %> <% end %> <% @comment ||= Comment.new %> <% if @comment.errors.any? %> <%= error_messages_for :comment %> <% end %>
<%= link_to(_('Post a comment'), '#', :class => 'display-comment-form') if display_link && @comment.reply_of_id.blank? %> <%= remote_form_for(@comment, :url => {:profile => profile.identifier, :controller => 'comment', :action => (edition_mode ? 'update' : 'create'), :id => (edition_mode ? @comment.id : @page.id)}, :html => { :class => 'comment_form' } ) do |f| %> <%= required_fields_message %> <% unless logged_in? %> <%= required labelled_form_field(_('Name'), f.text_field(:name)) %> <%= required labelled_form_field(_('e-mail'), f.text_field(:email)) %>

<%= _('If you are a registered user, you can login and be automatically recognized.') %>

<% end %> <% if !edition_mode && !pass_without_comment_captcha? %> <%= hidden_field_tag(:recaptcha_response_field, nil, :id => nil) %> <%= hidden_field_tag(:recaptcha_challenge_field, nil, :id => nil) %> <% end %> <%= labelled_form_field(_('Title'), f.text_field(:title)) %> <%= required labelled_form_field(_('Enter your comment'), f.text_area(:body, :rows => 5)) %> <%= hidden_field_tag(:confirm, 'false') %> <%= hidden_field_tag(:view, params[:view])%> <%= f.hidden_field(:reply_of_id) %> <%= @plugins.dispatch(:comment_form_extra_contents, local_assigns.merge(:comment => @comment)).collect { |content| instance_exec(&content) }.join("") %> <% button_bar do %> <%= submit_button('add', _('Post comment'), :onclick => "if(check_captcha(this)) { save_comment(this) } else { check_captcha(this, save_comment)};return false;") %> <% if !edition_mode %> <%= button :cancel, _('Cancel'), '', :id => 'cancel-comment' %> <% else %> <%= button :cancel, _('Cancel'), '#', :onclick => "noosfero.modal.close();" %> <% end %> <% end %> <% end %>
<%= javascript_include_tag 'comment_form'%>