From 6df48c1413a14516e7ee8919f33fbc13f0141966 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sat, 1 Aug 2026 02:39:59 +0200 Subject: Show and extend the elevation window A banner appears while elevated, counting down in minutes and carrying extend and drop controls. Three extensions of 30 minutes are allowed, so the window is at most two hours without a fresh code; a code resets the budget. The countdown is advisory, the server-side check authoritative, so it says "expired" rather than vanishing. The post-login flash tells an admin the timer has started. --- config/locales/de.yml | 10 ++++++++++ config/locales/en.yml | 10 ++++++++++ config/routes.rb | 4 +++- 3 files changed, 23 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/locales/de.yml b/config/locales/de.yml index 7edffe2d..6b5c97cc 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -630,6 +630,9 @@ de: removed: "%{lang}-Übersetzung aus dem Entwurf entfernt. Veröffentlichen, um das dauerhaft zu machen." elevation: dropped: "Administrative Rechte abgelegt." + renewed: "Administrative Rechte um %{minutes} Minuten verlängert. Noch %{left} Verlängerungen möglich." + cannot_renew: "Verlängern nicht möglich. Rechte müssen mit einem aktuellen Code neu angefordert werden." + granted_at_login: "Angemeldet. Administrative Rechte gelten %{minutes} Minuten." assets: index: @@ -767,3 +770,10 @@ de: log_out: "Abmelden" social_meta: site_description: "Der Chaos Computer Club ist eine galaktische Gemeinschaft von Lebewesen für Informationsfreiheit und Technikfolgenabschätzung." + elevation_banner: + active: "Administrative Rechte aktiv, " + minutes_short: "noch %{count} Min." + less_than_a_minute: "weniger als 1 Min." + expired: "abgelaufen" + renew: "Verlängern" + drop: "Ablegen" diff --git a/config/locales/en.yml b/config/locales/en.yml index 9a8041bf..e4c7ecc4 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -589,6 +589,9 @@ en: removed: "%{lang} translation removed from the draft. Publish to make this permanent." elevation: dropped: "Administrative rights dropped." + renewed: "Administrative rights extended by %{minutes} minutes. %{left} extensions left." + cannot_renew: "Cannot extend. Request the rights again with a current code." + granted_at_login: "Signed in. Administrative rights last %{minutes} minutes." assets: index: @@ -710,3 +713,10 @@ en: log_out: "Log out" social_meta: site_description: "The Chaos Computer Club is a galactic community of life forms campaigning for freedom of information and the assessment of the impact of technology." + elevation_banner: + active: "Administrative rights active —" + minutes_short: "%{count} min left" + less_than_a_minute: "less than 1 min" + expired: "expired" + renew: "Extend" + drop: "Drop" diff --git a/config/routes.rb b/config/routes.rb index 4c37e70f..58e1e632 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -106,7 +106,9 @@ Cccms::Application.routes.draw do end resource :otp_enrollment, :only => [:show, :create, :update, :destroy] resource :otp_challenge, :only => [:new, :create] - resource :elevation, :only => [:new, :create, :destroy] + resource :elevation, :only => [:new, :create, :destroy] do + post :renew + end resources :menu_items, :except => :show do member do -- cgit v1.3