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 2019/01/29 22:33:20 UTC

[whimsy] branch master updated: Add alpha jump links as page is quite long

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 7731c1f  Add alpha jump links as page is quite long
7731c1f is described below

commit 7731c1ff1b606cd4129434558bed62f490aebcea
Author: Sebb <se...@apache.org>
AuthorDate: Tue Jan 29 22:33:11 2019 +0000

    Add alpha jump links as page is quite long
---
 www/roster/views/committees.html.rb | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/www/roster/views/committees.html.rb b/www/roster/views/committees.html.rb
index 9ec6bb7..d451e6f 100644
--- a/www/roster/views/committees.html.rb
+++ b/www/roster/views/committees.html.rb
@@ -19,7 +19,13 @@ _html do
         _ 'are listed privately.'
       end
     end
-    _p 'Click on column names to sort.'
+    _p do
+      _ 'Click on column names to sort.'
+      _{"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"}
+      "ABCDEFGHIJKLMNOPQRSTUVWXYZ".each_char do |c|
+        _a c, href: "committee/##{c}"
+      end
+    end
 
     _table.table.table_hover do
       _thead do
@@ -30,10 +36,17 @@ _html do
         end
       end
 
+      prev_letter=nil
       @committees.sort_by {|pmc| pmc.display_name.downcase}.each do |pmc|
+        letter = pmc.display_name.upcase[0]
         _tr_ do
           _td do
-            _a pmc.display_name, href: "committee/#{pmc.name}"
+            if letter != prev_letter
+              _a pmc.display_name, href: "committee/#{pmc.name}", id: letter
+            else
+              _a pmc.display_name, href: "committee/#{pmc.name}"
+            end
+            prev_letter = letter
           end
 
           _td do