Files
openfoodnetwork/app/views/spree/admin/orders/bulk_management.html.haml
2014-03-06 16:32:23 +11:00

67 lines
3.8 KiB
Plaintext

- content_for :page_title do
= "Bulk Order Management"
= render :partial => 'spree/admin/shared/order_sub_menu'
%div{ 'ng-app' => 'ofn.bulk_order_management', 'ng-controller' => 'AdminOrderMgmtCtrl', 'ng-init' => "initialise('#{@spree_api_key}');loading=true;" }
%div{ 'ng-show' => '!spree_api_key_ok' }
{{ api_error_msg }}
.filter_selects{ :class => "three columns alpha" }
.filter_select{ :class => "three columns alpha" }
%label{ :for => 'supplier_filter' }Producer
%br
%select.select2{ :class => "three columns alpha", :id => 'supplier_filter', 'ng-model' => 'supplierFilter', 'ng-options' => 's.name for s in suppliers' }
.filter_select{ :class => "three columns alpha" }
%label{ :for => 'distributor_filter' }Hub
%br
%select.select2{ :class => "three columns alpha", :id => 'distributor_filter', 'ng-model' => 'distributorFilter', 'ng-options' => 'd.name for d in distributors'}
.filter_select{ :class => "three columns alpha" }
%label{ :for => 'order_cycle_filter' }Order Cycle
%br
%select.select2{ :class => "three columns alpha", :id => 'order_cycle_filter', 'ng-model' => 'orderCycleFilter', 'ng-options' => 'oc.name for oc in orderCycles'}
.spacer{ :class => "one column alpha" }
 
.date_filters{ :class => "three columns alpha" }
.date_filter{ :class => "three columns alpha" }
%label{ :for => 'start_date_filter' }Start Date
%br
%input{ :class => "three columns alpha", :type => "text", :id => 'start_date_filter', 'ng-model' => 'startDate', 'datetimepicker' => "startDate", 'ofn-confirm-change' => "startDate" }
.date_filter{ :class => "three columns alpha" }
%label{ :for => 'end_date_filter' }End Date
%br
%input{ :class => "three columns alpha", :type => "text", :id => 'end_date_filter', 'ng-model' => 'endDate', 'datetimepicker' => "endDate", 'ofn-confirm-change' => "endDate" }
.quick_search{ :class => "three columns alpha"}
%label{ :for => 'quick_search' }Quick Search
%br
%input{ :class => "three columns alpha", :type => "text", :id => 'quick_search', 'ng-model' => 'quickSearch', :placeholder => 'Quick Search' }
.spacer{ :class => "seven columns alpha" }
 
%hr{ :class => "sixteen columns alpha", :style => "margin-bottom: 15px" }
%div.loading{ :class => "sixteen columns alpha", 'ng-show' => 'loading' }
%h4 Loading Line Items...
%div{ :class => "sixteen columns alpha", 'ng-show' => '!loading && lineItems.length == 0'}
%h4{ :style => 'color:red;' } No matching line items found.
%div{ 'ng-hide' => 'loading || lineItems.length == 0' }
%table.index#listing_orders.bulk
%thead
%tr
%th.email Email
%th.date Order Date
%th.producer Producer
%th.variant Product (Unit): Var
%th.quantity Quantity
%th.max Max
%th.actions
Ask? 
%input{ :type => 'checkbox', 'ng-model' => "confirmDelete" }
%tr.line_item{ 'ng-repeat' => 'line_item in lineItems | filter:quickSearch | selectFilter:supplierFilter:distributorFilter:orderCycleFilter:quickSearch', 'ng-class-even' => "'even'", 'ng-class-odd' => "'odd'", :id => "li_{{line_item.id}}" }
%td.email {{ line_item.order.email }}
%td.date {{ line_item.order.completed_at }}
%td.producer {{ line_item.supplier.name }}
%td.variant {{ line_item.variant_unit_text }}
%td.quantity
%input{ :type => 'number', :name => 'quantity', 'ng-model' => "line_item.quantity", 'ofn-line-item-upd-attr' => "quantity" }
%td.max {{ line_item.max }}
%td.actions
%a{ 'ng-click' => "deleteLineItem(line_item)", :class => "delete-line-item icon-trash no-text" }
%input{ :type => "button", 'value' => 'Update', 'ng-click' => 'pendingChanges.submitAll()' }