openSUSE/osem

View on GitHub
app/views/booths/_form.html.haml

Summary

Maintainability
Test Coverage
= form_for(@booth,  url: @url) do |f|
  .form-group
    = f.label :title, 'Title'
    %abbr{title: 'This field is required'} *
    = f.text_field :title, autofocus: true, required: true, class: 'form-control', placeholder: 'Title'
  .form-group
    = f.label :description, 'Description'
    %abbr{title: 'This field is required'} *
    = f.text_area :description, rows: 5, data: { provide: 'markdown' }, required: true, class: 'form-control'
    %span.help-block
      This field becomes public upon request acceptance
  .form-group
    = f.label :reasoning, 'How it fits the conference'
    %abbr{title: 'This field is required'} *
    = f.text_area :reasoning, rows: 5, data: { provide: 'markdown' }, required: true, class: 'form-control'
  .form-group
    = f.label :submitter_relationship, 'Submitter\'s relation'
    %abbr{title: 'This field is required'} *
    = f.text_field :submitter_relationship, rows: 5, required: true, class: 'form-control'
    %span.help-block
      e.g. employee, comunity manager, etc
  .form-group
    = f.label :website_url, 'Website URL'
    %abbr{title: 'This field is required'} *
    = f.text_field :website_url, class: 'form-control', required: true, placeholder: 'URL'
  .form-group
    = f.label :responsible_ids, 'Responsibles'
    = f.select :responsible_ids, @booth.responsibles.pluck(:username, :id), {}, { multiple: true, class: 'form-control', id: 'users_selectize', placeholder: 'Responsibles' }
    %span.help-block
      The people responsible for the `t('booth')`. You can only select existing users.
  .form-group
    = image_tag f.object.picture.thumb.url if f.object.picture?
    = f.label :picture, 'Picture'
    = f.file_field :picture
  %p.text-right
    %button{type: 'submit', class: 'btn btn-success'}
      - if @booth.new_record?
        Create `(t'booth').capitalize` Request
      - else
        Update `(t'booth').capitalize` Request

= render partial: 'shared/user_selectize'