2013-02-11 03:57:33 +01:00
|
|
|
- title t('.title')
|
2011-06-09 21:35:05 +02:00
|
|
|
|
2012-11-10 16:44:05 +01:00
|
|
|
- content_for :javascript do
|
2011-06-09 21:35:05 +02:00
|
|
|
:javascript
|
|
|
|
var ordergroup = "#{escape_javascript(render('ordergroup'))}"
|
|
|
|
|
|
|
|
$(function() {
|
2014-01-25 15:19:50 +01:00
|
|
|
$(document).on('touchclick', 'a[data-remove-transaction]', function() {
|
2011-06-09 21:35:05 +02:00
|
|
|
$(this).parents('tr').remove();
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
2014-01-25 15:19:50 +01:00
|
|
|
$(document).on('touchclick', 'a[data-add-transaction]', function() {
|
2011-06-09 21:35:05 +02:00
|
|
|
$('#ordergroups').append(ordergroup);
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2012-11-10 16:44:05 +01:00
|
|
|
- content_for :sidebar do
|
2013-02-11 03:57:33 +01:00
|
|
|
.well.well-small= t('.sidebar')
|
2012-11-10 16:44:05 +01:00
|
|
|
|
|
|
|
= form_tag finance_create_transaction_collection_path do
|
2011-06-09 21:35:05 +02:00
|
|
|
%p
|
2013-11-23 12:05:29 +01:00
|
|
|
%b= heading_helper FinancialTransaction, :note
|
2012-11-10 16:44:05 +01:00
|
|
|
= text_field_tag :note, params[:note], class: 'input-xlarge', required: 'required'
|
2011-06-09 21:35:05 +02:00
|
|
|
%p
|
|
|
|
%table#ordergroups{:style => "width:20em"}
|
|
|
|
%tr
|
2013-11-23 12:05:29 +01:00
|
|
|
%th= heading_helper FinancialTransaction, :ordergroup
|
|
|
|
%th= heading_helper FinancialTransaction, :amount
|
2011-06-09 21:35:05 +02:00
|
|
|
= render :partial => 'ordergroup', :collection => [1, 2, 3]
|
|
|
|
%p
|
2013-02-11 03:57:33 +01:00
|
|
|
= link_to t('.new_ordergroup'), '#', 'data-add-transaction' => true, class: 'btn'
|
2012-11-10 16:44:05 +01:00
|
|
|
.form-actions
|
2013-02-11 03:57:33 +01:00
|
|
|
= submit_tag t('.save'), class: 'btn btn-primary'
|
2013-04-04 02:49:52 +02:00
|
|
|
= link_to t('ui.or_cancel'), finance_ordergroups_path
|