mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-06 02:51:34 +00:00
Refactoring the order cycle partials
This commit is contained in:
4
app/views/shop/_last_order_cycle.html.haml
Normal file
4
app/views/shop/_last_order_cycle.html.haml
Normal 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
|
||||
3
app/views/shop/_next_order_cycle.html.haml
Normal file
3
app/views/shop/_next_order_cycle.html.haml
Normal 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
|
||||
10
app/views/shop/_order_cycles.html.haml
Normal file
10
app/views/shop/_order_cycles.html.haml
Normal 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!"
|
||||
Reference in New Issue
Block a user