Files
openfoodnetwork/app/views/admin/subscriptions/_table.html.haml
2018-02-09 14:44:13 +11:00

60 lines
4.3 KiB
Plaintext

= render 'products_panel'
= render 'orders_panel'
%table.index#standing_orders{ ng: { cloak: true, show: 'shop_id && !RequestMonitor.loading && filteredStandingOrders.length > 0' } }
%col.customer{ width: "20%", 'ng-show' => 'columns.customer.visible' }
%col.schedule{ width: "20%", 'ng-show' => 'columns.schedule.visible' }
%col.items{ width: "10%", 'ng-show' => 'columns.items.visible' }
%col.orders{ width: "10%", 'ng-show' => 'columns.orders.visible' }
%col.status{ width: "15%", 'ng-show' => 'columns.state.visible' }
%col.begins_on{ width: "10%", 'ng-show' => 'columns.begins_on.visible' }
%col.ends_on{ width: "10%", 'ng-show' => 'columns.ends_on.visible' }
%col.payment_method{ width: "20%", 'ng-show' => 'columns.payment_method.visible' }
%col.shipping_method{ width: "20%", 'ng-show' => 'columns.shipping_method.visible' }
%col.actions{ width: "15%" }
%thead
%tr
-# %th.bulk
-# %input{ :type => "checkbox", :name => 'toggle_bulk', 'ng-click' => 'toggleAllCheckboxes()', 'ng-checked' => "allBoxesChecked()" }
%th.customer{ ng: { show: 'columns.customer.visible' } }
= t('admin.customer')
%th.schedule{ ng: { show: 'columns.schedule.visible', } }
= t('admin.schedule')
%th.items{ ng: { show: 'columns.items.visible', } }
= t('admin.items')
%th.orders{ ng: { show: 'columns.orders.visible', } }
= t('orders')
%th.status{ ng: { show: 'columns.state.visible', } }
= t('admin.status_state')
%th.begins_on{ ng: { show: 'columns.begins_on.visible', } }
= t('admin.begins_on')
%th.ends_on{ ng: { show: 'columns.ends_on.visible', } }
= t('admin.ends_on')
%th.payment_method{ ng: { show: 'columns.payment_method.visible', } }
= t('admin.payment_method')
%th.shipping_method{ ng: { show: 'columns.shipping_method.visible', } }
= t('admin.shipping_method')
%th.actions
 
%tbody.panel-ctrl{ object: 'standingOrder', ng: { repeat: "standingOrder in standingOrders | filter:query as filteredStandingOrders track by standingOrder.id" } }
%tr.standing_order{ :id => "so_{{standingOrder.id}}", ng: { class: { even: "'even'", odd: "'odd'" } } }
%td.customer.text-center{ ng: { show: 'columns.customer.visible', bind: '::standingOrder.customer_email' } }
%td.schedule.text-center{ ng: { show: 'columns.schedule.visible', bind: '::standingOrder.schedule_name' } }
%td.items.panel-toggle.text-center{ name: 'products', ng: { show: 'columns.items.visible' } }
%h5{ ng: { bind: 'itemCount(standingOrder)' } }
%td.orders.panel-toggle.text-center{ name: 'orders', ng: { show: 'columns.orders.visible' } }
%h5{ ng: { bind: 'standingOrder.not_closed_proxy_orders.length + standingOrder.closed_proxy_orders.length' } }
%td.status.text-center{ ng: { show: 'columns.state.visible' } }
%span.state{ ng: { class: "standingOrder.state", bind: "'spree.standing_order_state.' + standingOrder.state | t" } }
%td.begins_on.text-center{ ng: { show: 'columns.begins_on.visible', bind: '::standingOrder.begins_at' } }
%td.ends_on.text-center{ ng: { show: 'columns.ends_on.visible', bind: '::standingOrder.ends_at' } }
%td.payment_method{ ng: { show: 'columns.payment_method.visible', bind: '::paymentMethodsByID[standingOrder.payment_method_id].name' } }
%td.shipping_method{ ng: { show: 'columns.shipping_method.visible', bind: '::shippingMethodsByID[standingOrder.shipping_method_id].name' } }
%td.actions
%a.edit-standing-order.icon-edit.no-text{ ng: { href: '{{standingOrder.edit_path}}'}, 'ofn-with-tip' => t('.edit_standing_order') }
%a.pause-standing-order.icon-pause.no-text{ ng: { click: 'standingOrder.pause()', hide: '!!standingOrder.paused_at' }, 'ofn-with-tip' => t('.pause_standing_order') , href: 'javascript:void(0)' }
%a.unpause-standing-order.icon-play.no-text{ ng: { click: 'standingOrder.unpause()', show: '!!standingOrder.paused_at' }, 'ofn-with-tip' => t('.unpause_standing_order') , href: 'javascript:void(0)' }
%a.cancel-standing-order.icon-remove.no-text{ ng: { click: 'standingOrder.cancel()', hide: '!!standingOrder.canceled_at'}, 'ofn-with-tip' => t('.cancel_standing_order') , href: 'javascript:void(0)' }
%tr.panel-row{ object: "standingOrder", panels: "{products: 'standing_order_products', orders: 'proxy_orders'}" }