This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 7c82ae7d Use new banner method
7c82ae7d is described below

commit 7c82ae7dede9305aac0b7d864bcbb7130966f2a5
Author: Sebb <[email protected]>
AuthorDate: Thu Oct 3 12:15:31 2024 +0100

    Use new banner method
---
 www/secretary/workbench/views/index.html.rb | 15 ++++++++-------
 www/secretary/workbench/views/parts.html.rb | 15 ++++++++-------
 2 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/www/secretary/workbench/views/index.html.rb 
b/www/secretary/workbench/views/index.html.rb
index 91ea00c1..00bdd689 100644
--- a/www/secretary/workbench/views/index.html.rb
+++ b/www/secretary/workbench/views/index.html.rb
@@ -7,8 +7,7 @@ _html do
     _base href: _.env['REQUEST_URI']
   end
 
-  unavailable = Status.updates_disallowed_reason # are updates disallowed?
-  noticetext, noticepath = Status.notice
+  banner = Status.banner
 
   _title 'ASF Secretary Mail'
   _link rel: 'stylesheet', type: 'text/css', href: "secmail.css?#{@cssmtime}"
@@ -16,11 +15,13 @@ _html do
   _header_ do
     _h1.bg_success do
       _a 'ASF Secretary Mail', href: '.'
-      if unavailable
-        _span.small unavailable
-      elsif noticetext
-        _span.small do
-          _a noticetext, href: noticepath
+      if banner
+        if banner[:href]
+          _span.small do
+            _a banner[:msg], href: banner[:href]
+          end
+        else
+          _span.small banner[:msg]
         end
       end
     end
diff --git a/www/secretary/workbench/views/parts.html.rb 
b/www/secretary/workbench/views/parts.html.rb
index f39a99db..0659f2be 100644
--- a/www/secretary/workbench/views/parts.html.rb
+++ b/www/secretary/workbench/views/parts.html.rb
@@ -8,17 +8,18 @@ _html do
   _link rel: 'stylesheet', type: 'text/css',
     href: "../../secmail.css?#{@cssmtime}"
 
-  unavailable = Status.updates_disallowed_reason # are updates disallowed?
-  noticetext, noticepath = Status.notice
+  banner = Status.banner
 
   _header_ do
     _h3.bg_success do
       _a 'ASF Secretary Mail', href: '../..', target: '_parent'
-      if unavailable
-        _span.small unavailable
-      elsif noticetext
-        _span.small do
-          _a noticetext, href: noticepath
+      if banner
+        if banner[:href]
+          _span.small do
+            _a banner[:msg], href: banner[:href]
+          end
+        else
+          _span.small banner[:msg]
         end
       end
     end

Reply via email to