Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ingredients List #996

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions app/views/articles/_form.html.haml
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
= render partial: 'shared/article_fields_units', locals: {f: f}

= f.input :note
= f.input :ingredients
= f.association :article_category
/ TODO labels
16 changes: 15 additions & 1 deletion app/views/group_orders/_form.html.haml
Original file line number Diff line number Diff line change
@@ -95,7 +95,14 @@
%td{colspan: "9"}
- order_articles.each do |order_article|
%tr{class: "#{cycle('even', 'odd', name: 'articles')} order-article #{get_missing_units_css_class(@ordering_data[:order_articles][order_article.id][:missing_units])}", valign: "top"}
%td.name= order_article.article.name
- oa = order_article
%td{style: "width:40%"}
= oa.article.name
- unless oa.article.ingredients.blank?
= image_tag("role-article_meta.png", {alt: t('.articles.show_note'), size: "15x16", border: "0", onmouseover: "$('#note_#{oa.id}').show();", onmouseout: "$('#note_#{oa.id}').hide();"})



- if @order.stockit?
%td= truncate order_article.article.supplier.name, length: 15
%td= h order_article.article.origin
@@ -130,6 +137,8 @@
%a.btn.btn-ordering{'data-decrease_tolerance' => order_article.id}
%i.icon-minus



%td{id: "td_price_#{order_article.id}", style: "text-align:right; padding-right:10px; width:4em"}
%span{id: "price_#{order_article.id}_display"}= number_to_currency(@ordering_data[:order_articles][order_article.id][:total_price])
.article-info
@@ -151,6 +160,11 @@
%br/
#{heading_helper Article, :note}: #{order_article.article.note}
%br/

- unless oa.article.ingredients.blank?
%tr{id: "note_#{oa.id}", class: "note even", style: "display:none"}
%td{colspan: "6"}=h oa.article.ingredients

#order-footer
#info-box
#total-sum
5 changes: 5 additions & 0 deletions app/views/group_orders/show.html.haml
Original file line number Diff line number Diff line change
@@ -75,6 +75,8 @@
= oa.article.name
- unless oa.article.note.blank?
= image_tag("lamp_grey.png", {alt: t('.articles.show_note'), size: "15x16", border: "0", onmouseover: "$('#note_#{oa.id}').show();", onmouseout: "$('#note_#{oa.id}').hide();"})
- unless oa.article.note.blank?
= image_tag("role-article_meta.png", {alt: t('.articles.show_note'), size: "15x16", border: "0", onmouseover: "$('#ingredients_#{oa.id}').show();", onmouseout: "$('#ingredients_#{oa.id}').hide();"})
%td= "#{oa.price.unit_quantity} x #{oa.article.unit}"
%td= number_to_currency(oa.price.fc_price)
%td
@@ -85,6 +87,9 @@
- unless oa.article.note.blank?
%tr{id: "note_#{oa.id}", class: "note even", style: "display:none"}
%td{colspan: "6"}=h oa.article.note
- unless oa.article.ingredients.blank?
%tr{id: "ingredients_#{oa.id}", class: "note even", style: "display:none"}
%td{colspan: "6"}=h oa.article.ingredients
%tr{class: cycle('even', 'odd', name: 'articles')}
%th{colspan: "5"}= heading_helper GroupOrder, :price
%th= number_to_currency(@group_order.price)
1 change: 1 addition & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
@@ -55,6 +55,7 @@
t.integer "article_category_id", default: 0, null: false
t.string "unit", default: "", null: false
t.string "note"
t.string "ingredients"
t.boolean "availability", default: true, null: false
t.string "manufacturer"
t.string "origin"