From 4abae4c95f015aa55295da2d69da1005dc9ef08e Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 20 Feb 2024 17:45:08 +1100 Subject: [PATCH] Move unit scale to separate column This is because it's going to move from product to variant soon, as part of Product Refactor. --- app/views/admin/products_v3/_product_row.html.haml | 2 ++ app/views/admin/products_v3/_table.html.haml | 8 +++++--- app/views/admin/products_v3/_variant_row.html.haml | 2 ++ config/locales/en.yml | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/views/admin/products_v3/_product_row.html.haml b/app/views/admin/products_v3/_product_row.html.haml index 3e6f5f6bb759..a0da1bd52ea3 100644 --- a/app/views/admin/products_v3/_product_row.html.haml +++ b/app/views/admin/products_v3/_product_row.html.haml @@ -18,6 +18,8 @@ -# empty %td.align-right -# empty +%td.align-right + -# empty %td.align-left .content= product.supplier&.name %td.align-left diff --git a/app/views/admin/products_v3/_table.html.haml b/app/views/admin/products_v3/_table.html.haml index 443a72535a27..fe3eebe7828e 100644 --- a/app/views/admin/products_v3/_table.html.haml +++ b/app/views/admin/products_v3/_table.html.haml @@ -11,7 +11,8 @@ %col= # (grow to fill) Name %col{ width:"8%"} %col{ width:"8%"} - %col{ width:"8%"} + %col{ width:"5%"} + %col{ width:"5%"} %col{ width:"10%"} %col{ width:"15%"}= # Producer %col{ width:"8%"} @@ -20,7 +21,7 @@ %col{ width:"8%"}= # Actions %thead %tr - %td.form-actions-wrapper{ colspan: 11 } + %td.form-actions-wrapper{ colspan: 12 } .form-actions-wrapper2 %fieldset.form-actions{ class: ("hidden" unless defined?(error_counts)), 'data-bulk-form-target': "actions" } .container @@ -41,6 +42,7 @@ %th.align-left= # image %th.align-left.with-input= t('admin.products_page.columns.name') %th.align-left.with-input= t('admin.products_page.columns.sku') + %th.align-right= t('admin.products_page.columns.unit_scale') %th.align-right= t('admin.products_page.columns.unit') %th.align-left.with-input= t('admin.products_page.columns.price') %th.align-left.with-input= t('admin.products_page.columns.on_hand') @@ -69,7 +71,7 @@ %tr{ 'data-nested-form-target': "target" } %tr.condensed %td - %td{ colspan: 10 } + %td{ colspan: 11 } %button.secondary.condensed.naked.icon-plus{ 'data-action': "nested-form#add", 'aria-label': t('.new_variant') } =t('.new_variant') diff --git a/app/views/admin/products_v3/_variant_row.html.haml b/app/views/admin/products_v3/_variant_row.html.haml index e7d1100d4c4a..566bbab0e32d 100644 --- a/app/views/admin/products_v3/_variant_row.html.haml +++ b/app/views/admin/products_v3/_variant_row.html.haml @@ -7,6 +7,8 @@ %td.field = f.text_field :sku, 'aria-label': t('admin.products_page.columns.sku') = error_message_on variant, :sku +%td + -# empty - if variant.persisted? %td.align-right .content= variant.unit_to_display diff --git a/config/locales/en.yml b/config/locales/en.yml index e615792f8ca7..e98ca3699a3d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -559,6 +559,7 @@ en: colums: Columns columns: name: Name + unit_scale: Unit scale unit: Unit price: Price producer: Producer