Display message when no matching orders found for BOM

This commit is contained in:
Rob H
2014-02-22 11:48:24 +11:00
parent 1b10bf53c0
commit 83e228dc63
2 changed files with 35 additions and 25 deletions

View File

@@ -26,29 +26,34 @@
End Date
%br
%input{ :class => "four columns alpha", :type => "text", :id => 'end_date_filter', 'ng-model' => 'endDate', 'datetimepicker' => "endDate" }
.spacer{ :class => "seven columns alpha" }
 
%hr{ :class => "sixteen columns alpha", :style => "margin-bottom: 15px" }
%table.index#listing_orders.bulk
%thead
%tr
%th.id ID
%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 | selectFilter:supplierFilter:distributorFilter', 'ng-class-even' => "'even'", 'ng-class-odd' => "'odd'" }
%td.id {{ 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()' }
%div{ :class => "sixteen columns alpha", 'ng-show' => 'lineItems.length == 0'}
%h4{ :style => 'color:red;' } No matching orders found.
%div{ 'ng-hide' => 'lineItems.length == 0' }
%table.index#listing_orders.bulk
%thead
%tr
%th.id ID
%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 | selectFilter:supplierFilter:distributorFilter', 'ng-class-even' => "'even'", 'ng-class-odd' => "'odd'" }
%td.id {{ 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()' }

View File

@@ -29,6 +29,11 @@ feature %q{
page.should have_selector "h1.page-title", text: "Bulk Order Management"
end
it "displays a message when number of products is zero" do
visit '/admin/orders/bulk_management'
page.should have_text "No matching orders found."
end
context "displaying the list of line items " do
let!(:o1) { FactoryGirl.create(:order, state: 'complete', completed_at: Time.now ) }
let!(:o2) { FactoryGirl.create(:order, state: 'complete', completed_at: Time.now ) }