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. --- app/controllers/elevations_controller.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'app/controllers/elevations_controller.rb') diff --git a/app/controllers/elevations_controller.rb b/app/controllers/elevations_controller.rb index 804b8f95..229f33d8 100644 --- a/app/controllers/elevations_controller.rb +++ b/app/controllers/elevations_controller.rb @@ -41,4 +41,15 @@ class ElevationsController < ApplicationController flash[:notice] = t("flash.elevation.dropped") redirect_to admin_path end + + def renew + if renew_elevation! + flash[:notice] = t("flash.elevation.renewed", + :minutes => AuthenticatedSystem::ELEVATION_MAX_AGE.in_minutes.to_i, + :left => elevation_extensions_left) + else + flash[:error] = t("flash.elevation.cannot_renew") + end + redirect_back(:fallback_location => admin_path, :allow_other_host => false) + end end -- cgit v1.3