Files
openfoodnetwork/app/views/admin/order_cycles/index.html.haml
2013-11-28 16:13:13 +11:00

59 lines
2.0 KiB
Plaintext

= content_for :page_title do
Order Cycles
= content_for :page_actions do
%li#new_order_cycle_link
= button_link_to "New Order Cycle", main_app.new_admin_order_cycle_path, :icon => 'add', :id => 'admin_new_order_cycle_link'
= form_for @order_cycle_set, :url => main_app.bulk_update_admin_order_cycles_path do |f|
%table.index#listing_order_cycles
%colgroup
%col
%col{'style' => 'width: 20%;'}
%col{'style' => 'width: 20%;'}
%col
%col
%col
%col
%col
%thead
%tr
%th Name
%th Open
%th Close
%th Suppliers
%th Coordinator
%th Distributors
%th Products
%th.actions
%tbody
= f.fields_for :collection do |order_cycle_form|
- order_cycle = order_cycle_form.object
- klass = "order-cycle-#{order_cycle.id} #{order_cycle_status_class order_cycle}"
%tr{class: klass}
%td= link_to order_cycle.name, main_app.edit_admin_order_cycle_path(order_cycle)
%td= order_cycle_form.text_field :orders_open_at, :class => 'datetimepicker', :value => order_cycle.orders_open_at
%td= order_cycle_form.text_field :orders_close_at, :class => 'datetimepicker', :value => order_cycle.orders_close_at
%td.suppliers
- order_cycle.suppliers.each do |s|
= s.name
%br/
%td= order_cycle.coordinator.name
%td.distributors
- order_cycle.distributors.each do |d|
= d.name
%br/
%td.products
- variant_images = capture do
- order_cycle.variants.each do |v|
= image_tag(v.images.first.attachment.url(:mini)) if v.images.present?
%br/
%span.with-tip{'data-powertip' => variant_images}= "#{order_cycle.variants.count} variants"
%td.actions
= link_to '', main_app.clone_admin_order_cycle_path(order_cycle), class: 'clone-order-cycle icon-copy no-text'
= f.submit 'Update'