diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-13 17:09:31 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-13 17:09:31 +0200 |
| commit | aa14587b052a0aa7884aaf27183981975168ab14 (patch) | |
| tree | 2b043061a06474929bbfb9fe79a7985267ccef17 /app/views | |
| parent | 0b6ae26f3b4c3c8278e569fa6644a544e996c25d (diff) | |
Wire real autosave into translation editing
The shared TinyMCE setup initializes cccms.setup_autosave() on any
page with a textarea.with_editor, unconditionally starting a
7-second interval that submits to the form's data-autosave-url --
which the translation edit form never set, so the interval PUT the
current page URL itself and 404'd on a nonexistent route.
Fixed by actually giving it something to talk to, rather than
suppressing it: a real autosave endpoint, and update now goes
through Node#autosave!/#save_draft! -- the same pipeline the
primary editor uses, fixed earlier this session for exactly this
kind of cross-locale carryover. This was the autosave-buffer parity
already flagged as due after the proof of concept; the shared JS
just forced the timing.
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/page_translations/edit.html.erb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/views/page_translations/edit.html.erb b/app/views/page_translations/edit.html.erb index 7371a42..89b594e 100644 --- a/app/views/page_translations/edit.html.erb +++ b/app/views/page_translations/edit.html.erb | |||
| @@ -18,7 +18,8 @@ | |||
| 18 | </div> | 18 | </div> |
| 19 | 19 | ||
| 20 | <div id="page_editor"> | 20 | <div id="page_editor"> |
| 21 | <%= form_with url: node_translation_path(@node, @locale), method: :patch, local: true, id: "translation_edit_form" do |f| %> | 21 | <%= form_with url: node_translation_path(@node, @locale), method: :patch, local: true, id: "translation_edit_form", |
| 22 | data: { autosave_url: autosave_node_translation_path(@node, @locale), show_url: node_path(@node) } do |f| %> | ||
| 22 | <div id="content"> | 23 | <div id="content"> |
| 23 | <div class="node_description">Title</div> | 24 | <div class="node_description">Title</div> |
| 24 | <div class="node_content"> | 25 | <div class="node_content"> |
