mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-03 22:06:07 +00:00
Ensure label reaches to edge of table cell
Best viewed with whitespace ignored
This commit is contained in:
@@ -1,36 +1,37 @@
|
||||
- content_for :page_title do
|
||||
#{t(".title")}
|
||||
|
||||
= render partial: 'spree/admin/shared/product_sub_menu'
|
||||
|
||||
%p= t('.catalog_url', count: @items.count, catalog_url: @catalog_url)
|
||||
%p= t('.enterprise', enterprise_name: @enterprise.name)
|
||||
%br
|
||||
|
||||
= form_with url: main_app.import_admin_dfc_product_imports_path do |form|
|
||||
-# This is a very inefficient way of holding a json blob. Maybe base64 encode or store as a temporary file
|
||||
= form.hidden_field :enterprise_id, value: @enterprise.id
|
||||
= form.hidden_field :catalog_json, value: @catalog_json
|
||||
|
||||
%table{"data-controller": "checked" }
|
||||
%thead
|
||||
%tr
|
||||
%th
|
||||
%input{ type: 'checkbox', title: t('.select_all'), 'aria-label': t('.select_all'), 'data-checked-target': "all" }
|
||||
%th
|
||||
%tbody
|
||||
- @items.each do |supplied_product, existing_product|
|
||||
%tr{id: supplied_product.semanticId }
|
||||
%td
|
||||
%label
|
||||
= form.check_box 'semanticIds[]', { checked: true, 'data-checked-target': "checkbox" }, supplied_product.semanticId, ""
|
||||
= supplied_product.name
|
||||
%td
|
||||
- if existing_product.present?
|
||||
= t(".update")
|
||||
= link_to(existing_product.id, edit_admin_product_path(existing_product))
|
||||
- else
|
||||
= t(".new")
|
||||
#dfc_product_imports
|
||||
= render partial: 'spree/admin/shared/product_sub_menu'
|
||||
|
||||
%p= t('.catalog_url', count: @items.count, catalog_url: @catalog_url)
|
||||
%p= t('.enterprise', enterprise_name: @enterprise.name)
|
||||
%br
|
||||
= form.submit t(".import")
|
||||
|
||||
= form_with url: main_app.import_admin_dfc_product_imports_path do |form|
|
||||
-# This is a very inefficient way of holding a json blob. Maybe base64 encode or store as a temporary file
|
||||
= form.hidden_field :enterprise_id, value: @enterprise.id
|
||||
= form.hidden_field :catalog_json, value: @catalog_json
|
||||
|
||||
%table{"data-controller": "checked" }
|
||||
%thead
|
||||
%tr
|
||||
%th
|
||||
%input{ type: 'checkbox', title: t('.select_all'), 'aria-label': t('.select_all'), 'data-checked-target': "all" }
|
||||
%th
|
||||
%tbody
|
||||
- @items.each do |supplied_product, existing_product|
|
||||
%tr{id: supplied_product.semanticId }
|
||||
%td
|
||||
%label
|
||||
= form.check_box 'semanticIds[]', { checked: true, 'data-checked-target': "checkbox" }, supplied_product.semanticId, ""
|
||||
= supplied_product.name
|
||||
%td
|
||||
- if existing_product.present?
|
||||
= t(".update")
|
||||
= link_to(existing_product.id, edit_admin_product_path(existing_product))
|
||||
- else
|
||||
= t(".new")
|
||||
|
||||
%br
|
||||
= form.submit t(".import")
|
||||
|
||||
@@ -133,3 +133,4 @@
|
||||
@import "terms_of_service_banner"; // admin_v3
|
||||
|
||||
@import "pages/product_preview"; // admin_v3
|
||||
@import "pages/dfc_product_imports"; // admin_v3
|
||||
|
||||
11
app/webpacker/css/admin_v3/pages/dfc_product_imports.scss
Normal file
11
app/webpacker/css/admin_v3/pages/dfc_product_imports.scss
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
#dfc_product_imports {
|
||||
// Ensure label reaches to edge of table cell
|
||||
td:has(> label) {
|
||||
padding: 0;
|
||||
}
|
||||
td > label {
|
||||
display: block;
|
||||
padding: 7px 5px;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user