foodcoop-adam/foodsoft

View on GitHub
lib/foodsoft_mollie/app/views/payments/mollie_ideal/_form.html.haml

Summary

Maintainability
Test Coverage
= form_tag payments_mollie_path, method: :post do

  - if params[:text]
    .well= params[:text]

  .control-group
    .control-label
      = label_tag 'amount', ((params[:label] or t('.amount_pay')))
    .controls
      .input-prepend
        %span.add-on= t 'number.currency.format.unit'
        = text_field_tag 'amount', @amount, readonly: (params[:fixed]=='true'), class: 'input-mini'
      - if params[:min]
        .help-inline{style: 'margin-bottom: 10px'}
          = "(min #{number_to_currency params[:min], precision: 0})"
  .control-group
    .control-label
      = label_tag 'bank_id', t('.bank')
    .controls
      = select_tag 'bank_id', options_from_collection_for_select(@banks, 'id', 'name')

  .control-group
    .controls
      = submit_tag t('.submit')
      = link_to t('ui.or_cancel'), cancel_payments_mollie_path

  -# pass through options to allow reusing on error
  - %w(label title fixed min text).each do |k|
    = hidden_field_tag k, params[k] if params[k]