whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From curc...@apache.org
Subject [whimsy] branch master updated: Factor out common emit_authmap code
Date Tue, 21 May 2019 19:24:16 GMT
This is an automated email from the ASF dual-hosted git repository.

curcuru 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 1a4e099  Factor out common emit_authmap code
1a4e099 is described below

commit 1a4e099ecd9862eb4e9ce79ee080d0aebe1d5ea1
Author: Shane Curcuru <asf@shanecurcuru.org>
AuthorDate: Tue May 21 15:24:07 2019 -0400

    Factor out common emit_authmap code
---
 tools/wwwdocs.rb         | 16 ++++++++++++++++
 www/committers/tools.cgi | 13 +------------
 2 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/tools/wwwdocs.rb b/tools/wwwdocs.rb
index 79a3b09..9036739 100755
--- a/tools/wwwdocs.rb
+++ b/tools/wwwdocs.rb
@@ -3,6 +3,7 @@
 #   Docs: for WVisible PAGETITLE and categories in .cgi
 #   Repos: for ASF::SVN access in .cgi|rb
 $LOAD_PATH.unshift '/srv/whimsy/lib'
+require 'wunderbar'
 require 'whimsy/asf'
 SCANDIR = "../www"
 ISERR = '!'
@@ -18,6 +19,21 @@ IS_PRIVATE = /\A(private|infra\/infrastructure)/
 ASFSVN = 'ASF::SVN'
 SCANDIRSVN = "../"
 
+# Output ul of key of AUTHMAP for use in helpblock
+def emit_authmap
+  _ul do
+    _li do
+      _span.glyphicon :aria_hidden, class: "#{AUTHPUBLIC}"
+      _ 'Publicly available'
+    end
+    AUTHMAP.each do |realm, style|
+      _li do
+        _span.glyphicon.glyphicon_lock :aria_hidden, class: "#{style}", aria_label: "#{realm}"
+        _ "#{realm}"
+      end
+    end
+  end
+end
 # Return [PAGETITLE, [cat,egories] ] after WVisible; or same as !Bogosity error
 def scan_file(f)
   begin
diff --git a/www/committers/tools.cgi b/www/committers/tools.cgi
index 093f428..246e404 100755
--- a/www/committers/tools.cgi
+++ b/www/committers/tools.cgi
@@ -35,18 +35,7 @@ _html do
           _em 'partial'
           _ ' listing of tools that Whimsy provides.'
         end
-        _ul do
-          _li do
-            _span.glyphicon :aria_hidden, class: "#{AUTHPUBLIC}"
-            _ 'Publicly available'
-          end
-          AUTHMAP.each do |realm, style|
-            _li do
-              _span.glyphicon.glyphicon_lock :aria_hidden, class: "#{style}", aria_label:
"#{realm}"
-              _ "#{realm}"
-            end
-          end
-        end
+        emit_authmap
       }
     ) do
       scan = get_annotated_scan("../#{SCANDIR}")


Mime
View raw message