hugogilmar/quadro

View on GitHub
app/views/quadro/assets/slide/_form.html.haml

Summary

Maintainability
Test Coverage
.modal-header
  %button.close(data-dismiss="modal" type="button")
    %span(aria-hidden="true") ×
  %h4.modal-title= t('quadro.modal.edit')
.modal-body
  = simple_form_for asset, as: :asset, url: (widget.present? ? page_widget_asset_path(page_id: page.id, widget_id: widget.id, id: asset.id) : page_asset_path(page_id: page.id, id: asset.id)), method: :put, multipart: true, remote: true do |form|
    .row
      .col-md-4
        .fileinput.fileinput-new(data-provides="fileinput")
          .fileinput-new.thumbnail
            = image_tag form.object.attachment.url(:small)
          .fileinput-preview.fileinput-exists.thumbnail
          .text-center
            %span.btn.btn-default.btn-file
              %span.fileinput-new= t('quadro.field.upload.select')
              %span.fileinput-exists= t('quadro.field.upload.change')
              = form.input_field :attachment
            %a.btn.btn-default.fileinput-exists(data-dismiss="fileinput" href="#")= t('quadro.field.upload.remove')
      .col-md-8
        = form.input :alt, input_html: { class: 'form-control' }
        = form.input :href, as: :url, input_html: { class: 'form-control' }
        .row
          .col-md-6
            = form.input :width, input_html: { class: 'form-control' }
          .col-md-6
            = form.input :height, input_html: { class: 'form-control' }
    .text-right
      = form.submit class: 'btn btn-primary'