Sha256: 990b86fddb16c9c4e4191cd6f0cfd56ba6838a4bab8221c4e9f2e33cb6cd97d7

Contents?: true

Size: 1.11 KB

Versions: 3

Compression:

Stored size: 1.11 KB

Contents

-# You must provide an url for the form
%h3#new-comment= _('Leave a comment')
= form_for new_comment, url: url do |f|
  - if new_comment.errors.any?
    .error
      %h2= format(n_('An error prevented your comment from being saved:',
                      '%<nb>i errors prevented your comment from being saved:',
                      new_comment.errors.count), nb: new_comment.errors.count)
      %ul
        - new_comment.errors.full_messages.each do |message|
          %li= message

  - if user_signed_in?
    .alert.alert--info
      %p= format(_('This comment will be posted as "%<name>s"'), name: current_user.username)
      %p= _('By submitting this comment, you agree to be recontacted by the author.')
  - else
    .field
      = f.label :name
      .field-input= f.text_field :name, required: true
    .field
      = f.label :email
      .field-input= f.text_field :email, required: true
    .field
      = f.label :allow_contact
      .field-input= f.check_box :allow_contact
  .field
    = f.label :comment
    .field-input= f.text_area :comment, required: true
  .actions
    = f.submit 'Save', class: 'btn btn--save'

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
elabs-3.0.0 app/views/elabs/comments/_form.html.haml
elabs-2.0.0 app/views/elabs/comments/_form.html.haml
elabs-2.0.0.pre app/views/elabs/comments/_form.html.haml