ref: master
app/views/comment/_comment_form.html.erb
<% edition_mode = (defined? edition_mode) ? edition_mode : false %> <% focus_on = logged_in? ? 'title' : 'name' %> <% if !edition_mode && !pass_without_comment_captcha? %> <%= _('Please type the two words below') %> <%= recaptcha_tags(:display => { :theme => 'clean' }, :ajax => true, :ssl => true) %> <% button_bar do %> <%= button_to_function :add, _('Confirm'), "return false", :id => "confirm-captcha" %> <%= button_to_function :cancel, _('Cancel'), "noosfero.modal.close()" %> <% end %> <% 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)) %> <% if logged_in? %> <%= labelled_form_field check_box(:comment, :follow_article, {}, true, false) + _('Follow this article'), '' %> <% end%> <%= hidden_field_tag(:confirm, 'false') %> <%= hidden_field_tag(:view, params[:view])%> <%= f.hidden_field(:reply_of_id) %> <%= safe_join(@plugins.dispatch(:comment_form_extra_contents, local_assigns.merge(:comment => @comment)).collect { |content| instance_exec(&content) }, "") %> <%= button_bar do %> <%= submit_button('add', _('Post comment'), onclick: "if(check_captcha(this)) { noosfero.comments.save(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 'comments' %>
<%= _('If you are a registered user, you can login and be automatically recognized.') %>
<%= _('Please type the two words below') %>
<%= recaptcha_tags(:display => { :theme => 'clean' }, :ajax => true, :ssl => true) %> <% button_bar do %> <%= button_to_function :add, _('Confirm'), "return false", :id => "confirm-captcha" %> <%= button_to_function :cancel, _('Cancel'), "noosfero.modal.close()" %> <% end %><%= _('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)) %> <% if logged_in? %> <%= labelled_form_field check_box(:comment, :follow_article, {}, true, false) + _('Follow this article'), '' %> <% end%> <%= hidden_field_tag(:confirm, 'false') %> <%= hidden_field_tag(:view, params[:view])%> <%= f.hidden_field(:reply_of_id) %> <%= safe_join(@plugins.dispatch(:comment_form_extra_contents, local_assigns.merge(:comment => @comment)).collect { |content| instance_exec(&content) }, "") %> <%= button_bar do %> <%= submit_button('add', _('Post comment'), onclick: "if(check_captcha(this)) { noosfero.comments.save(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 %>