Refactoring the order cycle partials

This commit is contained in:
Will Marshall
2013-12-05 16:31:12 +11:00
parent 165513fdea
commit 3cda12b8dd
3 changed files with 17 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
- if most_recently_closed = OrderCycle.most_recently_closed_for(@distributor)
The last cycle closed
= distance_of_time_in_words_to_now most_recently_closed.orders_close_at
ago

View File

@@ -0,0 +1,3 @@
- if next_oc = OrderCycle.first_opening_for(@distributor)
The next cycle opens in
= distance_of_time_in_words_to_now next_oc.orders_open_at

View File

@@ -0,0 +1,10 @@
- if @order_cycles.empty?
Orders are currently closed for this hub
%p Please contact your hub directly to see if they accept late orders, or wait until the next cycle opens.
= render partial: "shop/next_order_cycle"
= render partial: "shop/last_order_cycle"
- else
Ready for:
= select_tag :order_cycle_id, options_for_select(order_cycles_name_and_pickup_times(@order_cycles), current_order_cycle.andand.id), :prompt => "Select an Order Cycle!"