mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-30 21:27:17 +00:00
11060 - implement the scenario 2 and 3
This commit is contained in:
committed by
Rachel Arnould
parent
dd4fe86e9f
commit
2fdaa8b9ec
@@ -10,6 +10,7 @@ module PermittedAttributes
|
||||
:display_as, :sku, :group_buy, :group_buy_unit_size,
|
||||
:taxon_ids, :primary_taxon_id, :tax_category_id,
|
||||
:meta_keywords, :notes, :inherits_properties,
|
||||
:supplier_id,
|
||||
{ product_properties_attributes: [:id, :property_name, :value],
|
||||
variants_attributes: [PermittedAttributes::Variant.attributes],
|
||||
image_attributes: [:attachment] }
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
.container.results
|
||||
.sixteen.columns
|
||||
= render partial: 'sort', locals: { pagy: pagy, search_term: search_term, producer_id: producer_id, category_id: category_id }
|
||||
= render partial: 'table', locals: { products: products }
|
||||
= render partial: 'table', locals: { products:, producer_options: }
|
||||
- if pagy.present? && pagy.pages > 1
|
||||
= render partial: 'admin/shared/stimulus_pagination', locals: { pagy: pagy }
|
||||
- else
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
%td.field.naked_inputs
|
||||
= f.text_field :sku, 'aria-label': t('admin.products_page.columns.sku')
|
||||
= error_message_on product, :sku
|
||||
%td.multi-field.naked_inputs{ 'data-controller': 'toggle-control', 'data-toggle-control-match-value': 'items' }
|
||||
%td.field.naked_inputs{ 'data-controller': 'toggle-control', 'data-toggle-control-match-value': 'items' }
|
||||
= f.hidden_field :variant_unit
|
||||
= f.hidden_field :variant_unit_scale
|
||||
= f.select :variant_unit_with_scale,
|
||||
@@ -27,8 +27,9 @@
|
||||
-# empty
|
||||
%td.align-right
|
||||
-# empty
|
||||
%td.align-left
|
||||
.content= product.supplier&.name
|
||||
%td.naked_inputs.align-left
|
||||
= f.select :supplier_id, options_for_select(producer_options, product.supplier&.id), {},
|
||||
data: { "controller": "tom-select", 'tom-select-placeholder-value': t('admin.products_v3.filters.search_for_producers')}
|
||||
%td.align-left
|
||||
-# empty
|
||||
%td.align-left
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
controller: "nested-form product",
|
||||
action: 'rails-nested-form:add->bulk-form#registerElements' } }
|
||||
%tr
|
||||
= render partial: 'product_row', locals: { product:, f: product_form }
|
||||
= render partial: 'product_row', locals: { f: product_form, product:, producer_options: }
|
||||
|
||||
- product.variants.each_with_index do |variant, variant_index|
|
||||
= form.fields_for("products][#{product_index}][variants_attributes][", variant, index: variant_index) do |variant_form|
|
||||
|
||||
@@ -170,12 +170,6 @@
|
||||
.field {
|
||||
padding: 0;
|
||||
}
|
||||
.multi-field {
|
||||
// Allow wrap with small gap
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 3px;
|
||||
}
|
||||
|
||||
.ts-control {
|
||||
z-index: 0; // Avoid hovering over thead
|
||||
|
||||
Reference in New Issue
Block a user