mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-03 22:06:07 +00:00
Add strict locals for some products V3 templates
Rails now allows you to define which local a template is expecting: https://edgeguides.rubyonrails.org/7_1_release_notes.html#allow-templates-to-set-strict-locals
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
-# locals: (products:, pagy:, search_term:, producer_options:, producer_id:, category_options:, category_id:, tax_category_options:, available_tags:, tags:, flashes:, display_search_filter:)
|
||||
%turbo-frame#products-content{ target: "_top", refresh: "morph" }
|
||||
.spinner-overlay{ "data-controller": "loading", "data-products-target": "loading", class: "hidden" }
|
||||
.spinner-container
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-# locals: (form:, product:, product_index:, producer_options:, category_options:, tax_category_options:)
|
||||
= form.fields_for("products", product, index: product_index) do |product_form|
|
||||
%tbody.relaxed{ id: dom_id(product), data: { 'record-id': product_form.object.id,
|
||||
controller: "nested-form product",
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-# locals: (products:, producer_options:, category_options:, tax_category_options:)
|
||||
= form_with url: admin_products_bulk_update_path, method: :post, id: "products-form",
|
||||
builder: BulkFormBuilder,
|
||||
html: { data: { 'turbo-frame': "_self",
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-# locals: (variant:, f:, category_options:, tax_category_options:, producer_options:)
|
||||
- method_on_demand, method_on_hand = variant.new_record? ? [:on_demand_desired, :on_hand_desired ]: [:on_demand, :on_hand]
|
||||
%td.col-image
|
||||
-# empty
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
-# locals: (producers:, categories:, tax_category_options:, available_tags:, flash:)
|
||||
- content_for :page_title do
|
||||
= t('.header.title')
|
||||
- content_for :page_actions do
|
||||
|
||||
Reference in New Issue
Block a user