foodsoft/app/views/deliveries/_form.html.haml

44 lines
1.5 KiB
Plaintext
Raw Normal View History

2012-10-17 20:45:52 +02:00
- content_for :javascript do
:javascript
$(function() {
$('.destroy_stock_change').live('click', function() {
$(this).prev('input').val('1').parent().hide();
return false;
});
$('.remove_new_stock_change').live('click', function() {
$(this).parent().remove();
return false;
})
});
- content_for :javascript do
:javascript
$(function() {
$('#add-stock-change').click();
});
.well.well-small
.btn-toolbar
.btn-group
= link_to t('.new_stock_article'), new_stock_article_supplier_deliveries_path(@supplier), remote: true, class: 'btn'
= simple_form_for [@supplier, @delivery], validate: true do |f|
= f.hidden_field :supplier_id
#stock_changes
= f.fields_for :stock_changes do |stock_change_form|
%p
= stock_change_form.select :stock_article_id, stock_articles_for_select(@supplier)
Menge
= stock_change_form.text_field :quantity, size: 5, autocomplete: 'off'
= stock_change_form.hidden_field :_destroy
2013-04-10 17:02:16 +02:00
= link_to t('.remove_article'), "#", class: 'destroy_stock_change'
%p
= link_to t('.add_article'), {action: 'add_stock_change', supplier_id: @supplier.id}, :id => 'add-stock-change', remote: true, class: 'btn btn-small btn-primary'
%hr/
= f.input :delivered_on, as: :date_picker
= f.input :note, input_html: {size: '35x4'}
.form-actions
= f.submit class: 'btn btn-primary'
2013-04-10 17:02:16 +02:00
= link_to t('ui.or_cancel'), supplier_deliveries_path(@supplier)