Open links outside of frame by default

This page is big enough and it's hard to see how everything works. So links work like links by default (eg edit and clone). Other links and forms are special, and will reload only the frame: this is now explicit in the code.
This commit is contained in:
David Cook
2024-04-17 13:08:18 +10:00
parent acc72514de
commit 06f67488a9
4 changed files with 5 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
%turbo-frame#products-content{ refresh: "morph" }
%turbo-frame#products-content{ target: "_top", refresh: "morph" }
.spinner-overlay{ "data-controller": "loading", "data-products-target": "loading", class: "hidden" }
.spinner-container
.spinner

View File

@@ -1,4 +1,4 @@
= form_with url: admin_products_path, id: "filters", method: :get, data: { "search-target": "form" } do
= form_with url: admin_products_path, id: "filters", method: :get, data: { "search-target": "form", 'turbo-frame': "_self" } do
= hidden_field_tag :page, nil, class: "page"
= hidden_field_tag :per_page, nil, class: "per-page"

View File

@@ -4,7 +4,7 @@
= t(".pagination.total_html", total: pagy.count, from: pagy.from, to: pagy.to)
- if search_term.present? || producer_id.present? || category_id.present?
%a{ href: url_for(page: 1), class: "button disruptive" }
%a{ href: url_for(page: 1), class: "button disruptive", 'data-turbo-frame': "_self" }
= t(".pagination.clear_search")
%form.with-dropdown

View File

@@ -1,6 +1,7 @@
= form_with url: bulk_update_admin_products_path, method: :post, id: "products-form",
builder: BulkFormBuilder,
html: { data: { controller: "bulk-form",
html: { data: { 'turbo-frame': "_self",
controller: "bulk-form",
'bulk-form-disable-selector-value': "#sort,#filters",
'bulk-form-error-value': defined?(@error_counts),
} } do |form|