allow to edit GroupOrderArticle result from orders screen
Conflicts: app/assets/javascripts/application.js
This commit is contained in:
parent
f9d2c20aaa
commit
60826ceedc
34 changed files with 393 additions and 220 deletions
11
app/views/group_order_articles/_form.html.haml
Normal file
11
app/views/group_order_articles/_form.html.haml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
= simple_form_for @group_order_article, remote: true do |form|
|
||||
= form.hidden_field :order_article_id
|
||||
.modal-header
|
||||
= link_to t('ui.marks.close').html_safe, '#', class: 'close', data: {dismiss: 'modal'}
|
||||
%h3= t('.amount_change_for', article: @order_article.article.name)
|
||||
.modal-body
|
||||
= form.input :ordergroup_id, as: :select, collection: Ordergroup.all.map { |g| [g.name, g.id] }
|
||||
= form.input :result, hint: I18n.t('group_order_articles.form.result_hint', unit: @order_article.article.unit) # Why do we need the full prefix?
|
||||
.modal-footer
|
||||
= link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'}
|
||||
= form.submit t('ui.save'), class: 'btn btn-primary'
|
||||
10
app/views/group_order_articles/create.js.erb
Normal file
10
app/views/group_order_articles/create.js.erb
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
$('#modalContainer').modal('hide');
|
||||
|
||||
// trigger hooks for views
|
||||
$(document).trigger({
|
||||
type: 'GroupOrderArticle#create',
|
||||
order_article_id: <%= @group_order_article.order_article_id %>,
|
||||
group_order_id: <%= @group_order_article.group_order_id %>,
|
||||
group_order_article_id: <%= @group_order_article.id %>,
|
||||
group_order_article_price: <%= @group_order_article.total_price %>
|
||||
});
|
||||
2
app/views/group_order_articles/new.js.erb
Normal file
2
app/views/group_order_articles/new.js.erb
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
$('#modalContainer').html('<%= j render("form") %>');
|
||||
$('#modalContainer').modal();
|
||||
8
app/views/group_order_articles/update.js.erb
Normal file
8
app/views/group_order_articles/update.js.erb
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
// and trigger hooks for views including this
|
||||
$(document).trigger({
|
||||
type: 'GroupOrderArticle#update',
|
||||
order_article_id: <%= @group_order_article.order_article_id %>,
|
||||
group_order_id: <%= @group_order_article.group_order_id %>,
|
||||
group_order_article_id: <%= @group_order_article.id %>,
|
||||
group_order_article_price: <%= @group_order_article.total_price %>
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue