Merge pull request #355 from foodcoop1040/expeted_delivery_date

Add expected delivery date
This commit is contained in:
wvengen 2016-05-04 17:42:29 +02:00
commit 8d5467ab7c
15 changed files with 59 additions and 9 deletions

View file

@ -4,6 +4,7 @@
= f.input :starts, as: :date_picker_time
= f.input :boxfill, as: :date_picker_time if @order.is_boxfill_useful?
= f.input :ends, as: :date_picker_time
= f.input :pickup, as: :date_picker, input_html: {class: 'input-small'}
= f.input :note, input_html: {rows: 2, class: 'input-xxlarge'}
%h2= t '.title'

View file

@ -3,6 +3,7 @@
%thead
%tr
%th= sort_link_helper heading_helper(Order, :supplier), "supplier"
%th= sort_link_helper heading_helper(Order, :pickup), "pickup"
%th= heading_helper Order, :starts
%th= sort_link_helper heading_helper(Order, :ends), "ends"
%th= heading_helper Order, :status
@ -11,6 +12,7 @@
- @orders.each do |order|
%tr
%td= order.name
%td= format_date(order.pickup)
%td= format_time(order.starts)
%td= format_time(order.ends)
%td= t(order.state, scope: 'orders.state')

View file

@ -21,6 +21,7 @@
%thead
%tr
%th= heading_helper Order, :name
%th= heading_helper Order, :pickup
%th= heading_helper Order, :ends
%th= heading_helper Order, :note
%th{colspan: "2"}
@ -30,6 +31,7 @@
- tr_class = " active" if order.expired?
%tr{class: tr_class}
%td= order.name
%td= format_date(order.pickup) unless order.pickup.nil?
%td= format_time(order.ends) unless order.ends.nil?
%td= truncate(order.note)
%td= link_to t('.action_end'), finish_order_path(order),
@ -50,6 +52,7 @@
- for order in @finished_orders
%tr
%td= order.name
%td= format_date(order.pickup) unless order.pickup.nil?
%td= format_time(order.ends)
%td= truncate(order.note)
%td

View file

@ -11,12 +11,23 @@
.well
= close_button :alert
%p
= raw t '.description1',
- description1 = raw t '.description1_order',
state: t("orders.state.#{@order.state}").capitalize,
supplier: supplier_link(@order),
who: show_user_link(@order.created_by),
starts: format_time(@order.starts),
ends: format_time(@order.ends)
who: show_user_link(@order.created_by)
- description1 += ' '
- if @order.ends
- description1 += raw t '.description1_period.starts_ends',
starts: format_time(@order.starts),
ends: format_time(@order.ends)
- else
- description1 += raw t '.description1_period.starts',
starts: format_time(@order.starts)
- if @order.pickup
- description1 += ' '
- description1 += raw t '.description1_period.pickup',
pickup: format_date(@order.pickup)
= description1 + '.'
%br
= raw t '.description2',
ordergroups: ordergroup_count(@order),