2015-09-11 13:16:53 +02:00
|
|
|
#transaction_success.pure-alert.pure-alert-success.hidden
|
|
|
|
Transaction created!
|
2015-09-10 21:46:05 +02:00
|
|
|
= render 'partials/form_errors', object: @transaction
|
2015-09-11 13:16:53 +02:00
|
|
|
|
2015-09-11 14:52:26 +02:00
|
|
|
= form_for @transaction, remote: true, html: { class: "pure-form form-inline" } do |f|
|
2015-09-10 21:46:05 +02:00
|
|
|
- if current_user.penning
|
|
|
|
= f.collection_select :debtor, User.all, :name, :name,
|
2015-09-11 14:52:26 +02:00
|
|
|
{ selected: @transaction.debtor.try(:name) || current_user.name }, { class: 'select2-selector form-control'}
|
2015-09-10 21:46:05 +02:00
|
|
|
- else
|
|
|
|
= f.hidden_field :debtor, value: current_user.name
|
2015-09-11 14:52:26 +02:00
|
|
|
= f.select :creditor,
|
|
|
|
options_from_collection_for_select(User.all.order(:name), :name, :name),
|
|
|
|
{ include_blank: true },
|
|
|
|
{ class: 'select2-selector form-control', size: 50 }
|
2015-09-10 21:46:05 +02:00
|
|
|
-# { class: 'select2-selector', size: 50, required: true }
|
2015-09-11 14:52:26 +02:00
|
|
|
= f.text_field :message, placeholder: "Message", size: 75, class: "form-control"
|
2015-09-10 21:46:05 +02:00
|
|
|
-# = f.text_field :message, required: true, placeholder: "Message", size: 75
|
2015-09-11 14:52:26 +02:00
|
|
|
.input-group
|
|
|
|
%span.input-group-addon
|
|
|
|
%span.glyphicon.glyphicon-euro
|
2015-09-10 21:46:05 +02:00
|
|
|
= f.number_field :euros, value: amount(@transaction.amount),
|
2015-09-11 14:52:26 +02:00
|
|
|
placeholder: "Bedrag", step: 0.01, min: 0.01, class: "form-control", size: 20
|
2015-09-10 21:46:05 +02:00
|
|
|
-# placeholder: "Bedrag", step: 0.01, min: 0.01, class: "pure-group-addon price", size: 20, required: true
|
|
|
|
= f.submit "Send it!", class: "pure-button pure-button-primary"
|