foodsoft/app/views/finance/financial_transactions/new_collection.html.haml

37 lines
1.2 KiB
Plaintext

- title t('.title')
- content_for :javascript do
:javascript
var ordergroup = "#{escape_javascript(render('ordergroup'))}"
$(function() {
$(document).on('touchclick', 'a[data-remove-transaction]', function() {
$(this).parents('tr').remove();
return false;
});
$(document).on('touchclick', 'a[data-add-transaction]', function() {
$('#ordergroups').append(ordergroup);
return false;
});
});
- content_for :sidebar do
.well.well-small= t('.sidebar')
= form_tag finance_create_transaction_collection_path do
%p
%b= heading_helper FinancialTransaction, :note
= text_field_tag :note, params[:note], class: 'input-xlarge', required: 'required'
%p
%table#ordergroups{:style => "width:20em"}
%tr
%th= heading_helper FinancialTransaction, :ordergroup
%th= heading_helper FinancialTransaction, :amount
= render :partial => 'ordergroup', :collection => [1, 2, 3]
%p
= link_to t('.new_ordergroup'), '#', 'data-add-transaction' => true, class: 'btn'
.form-actions
= submit_tag t('.save'), class: 'btn btn-primary'
= link_to t('ui.or_cancel'), finance_ordergroups_path