diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-06-26 13:40:55 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-06-26 13:40:55 +0200 |
| commit | 811bb04649365b0faaa00b1e0810bb101a4d19b1 (patch) | |
| tree | 581d52faa6e1bf21a1cdfd4da7127a0f95786bad /app/views/revisions | |
| parent | a1ddc25da0d2aa79a4d9216ef7792f26233bd38e (diff) | |
Stage 5 click-testing fixes
- 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
Diffstat (limited to 'app/views/revisions')
| -rw-r--r-- | app/views/revisions/index.html.erb | 38 |
1 files changed, 26 insertions, 12 deletions
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 @@ | |||
| 4 | 4 | ||
| 5 | <h2>Revisions for Node: <%= @node.unique_name %></h2> | 5 | <h2>Revisions for Node: <%= @node.unique_name %></h2> |
| 6 | 6 | ||
| 7 | <%= form_tag diff_node_revisions_path(@node) do %> | ||
| 8 | <table id="revisions"> | 7 | <table id="revisions"> |
| 9 | <tr class="header"> | 8 | <tr class="header"> |
| 10 | <th>First</th> | 9 | <th>First</th> |
| @@ -14,6 +13,7 @@ | |||
| 14 | <th>Editor</th> | 13 | <th>Editor</th> |
| 15 | <th>Date</th> | 14 | <th>Date</th> |
| 16 | <th></th> | 15 | <th></th> |
| 16 | <th></th> | ||
| 17 | </tr> | 17 | </tr> |
| 18 | <% (@pages || @node.pages.all).reverse.each do |page| %> | 18 | <% (@pages || @node.pages.all).reverse.each do |page| %> |
| 19 | <tr> | 19 | <tr> |
| @@ -23,22 +23,36 @@ | |||
| 23 | <td class="title"><%= page.title %></td> | 23 | <td class="title"><%= page.title %></td> |
| 24 | <td class="user"><%= page.editor.try(:login) %></td> | 24 | <td class="user"><%= page.editor.try(:login) %></td> |
| 25 | <td class="date"><%= page.updated_at %></td> | 25 | <td class="date"><%= page.updated_at %></td> |
| 26 | <td><%= link_to 'show', node_revision_path(@node, page) %></td> | ||
| 26 | <td> | 27 | <td> |
| 27 | <%= link_to 'show', node_revision_path(@node, page) %> | 28 | <%= button_to 'restore', restore_node_revision_path(@node, page), |
| 28 | </td> | 29 | method: :put, |
| 29 | <td> | 30 | form: { data: { confirm: "Restore this revision?" } } %> |
| 30 | <%= link_to( | ||
| 31 | 'restore', | ||
| 32 | restore_node_revision_path(@node, page), | ||
| 33 | :method => :put, | ||
| 34 | :data => { :confirm => "Restore this revision?" } | ||
| 35 | ) %> | ||
| 36 | </td> | 31 | </td> |
| 37 | </tr> | 32 | </tr> |
| 38 | <% end %> | 33 | <% end %> |
| 39 | <tr class="no_hover"> | 34 | <tr class="no_hover"> |
| 40 | <td colspan="8" class="right"><%= submit_tag 'Diff revisions' %></td> | 35 | <td colspan="8" class="right"> |
| 36 | <%= button_to 'Diff revisions', diff_node_revisions_path(@node), | ||
| 37 | method: :post, | ||
| 38 | form: { id: 'diff_form' } %> | ||
| 39 | </td> | ||
| 41 | </tr> | 40 | </tr> |
| 42 | </table> | 41 | </table> |
| 43 | 42 | ||
| 44 | <% end %> | 43 | <script> |
| 44 | document.getElementById('diff_form').addEventListener('submit', function(e) { | ||
| 45 | var start = document.querySelector('input[name="start_revision"]:checked'); | ||
| 46 | var end = document.querySelector('input[name="end_revision"]:checked'); | ||
| 47 | if (start) { | ||
| 48 | var s = document.createElement('input'); | ||
| 49 | s.type = 'hidden'; s.name = 'start_revision'; s.value = start.value; | ||
| 50 | this.appendChild(s); | ||
| 51 | } | ||
| 52 | if (end) { | ||
| 53 | var en = document.createElement('input'); | ||
| 54 | en.type = 'hidden'; en.name = 'end_revision'; en.value = end.value; | ||
| 55 | this.appendChild(en); | ||
| 56 | } | ||
| 57 | }); | ||
| 58 | </script> | ||
