From fd1ef782f7fc85db740fcb2ac1f859725e7280c5 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Thu, 30 Jul 2026 23:22:47 +0200 Subject: Provide the full i18n matrix for public/admin-preview/shared-preview urls --- app/views/nodes/show.html.erb | 100 ++++++++++++++++++++++---- config/locales/de.yml | 2 + config/locales/en.yml | 2 + public/stylesheets/admin.css | 163 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 253 insertions(+), 14 deletions(-) diff --git a/app/views/nodes/show.html.erb b/app/views/nodes/show.html.erb index a337b555..8b12e2eb 100644 --- a/app/views/nodes/show.html.erb +++ b/app/views/nodes/show.html.erb @@ -194,25 +194,97 @@
<%= t(".links") %>
-
-
- <%= t(".public") %> - <%= link_to @page.public_link, content_url(@node.unique_path) %> + <% + # Public addresses come from the head, previews from the draft, and + # those sets differ routinely -- a German head with a freshly + # translated English draft has one public address and two preview + # ones. Columns are the union; a kind with no address in a locale + # leaves that cell empty. + available = I18n.available_locales - [:root] + head_locales = (@node.head&.translated_locales || []).map(&:to_sym) & available + draft_locales = (@node.draft&.translated_locales || []).map(&:to_sym) & available + link_locales = (head_locales | draft_locales) + link_locales = [I18n.default_locale] if link_locales.empty? + link_locales = [I18n.default_locale] + (link_locales - [I18n.default_locale]).sort + locale_param = ->(locale) { locale unless locale == I18n.default_locale } + %> + +