Skip to content

Commit

Permalink
Fix confirm popups
Browse files Browse the repository at this point in the history
  • Loading branch information
johnf committed Nov 21, 2024
1 parent caf0529 commit 1edf79a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app/views/collections/bulk_edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

= render 'search_results'

= form_for @collection, :url => bulk_update_collections_path, :method => :patch do |f|
= form_for @collection, url: bulk_update_collections_path, method: :patch, data: { turbo: true, 'turbo-confirm': "This will update #{@search.length} collections - are you sure?" } do |f|
- if @collection.errors.any?
#error_explanation
%h2== #{pluralize(@collection.errors.count, 'error')} prohibited this post from being saved:
Expand All @@ -20,10 +20,10 @@
= hidden_field_tag :original_search_params, @params.to_h.to_a.map {|p| "#{p[0]}=#{p[1]}" }.join('&')

.right
= f.submit "Update #{@search.length} Collections", :confirm => "This will update #{@search.length} collections - are you sure?"
= f.submit "Update #{@search.length} Collections"

= render :partial => 'form', :locals => {:f => f}

.right
= f.submit "Update #{@search.length} Collections", :confirm => "This will update #{@search.length} collections - are you sure?"
= f.submit "Update #{@search.length} Collections"

6 changes: 3 additions & 3 deletions app/views/items/bulk_edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

= render partial: 'search_results', locals: {show_exclusions: true}

= form_for @item, :url => bulk_update_items_path, :method => :patch do |f|
= form_for @item, url: bulk_update_items_path, method: :patch, data: { turbo: true, 'turbo-confirm': "This will update #{@search.length} items - are you sure?" } do |f|
- if @item.errors.any?
#error_explanation
%h2== #{pluralize(@item.errors.count, 'error')} prohibited this post from being saved:
Expand All @@ -20,10 +20,10 @@
= hidden_field_tag :original_search_params, @params.to_h.to_a.map {|p| "#{p[0]}=#{p[1]}" }.join('&')

.right
= f.submit "Update #{@search.length} Items", :confirm => "This will update #{@search.length} items - are you sure?"
= f.submit "Update #{@search.length} Items"

= render :partial => 'items/form', :locals => {:f => f}

.right
= f.submit "Update #{@search.length} Items", :confirm => "This will update #{@search.length} items - are you sure?"
= f.submit "Update #{@search.length} Items"

0 comments on commit 1edf79a

Please sign in to comment.