diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-13 16:36:38 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-13 16:36:38 +0200 |
| commit | 0b6ae26f3b4c3c8278e569fa6644a544e996c25d (patch) | |
| tree | 6c0e8dd23fa243e6bf7e6473aebae3f13ea20dea /public | |
| parent | e2705119ba718d40ff4f29c00027c2dfecef01ce (diff) | |
Add per-node translation management: list, edit, destroy, compare
Replaces the old locale-switch-and-edit-the-same-screen workflow,
which conflated presentation locale with content locale and let an
editor silently drift into editing the wrong language with no
persistent signal that anything had changed. Non-default-locale
content now has its own explicit routes and screens, never sharing
a route param with the ambient chrome locale.
- PageTranslationsController: index/show/edit/update/destroy,
scoped to Page.non_default_locales; update handles first-time
creation too, so there's no separate new/create step.
- Reads go through the actual PageTranslation row
(Page#translation_summary), never through the Globalize
fallback-bearing accessor -- fallback is correct for public
rendering but wrong for editing, where a missing translation
needs to look empty, not borrowed from another locale.
- Translations ride on the page's own draft/head cycle; no
independent publish state.
- nodes#show gains a Translations section (per-locale Lock+Edit /
Create+Lock, Destroy, a link into the read-only Compare view) and
a locale indicator on its own default-locale content; nodes#edit,
nodes#update, and nodes#autosave are pinned to the default locale
via Globalize.with_locale regardless of the ambient route locale.
- nodes#show no longer double-loads the node or calls wipe_draft!
on every view (see previous commit for why that's now safe).
- .preview_link_row is renamed .aligned_action_row now that it has
a second real consumer.
Diffstat (limited to 'public')
| -rw-r--r-- | public/stylesheets/admin.css | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/public/stylesheets/admin.css b/public/stylesheets/admin.css index c3c0cb4..f1f4c05 100644 --- a/public/stylesheets/admin.css +++ b/public/stylesheets/admin.css | |||
| @@ -637,6 +637,28 @@ table.revisions_table tr:hover { | |||
| 637 | margin: 0; | 637 | margin: 0; |
| 638 | } | 638 | } |
| 639 | 639 | ||
| 640 | /* ============================================================ | ||
| 641 | Translation compare view (page_translations#show) | ||
| 642 | ============================================================ */ | ||
| 643 | |||
| 644 | .translation_compare { | ||
| 645 | display: flex; | ||
| 646 | flex-direction: column; | ||
| 647 | gap: 1.5rem; | ||
| 648 | } | ||
| 649 | |||
| 650 | @media(min-width:1016px) { | ||
| 651 | .translation_compare { | ||
| 652 | flex-direction: row; | ||
| 653 | gap: 2rem; | ||
| 654 | } | ||
| 655 | |||
| 656 | .translation_compare_column { | ||
| 657 | flex: 1; | ||
| 658 | min-width: 0; | ||
| 659 | } | ||
| 660 | } | ||
| 661 | |||
| 640 | table.user_table td.user_login { | 662 | table.user_table td.user_login { |
| 641 | padding-right: 30px; | 663 | padding-right: 30px; |
| 642 | } | 664 | } |
| @@ -834,14 +856,15 @@ form.button_to button[type="submit"] { | |||
| 834 | font-weight: bold; | 856 | font-weight: bold; |
| 835 | } | 857 | } |
| 836 | 858 | ||
| 837 | .preview_link_row { | 859 | .aligned_action_row { |
| 838 | display: flex; | 860 | display: flex; |
| 839 | flex-wrap: wrap; | 861 | flex-wrap: wrap; |
| 840 | align-items: start; | 862 | align-items: start; |
| 841 | gap: 0.5rem; | 863 | gap: 0.5rem; |
| 842 | } | 864 | } |
| 843 | 865 | ||
| 844 | .preview_link_row form.button_to { | 866 | .aligned_action_row .action_button, |
| 867 | .aligned_action_row form.button_to { | ||
| 845 | margin-top: -5px; | 868 | margin-top: -5px; |
| 846 | } | 869 | } |
| 847 | 870 | ||
