summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-14 00:11:45 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-14 00:11:45 +0200
commita18a170f791769691fe905cfe76d103b7a345e87 (patch)
tree9991f49f7d3459b16237a9cf10b25cecfdc7befe
parent8eab68f2c5a3c126e2fec2ecdfa7ace87ce0937b (diff)
Re-add language selector, but fix the mis-nomer for english pages
-rw-r--r--app/helpers/admin_helper.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb
index afed245..6c3cbc6 100644
--- a/app/helpers/admin_helper.rb
+++ b/app/helpers/admin_helper.rb
@@ -1,4 +1,13 @@
1module AdminHelper 1module AdminHelper
2 def language_selector
3 case I18n.locale
4 when :de
5 link_to raw('<span class="inactive">English</span>'), url_for(params.permit(:locale, :page_path).to_h.merge('locale' => 'en'))
6 when :en
7 link_to raw('<span class="inactive">Deutsch</span>'), url_for(params.permit(:locale, :page_path).to_h.merge('locale' => 'de'))
8 end
9 end
10
2 def mtime_busted_path(path) 11 def mtime_busted_path(path)
3 file = Rails.public_path.join(path.sub(%r{\A/}, "")) 12 file = Rails.public_path.join(path.sub(%r{\A/}, ""))
4 raise "Static asset not found for cache-busting: #{path} (looked for #{file})" unless File.exist?(file) 13 raise "Static asset not found for cache-busting: #{path} (looked for #{file})" unless File.exist?(file)