You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2020/07/01 14:18:22 UTC

[whimsy] branch master updated: Cater for multiple categories

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 d37126c  Cater for multiple categories
d37126c is described below

commit d37126cdaf21e3ad9fd586cc101ec824ba8e654c
Author: Sebb <se...@apache.org>
AuthorDate: Wed Jul 1 15:18:13 2020 +0100

    Cater for multiple categories
    
    Also sort categories
---
 www/committers/tools.cgi | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/www/committers/tools.cgi b/www/committers/tools.cgi
index 9384827..943ed84 100755
--- a/www/committers/tools.cgi
+++ b/www/committers/tools.cgi
@@ -40,15 +40,17 @@ _html do
     ) do
       scan = get_annotated_scan("../#{SCANDIR}")
       scan.merge!(NONCGIS)
-      scan_by = scan.group_by{ |k, v| v[1][0] }
+      scan_by = Hash.new{|h,k| h[k]=Array.new}
+      # Create array entry for each category
+      scan.each{ |k,v| v[1].each {|l| scan_by[l] << [k,v]}}
       _ul.list_inline do
-        scan_by.each do |cat, l|
+        scan_by.sort.each do |cat, l|
           _li do
             _a "#{cat.capitalize}", href: "##{cat}"
           end
         end
       end
-      scan_by.each do | category, links |
+      scan_by.sort.each do | category, links |
         _ul.list_group do
           _li.list_group_item.active do
             _span category.capitalize, id: category