Add total count of selected items

I noticed there's a controller for that too, so might as well make use of it. The orders page has it at the top, because that's where the bulk action menu is. But on this page, the action is the import button so I put it there.
This commit is contained in:
David Cook
2025-02-20 12:09:41 +11:00
parent 6e7766a2c2
commit 4cb1b0a48e
2 changed files with 9 additions and 2 deletions

View File

@@ -8,12 +8,12 @@
%p= t('.enterprise', enterprise_name: @enterprise.name)
%br
= form_with url: main_app.import_admin_dfc_product_imports_path do |form|
= form_with url: main_app.import_admin_dfc_product_imports_path, html: { "data-controller": "checked" } 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" }
%table
%thead
%tr
%th
@@ -33,5 +33,8 @@
- else
= t(".new")
%span{ "data-controller": "checked-feedback", "data-checked-feedback-translation-value": "admin.dfc_product_imports.index.selected" }
= t(".selected", count: @items.count)
%br
= form.submit t(".import")

View File

@@ -854,6 +854,10 @@ en:
select_all: "Select/deselect all"
update: Update
new: New
selected:
zero: "0 selected"
one: "1 selected"
other: "%{count} selected"
import: Import
import:
title: "DFC product catalog import"