diff --git a/app/assets/javascripts/admin/bulk_product_update.js.coffee b/app/assets/javascripts/admin/bulk_product_update.js.coffee index c44f1c954a..be2b8bd3cc 100644 --- a/app/assets/javascripts/admin/bulk_product_update.js.coffee +++ b/app/assets/javascripts/admin/bulk_product_update.js.coffee @@ -121,10 +121,10 @@ productsApp.controller "AdminBulkProductsCtrl", [ style: {} $scope.columns = - name: {name: "Name", visible: true} supplier: {name: "Supplier", visible: true} - price: {name: "Price", visible: true} + name: {name: "Name", visible: true} unit: {name: "Unit", visible: true} + price: {name: "Price", visible: true} on_hand: {name: "On Hand", visible: true} available_on: {name: "Available On", visible: true} diff --git a/app/assets/stylesheets/admin/products.css.scss b/app/assets/stylesheets/admin/products.css.scss index cd1067e51e..923b6b6867 100644 --- a/app/assets/stylesheets/admin/products.css.scss +++ b/app/assets/stylesheets/admin/products.css.scss @@ -41,7 +41,7 @@ li.column-list-item.unselected { font-size: 100%; } -ul.column-list{ +ul.column-list { padding: 5px 8px; border-radius: 3px; border: solid 1px darkgray; @@ -49,6 +49,12 @@ ul.column-list{ } table#listing_products.bulk { + td.supplier { + select { + width: 125px; + } + } + td.unit { input, select { width: 100%; diff --git a/app/views/spree/admin/products/bulk_edit.html.haml b/app/views/spree/admin/products/bulk_edit.html.haml index 5ec49da295..84572efaba 100644 --- a/app/views/spree/admin/products/bulk_edit.html.haml +++ b/app/views/spree/admin/products/bulk_edit.html.haml @@ -28,13 +28,23 @@ %br.clear %br.clear %table.index#listing_products.bulk + %colgroup + %col + %col + %col{'style' => 'width: 20%;'} + %col{'style' => 'width: 12%;'} + %col + %col + %col + %col + %thead %tr %th.left-actions - %th{ 'ng-show' => 'columns.name.visible' } Name %th{ 'ng-show' => 'columns.supplier.visible' } Supplier - %th{ 'ng-show' => 'columns.price.visible' } Price + %th{ 'ng-show' => 'columns.name.visible' } Name %th{ 'ng-show' => 'columns.unit.visible' } Unit / Value + %th{ 'ng-show' => 'columns.price.visible' } Price %th{ 'ng-show' => 'columns.on_hand.visible' } On Hand %th{ 'ng-show' => 'columns.available_on.visible' } Av. On %th.actions @@ -42,15 +52,15 @@ %tr.product %td.left-actions %a{ 'ofn-toggle-variants' => 'true', :class => "view-variants icon-chevron-right", 'ng-show' => 'hasVariants(product)' } + %td.supplier{ 'ng-show' => 'columns.supplier.visible' } + %select.select2{ 'ng-model' => 'product.supplier', :name => 'supplier', 'ofn-track-product' => 'supplier', 'ng-options' => 's.name for s in suppliers' } %td{ 'ng-show' => 'columns.name.visible' } %input{ 'ng-model' => "product.name", :name => 'product_name', 'ofn-track-product' => 'name', :type => 'text' } - %td{ 'ng-show' => 'columns.supplier.visible' } - %select.select2{ 'ng-model' => 'product.supplier', :name => 'supplier', 'ofn-track-product' => 'supplier', 'ng-options' => 's.name for s in suppliers' } - %td{ 'ng-show' => 'columns.price.visible' } - %input{ 'ng-model' => 'product.price', 'ofn-decimal' => :true, :name => 'price', 'ofn-track-product' => 'price', :type => 'text' } %td.unit{ 'ng-show' => 'columns.unit.visible' } %select.select2{ 'ng-model' => 'product.variant_unit_with_scale', :name => 'variant_unit_with_scale', 'ofn-track-product' => 'variant_unit_with_scale', 'ng-options' => 'unit[1] as unit[0] for unit in variant_unit_options' } %input{ 'ng-model' => 'product.variant_unit_name', :name => 'variant_unit_name', 'ofn-track-product' => 'variant_unit_name', 'ng-show' => "product.variant_unit_with_scale == 'items'", :type => 'text' } + %td{ 'ng-show' => 'columns.price.visible' } + %input{ 'ng-model' => 'product.price', 'ofn-decimal' => :true, :name => 'price', 'ofn-track-product' => 'price', :type => 'text' } %td{ 'ng-show' => 'columns.on_hand.visible' } %span{ 'ng-bind' => 'product.on_hand', :name => 'on_hand', 'ng-show' => 'hasVariants(product)' } %input.field{ 'ng-model' => 'product.on_hand', :name => 'on_hand', 'ofn-track-product' => 'on_hand', 'ng-show' => '!hasVariants(product)', :type => 'number' } @@ -65,13 +75,13 @@ %tr.variant{ 'ng-repeat' => 'variant in product.variants', 'ng-show' => 'displayProperties[product.id].showVariants', 'ng-class-even' => "'even'", 'ng-class-odd' => "'odd'" } %td.left-actions %a{ :class => "variant-item icon-caret-right" } + %td{ 'ng-show' => 'columns.supplier.visible' } %td{ 'ng-show' => 'columns.name.visible' } {{ variant.options_text }} - %td{ 'ng-show' => 'columns.supplier.visible' } - %td{ 'ng-show' => 'columns.price.visible' } - %input{ 'ng-model' => 'variant.price', 'ofn-decimal' => :true, :name => 'variant_price', 'ofn-track-variant' => 'price', :type => 'text' } %td{ 'ng-show' => 'columns.unit.visible' } %input{ 'ng-model' => 'variant.unit_value_with_description', :name => 'variant_unit_value_with_description', 'ofn-track-variant' => 'unit_value_with_description', :type => 'text' } + %td{ 'ng-show' => 'columns.price.visible' } + %input{ 'ng-model' => 'variant.price', 'ofn-decimal' => :true, :name => 'variant_price', 'ofn-track-variant' => 'price', :type => 'text' } %td{ 'ng-show' => 'columns.on_hand.visible' } %input.field{ 'ng-model' => 'variant.on_hand', 'ng-change' => 'updateOnHand(product)', :name => 'variant_on_hand', 'ofn-track-variant' => 'on_hand', :type => 'number' } %td{ 'ng-show' => 'columns.available_on.visible' }