mberlanda/cheidelacoriera

View on GitHub
app/views/reservations/edit.html.haml

Summary

Maintainability
Test Coverage
- @title ||= ti(:title, model: full_entry_label).html_safe
- content_for(:actions, render('actions_edit'))

- provide :head do
  :css
    .form-control-inline {
      display:block;
      height:34px;
      margin: 8px auto;
    }
    .form-control-inline input {
      width:85%;
      heigth:inherit;
      border: 1px solid #ccc
      border-radius:4px;
      font-size: 14px;
    }
    .form-control-inline button {
      width:15%;
      heigth:inherit;
    }

.row
  .col-sm-12.features-box.wow.fadeInLeft
    .jumbotron
      = simple_form_for(@reservation, method: :put, url: reservation_path) do |f|
        = f.error_notification
        .form-inputs
          .col-md-12.col-sm-12.col-xs-12
            = f.input :total_seats, readonly: true
            = f.input :status, collection: Reservation::STATUSES, include_blank: false
            = f.input :fan_names, as: :remove_array, label: 'Elenco Partecipanti', readonly: true
            %p
              %label Aggiungi partecipante
            %small.text-danger#guest-error
            %small.text-success#guest-success
            .form-inline
              = f.input :fan_last_name, as: :fake, label: false, placeholder: 'Cognome', input_html: { value: current_user.last_name }
              = f.input :fan_first_name, as: :fake, label: false, placeholder: 'Nome', input_html: { value: current_user.first_name }
              %button.btn.btn-primary#add-guest{ type: :button } Aggiungi Partecipante
            = f.input :phone_number
            = f.input :stop
            = f.input :event_id, collection: Event.include_all.order(:date).bookable, include_blank: false
            = f.input :user_id, collection: User.order(:email), include_blank: false
            = f.input :notes
        .btn-group{ role: :group }
          = f.button :submit, 'Save', class: 'btn-primary'
          = link_to('Back', reservation_path(@reservation.id), class: 'btn btn-default')

= render partial: 'reservations/js/fans_input'