From 811bb04649365b0faaa00b1e0810bb101a4d19b1 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Fri, 26 Jun 2026 13:40:55 +0200 Subject: Stage 5 click-testing fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix link_to :method → button_to for all PUT/DELETE actions - Add button_to CSS reset to admin.css for visual consistency - Fix admin layout: replace broken jquery/jquery_ujs pipeline refs with admin_bundle via sprockets; add sprockets-rails, jquery-ui-rails gems - Add app/assets/javascripts/admin_bundle.js pipeline manifest - Fix event_information helper: use safe_join to avoid double-escaping - Fix nodes_helper: to_s(:db) → to_fs(:db) for event times - Fix revisions view: eliminate nested forms; diff button uses vanilla JS to collect radio button values before POST - Fix config/environments/development.rb and test.rb: cache_classes → enable_reloading - Add routing_filter_rails71_patch.rb version guard - Move LockedByAnotherUser to own file for Zeitwerk autoloading - Fix Globalize fallbacks via config.i18n.fallbacks in application.rb --- app/views/admin/_drafts.html.erb | 2 +- app/views/admin/_menu.html.erb | 2 +- app/views/assets/index.html.erb | 2 +- app/views/events/index.html.erb | 2 +- app/views/layouts/admin.html.erb | 5 ++--- app/views/menu_items/index.html.erb | 9 +++------ app/views/nodes/edit.html.erb | 2 +- app/views/occurrences/index.html.erb | 2 +- app/views/pages/index.html.erb | 2 +- app/views/revisions/index.html.erb | 38 ++++++++++++++++++++++++------------ app/views/users/_user.html.erb | 9 +++------ 11 files changed, 41 insertions(+), 34 deletions(-) (limited to 'app/views') diff --git a/app/views/admin/_drafts.html.erb b/app/views/admin/_drafts.html.erb index 2036d12..a35b0ab 100644 --- a/app/views/admin/_drafts.html.erb +++ b/app/views/admin/_drafts.html.erb @@ -17,7 +17,7 @@ <%= link_to 'Show', node_path(draft.node) %> <%= link_to "Revisions", revision_path(draft.node.id) %> - <%= link_to "Publish", publish_node_path(draft.node), :method => :put, :data => { :confirm => "Do you really want to publish?" } %> + <%= button_to "Publish", publish_node_path(draft.node), method: :put, form: { data: { confirm: "Do you really want to publish?" } } %> <% end %> diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index 3188d94..6f217eb 100644 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb @@ -1,5 +1,5 @@ <%= language_selector %> -<%= link_to 'Logout', logout_path, :method => :delete %> +<%= button_to 'Logout', logout_path, method: :delete %> <%= link_to 'Overview', admin_path %> <%= link_to 'Nodes', nodes_path, selected?('nodes') %> <%= link_to 'Assets', assets_path, selected?('assets') %> diff --git a/app/views/assets/index.html.erb b/app/views/assets/index.html.erb index e7ef313..83d55c2 100644 --- a/app/views/assets/index.html.erb +++ b/app/views/assets/index.html.erb @@ -15,7 +15,7 @@ <%= asset.upload.content_type %> <%= link_to 'Show', asset %> <%= link_to 'Edit', edit_asset_path(asset) %> - <%= link_to 'Destroy', asset, :data => { :confirm => 'Are you sure?' }, :method => :delete %> + <%= button_to 'Destroy', asset, method: :delete, form: { data: { confirm: 'Are you sure?' } } %> <% end %> diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb index 93c95fa..19b21ce 100644 --- a/app/views/events/index.html.erb +++ b/app/views/events/index.html.erb @@ -26,7 +26,7 @@ <%=h event.node_id %> <%= link_to 'Show', event %> <%= link_to 'Edit', edit_event_path(event) %> - <%= link_to 'Destroy', event, :data => { :confirm => 'Are you sure?' }, :method => :delete %> + <%= button_to 'Destroy', event, method: :delete, form: { data: { confirm: 'Are you sure?' } } %> <% end %> diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index e64850b..2a90786 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -7,14 +7,13 @@ <%= csrf_meta_tags %> <%= "#{params[:controller]} | #{params[:action]}" %> - <%= javascript_include_tag 'jquery', 'jquery_ujs' %> - <%= javascript_include_tag 'jquery-ui-1.7.2.custom.min' %> - <%= javascript_include_tag 'jquery.hotkeys' %> + <%= javascript_include_tag 'admin_bundle' %> <%= javascript_include_tag 'tiny_mce/jquery.tinymce.js' %> <%= javascript_tag "var AUTH_TOKEN = #{form_authenticity_token.inspect};" if protect_against_forgery? %> <%= stylesheet_link_tag 'admin' %> <%= javascript_include_tag 'admin_search.js' %> <%= javascript_include_tag 'admin_interface.js' %> + <%= stylesheet_link_tag 'admin' %> diff --git a/app/views/menu_items/index.html.erb b/app/views/menu_items/index.html.erb index 7d0ce62..c52c150 100644 --- a/app/views/menu_items/index.html.erb +++ b/app/views/menu_items/index.html.erb @@ -14,12 +14,9 @@ <%= menu_item.title %> <%= link_to "Edit", edit_menu_item_path(menu_item) %> - <%= link_to( - "Delete", - menu_item_path(menu_item), - :method => :delete, - :data => { :confirm => "Are you sure?" } - ) %> + <%= button_to "Delete", menu_item_path(menu_item), + method: :delete, + form: { data: { confirm: "Are you sure?" } } %> <% end %> diff --git a/app/views/nodes/edit.html.erb b/app/views/nodes/edit.html.erb index 64884cf..596f992 100644 --- a/app/views/nodes/edit.html.erb +++ b/app/views/nodes/edit.html.erb @@ -2,7 +2,7 @@ <%= link_to 'metadata', '#', :id => 'button', :class => "unselected" %> <%= link_to 'Show', @node %> <%= link_to 'Preview', preview_page_path(@draft) %> - <%= link_to 'Publish', publish_node_path, :method => :put, :data => { :confirm => "Publish this draft?" } %> + <%= button_to 'Publish', publish_node_path(@node), method: :put, form: { data: { confirm: "Publish this draft?" } } %> <%= link_to 'Revisions', node_revisions_path(@node) %> <% end %> diff --git a/app/views/occurrences/index.html.erb b/app/views/occurrences/index.html.erb index 7b8ffb8..0e99857 100644 --- a/app/views/occurrences/index.html.erb +++ b/app/views/occurrences/index.html.erb @@ -18,7 +18,7 @@ <%=h occurrence.event_id %> <%= link_to 'Show', occurrence %> <%= link_to 'Edit', edit_occurrence_path(occurrence) %> - <%= link_to 'Destroy', occurrence, :data => { :confirm => 'Are you sure?' }, :method => :delete %> + <%= button_to 'Destroy', occurrence, method: :delete, form: { data: { confirm: 'Are you sure?' } } %> <% end %> diff --git a/app/views/pages/index.html.erb b/app/views/pages/index.html.erb index 4b28c9b..91e5359 100644 --- a/app/views/pages/index.html.erb +++ b/app/views/pages/index.html.erb @@ -12,7 +12,7 @@ <%=h page.title %> <%= link_to 'Show', content_path(:page_path => page.node.unique_path) %> <%= link_to 'Edit', edit_page_path(page) %> - <%= link_to 'Destroy', page, :data => { :confirm => 'Are you sure?' }, :method => :delete %> + <%= button_to 'Destroy', page, method: :delete, form: { data: { confirm: 'Are you sure?' } } %> <% end %> diff --git a/app/views/revisions/index.html.erb b/app/views/revisions/index.html.erb index e038ed2..b875a4f 100644 --- a/app/views/revisions/index.html.erb +++ b/app/views/revisions/index.html.erb @@ -4,7 +4,6 @@

Revisions for Node: <%= @node.unique_name %>

-<%= form_tag diff_node_revisions_path(@node) do %> @@ -14,6 +13,7 @@ + <% (@pages || @node.pages.all).reverse.each do |page| %> @@ -23,22 +23,36 @@ + - <% end %> - +
FirstEditor Date
<%= page.title %> <%= page.editor.try(:login) %> <%= page.updated_at %><%= link_to 'show', node_revision_path(@node, page) %> - <%= link_to 'show', node_revision_path(@node, page) %> - - <%= link_to( - 'restore', - restore_node_revision_path(@node, page), - :method => :put, - :data => { :confirm => "Restore this revision?" } - ) %> + <%= button_to 'restore', restore_node_revision_path(@node, page), + method: :put, + form: { data: { confirm: "Restore this revision?" } } %>
<%= submit_tag 'Diff revisions' %> + <%= button_to 'Diff revisions', diff_node_revisions_path(@node), + method: :post, + form: { id: 'diff_form' } %> +
-<% end %> + diff --git a/app/views/users/_user.html.erb b/app/views/users/_user.html.erb index 9987e31..ddb7afd 100644 --- a/app/views/users/_user.html.erb +++ b/app/views/users/_user.html.erb @@ -7,12 +7,9 @@ <%= link_to "edit", edit_user_path(user) %> - <%= link_to( - "destroy", - user_path(user), - :method => :delete, - :data => { :confirm => "Do you really want to delete user #{user.login}?" } - ) %> + <%= button_to "destroy", user_path(user), + method: :delete, + form: { data: { confirm: "Do you really want to delete user #{user.login}?" } } %> <% end %> -- cgit v1.3