rework group order show view
This commit is contained in:
parent
a0d62f7948
commit
fead6a1c0d
1 changed files with 73 additions and 99 deletions
|
@ -7,107 +7,81 @@
|
||||||
- title t('.title', order: @order.name)
|
- title t('.title', order: @order.name)
|
||||||
|
|
||||||
.row-fluid
|
.row-fluid
|
||||||
.well.pull-left
|
|
||||||
// Order summary
|
|
||||||
%dl.dl-horizontal
|
|
||||||
%dt= heading_helper Order, :name
|
|
||||||
%dd= @order.name
|
|
||||||
%dt= heading_helper Order, :note
|
|
||||||
%dd= @order.note
|
|
||||||
%dt= heading_helper Order, :ends
|
|
||||||
%dd= format_time(@order.ends)
|
|
||||||
%dt= heading_helper Order, :pickup
|
|
||||||
%dd= format_date(@order.pickup)
|
|
||||||
%dt= heading_helper GroupOrder, :price
|
|
||||||
%dd
|
|
||||||
- if @group_order
|
|
||||||
= number_to_currency(@group_order.price)
|
|
||||||
- else
|
|
||||||
= t '.not_ordered'
|
|
||||||
- if @group_order && @group_order.transport
|
|
||||||
%dt= heading_helper GroupOrder, :transport
|
|
||||||
%dd= number_to_currency(@group_order.transport)
|
|
||||||
%dt= heading_helper GroupOrder, :total
|
|
||||||
%dd= number_to_currency(@group_order.total)
|
|
||||||
- if @order.closed?
|
|
||||||
%dt= heading_helper Order, :closed_by
|
|
||||||
%dd= show_user_link @order.updated_by
|
|
||||||
%p= link_to t('.comment'), "#comments"
|
|
||||||
|
|
||||||
.well.pull-right
|
.well.span3
|
||||||
= close_button :alert
|
|
||||||
= render 'switch_order', current_order: @order
|
= render 'switch_order', current_order: @order
|
||||||
|
.well.span8
|
||||||
|
%h2= t '.articles.title'
|
||||||
|
=render 'order_details'
|
||||||
|
|
||||||
// Article box
|
// Article box
|
||||||
%section
|
%section
|
||||||
%h2= t '.articles.title'
|
.column_content#result
|
||||||
.column_content#result
|
- if @group_order
|
||||||
- if @group_order
|
%p= link_to t('.articles.show_hide'), '#', 'data-toggle-this' => 'tr.ignored'
|
||||||
%p.pull-right= link_to t('.articles.show_hide'), '#', 'data-toggle-this' => 'tr.ignored'
|
%table.table.table-hover
|
||||||
%p= link_to(t('.articles.edit_order'), edit_group_order_path(@group_order, order_id: @order.id), class: 'btn btn-primary') if @order.open?
|
%thead
|
||||||
%table.table.table-hover
|
%tr
|
||||||
%thead
|
%th{style: "width:40%"}= heading_helper Article, :name
|
||||||
%tr
|
%th= heading_helper Article, :units
|
||||||
%th{style: "width:40%"}= heading_helper Article, :name
|
%th= t '.articles.unit_price'
|
||||||
%th= heading_helper Article, :units
|
%th
|
||||||
%th= t '.articles.unit_price'
|
%abbr{title: t('.articles.ordered_title')}= t '.articles.ordered'
|
||||||
%th
|
%th
|
||||||
%abbr{title: t('.articles.ordered_title')}= t '.articles.ordered'
|
%abbr{title: t('.articles.order_nopen_title')}
|
||||||
%th
|
- if @order.open?
|
||||||
%abbr{title: t('.articles.order_nopen_title')}
|
= t '.articles.order_open'
|
||||||
- if @order.open?
|
- else
|
||||||
= t '.articles.order_open'
|
= t '.articles.order_not_open'
|
||||||
- else
|
%th= heading_helper GroupOrderArticle, :total_price
|
||||||
= t '.articles.order_not_open'
|
%tbody
|
||||||
%th= heading_helper GroupOrderArticle, :total_price
|
- for category_name, order_articles in @order.articles_grouped_by_category
|
||||||
%tbody
|
%tr.article-category
|
||||||
- for category_name, order_articles in @order.articles_grouped_by_category
|
%td
|
||||||
%tr.article-category
|
= category_name
|
||||||
%td
|
%i.icon-tag
|
||||||
= category_name
|
%td{colspan: "9"}
|
||||||
%i.icon-tag
|
- order_articles.each do |oa|
|
||||||
%td{colspan: "9"}
|
- # get the order-results for the ordergroup
|
||||||
- order_articles.each do |oa|
|
- r = get_order_results(oa, @group_order.id)
|
||||||
- # get the order-results for the ordergroup
|
%tr{class: cycle('even', 'odd', name: 'articles') + " " + order_article_class_name(r[:quantity], r[:tolerance], r[:result])}
|
||||||
- r = get_order_results(oa, @group_order.id)
|
%td{style: "width:40%"}
|
||||||
%tr{class: cycle('even', 'odd', name: 'articles') + " " + order_article_class_name(r[:quantity], r[:tolerance], r[:result])}
|
= oa.article.name
|
||||||
%td{style: "width:40%"}
|
- unless oa.article.note.blank?
|
||||||
= oa.article.name
|
= image_tag("lamp_grey.png", {alt: t('.articles.show_note'), size: "15x16", border: "0", onmouseover: "$('#note_#{oa.id}').show();", onmouseout: "$('#note_#{oa.id}').hide();"})
|
||||||
|
%td= "#{oa.price.unit_quantity} x #{oa.article.unit}"
|
||||||
|
%td= number_to_currency(oa.price.fc_price)
|
||||||
|
%td
|
||||||
|
= r[:quantity]
|
||||||
|
= "+ #{r[:tolerance]}" if oa.price.unit_quantity > 1
|
||||||
|
%td= r[:result] > 0 ? r[:result] : "0"
|
||||||
|
%td= number_to_currency(r[:sub_total])
|
||||||
- unless oa.article.note.blank?
|
- 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();"})
|
%tr{id: "note_#{oa.id}", class: "note even", style: "display:none"}
|
||||||
%td= "#{oa.price.unit_quantity} x #{oa.article.unit}"
|
%td{colspan: "6"}=h oa.article.note
|
||||||
%td= number_to_currency(oa.price.fc_price)
|
%tr{class: cycle('even', 'odd', name: 'articles')}
|
||||||
%td
|
%th{colspan: "5"}= heading_helper GroupOrder, :price
|
||||||
= r[:quantity]
|
%th= number_to_currency(@group_order.price)
|
||||||
= "+ #{r[:tolerance]}" if oa.price.unit_quantity > 1
|
- if @group_order.transport
|
||||||
%td= r[:result] > 0 ? r[:result] : "0"
|
%tr{class: cycle('even', 'odd', name: 'articles')}
|
||||||
%td= number_to_currency(r[:sub_total])
|
%td{colspan: "5"}= heading_helper GroupOrder, :transport
|
||||||
- unless oa.article.note.blank?
|
%td= number_to_currency(@group_order.transport)
|
||||||
%tr{id: "note_#{oa.id}", class: "note even", style: "display:none"}
|
%tr{class: cycle('even', 'odd', name: 'articles')}
|
||||||
%td{colspan: "6"}=h oa.article.note
|
%th{colspan: "5"}= heading_helper GroupOrder, :total
|
||||||
%tr{class: cycle('even', 'odd', name: 'articles')}
|
%th= number_to_currency(@group_order.total)
|
||||||
%th{colspan: "5"}= heading_helper GroupOrder, :price
|
%br/
|
||||||
%th= number_to_currency(@group_order.price)
|
= link_to_top
|
||||||
- if @group_order.transport
|
%p.pull-right= link_to(t('.articles.edit_order'), edit_group_order_path(@group_order, order_id: @order.id), class: 'btn btn-primary') if @order.open?
|
||||||
%tr{class: cycle('even', 'odd', name: 'articles')}
|
- else
|
||||||
%td{colspan: "5"}= heading_helper GroupOrder, :transport
|
- if @order.open?
|
||||||
%td= number_to_currency(@group_order.transport)
|
= t '.articles.not_ordered_msg'
|
||||||
%tr{class: cycle('even', 'odd', name: 'articles')}
|
= link_to t('.articles.order_now'), action: "order", id: @order
|
||||||
%th{colspan: "5"}= heading_helper GroupOrder, :total
|
- else
|
||||||
%th= number_to_currency(@group_order.total)
|
= t '.articles.order_closed_msg'
|
||||||
%br/
|
|
||||||
= link_to_top
|
|
||||||
- else
|
|
||||||
- if @order.open?
|
|
||||||
= t '.articles.not_ordered_msg'
|
|
||||||
= link_to t('.articles.order_now'), action: "order", id: @order
|
|
||||||
- else
|
|
||||||
= t '.articles.order_closed_msg'
|
|
||||||
|
|
||||||
// Comments box
|
// Comments box
|
||||||
%section
|
%hr
|
||||||
%h2= t '.comments.title'
|
%h2= t '.comments.title'
|
||||||
#comments
|
#comments
|
||||||
= render 'shared/comments', comments: @order.comments
|
= render 'shared/comments', comments: @order.comments
|
||||||
#new_comment= render 'order_comments/form', order_comment: @order.comments.build(user: current_user)
|
#new_comment= render 'order_comments/form', order_comment: @order.comments.build(user: current_user)
|
||||||
= link_to_top
|
= link_to_top
|
Loading…
Reference in a new issue