You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by cu...@apache.org on 2017/04/14 11:12:32 UTC

[whimsy] branch master updated: Add style and useful sorting

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  849db5c   Add style and useful sorting
849db5c is described below

commit 849db5cd7f28808d9c0571502581ce4a1e454056
Author: Shane Curcuru <as...@shanecurcuru.org>
AuthorDate: Fri Apr 14 07:12:28 2017 -0400

    Add style and useful sorting
---
 www/members/namediff.cgi | 102 +++++++++++++++++++++++++++--------------------
 1 file changed, 59 insertions(+), 43 deletions(-)

diff --git a/www/members/namediff.cgi b/www/members/namediff.cgi
index c98d1d7..5095994 100755
--- a/www/members/namediff.cgi
+++ b/www/members/namediff.cgi
@@ -3,55 +3,71 @@ $LOAD_PATH.unshift File.realpath(File.expand_path('../../../lib', __FILE__))
 
 require 'whimsy/asf'
 require 'wunderbar/bootstrap'
-
-people = ASF::ICLA.preload
-ldap_members = ASF::Member.list.map {|id, info| ASF::Person.find(id)}
-names = ASF::Person.preload('cn', ldap_members)
+require 'wunderbar/jquery/stupidtable'
 
 _html do
-  _h1 'ASF Member name differences'
-
-  # common banner
-  _a_ href: 'https://whimsy.apache.org/' do
-    _img title: "ASF Logo", alt: "ASF Logo",
-      src: "https://www.apache.org/img/asf_logo.png"
-  end
-
-  _p_ "Cross-check of members.txt vs iclas.txt"
-
-  _table.table.table_hover do
-    _thead do
-      _tr do
-        _th 'availid'
-        _th 'name from members.txt'
-        _th 'public name'
-        _th 'legal name (if different)'
+  _body? do
+    _whimsy_header 'ASF Member name differences'
+    _whimsy_content do
+      _p_ do
+        _ 'Cross-check of members.txt vs iclas.txt.'
+        _span.text_danger 'REMINDER: members.txt and Legal names below are NOT public data - keep confidential!'
       end
-    end
-
-    ASF::Member.list.sort.each do |id, info|
-      person = ASF::Person.find(id)
-
-      if person.icla
-        next if person.icla.name == info[:name]
-        next if person.icla.legal_name == info[:name]
-        _tr_ do
-          _td id
-          _td info[:name]
-          _td person.icla.name
-          if person.icla.name != person.icla.legal_name
-            _td person.icla.legal_name
-          else
-            _td
+      
+      ASF::ICLA.preload
+      ldap_members = ASF::Member.list.map {|id, info| ASF::Person.find(id)}
+      ASF::Person.preload('cn', ldap_members)
+      
+      _table.table.table_hover do
+        _thead do
+          _tr do
+            _th 'availid', data_sort: 'string'
+            _th data_sort: 'string' do
+              _span.text_danger 'Name from members.txt'
+            end
+            _th 'Public name', data_sort: 'string'
+            _th data_sort: 'string', data_sort_default: 'desc' do
+              _span.text_danger 'Legal name (if different)'
+            end
           end
         end
-      elsif ldap_members.include? person
-        _tr_ do
-          _td id
-          _td info[:name]
-          _td.bg_danger 'ICLA not on file', colspan: 2
+        
+        ASF::Member.list.sort.each do |id, info|
+          person = ASF::Person.find(id)
+          
+          if person.icla
+            next if person.icla.name == info[:name]
+            next if person.icla.legal_name == info[:name]
+            _tr_ do
+              _td id
+              _td info[:name]
+              _td person.icla.name
+              if person.icla.name != person.icla.legal_name
+                _td person.icla.legal_name
+              else
+                _td
+              end
+            end
+          elsif ldap_members.include? person
+            _tr_ do
+              _td id
+              _td info[:name]
+              _td.bg_danger 'ICLA not on file', colspan: 2, data_sort_value: ''
+            end
+          end
         end
       end
+      
+      _script %{
+        var table = $(".table").stupidtable();
+        table.on("aftertablesort", function (event, data) {
+          var th = $(this).find("th");
+          th.find(".arrow").remove();
+          var dir = $.fn.stupidtable.dir;
+          var arrow = data.direction === dir.ASC ? "&uarr;" : "&darr;";
+          th.eq(data.column).append('<span class="arrow">' + arrow +'</span>');
+          });
+        }
     end
   end
-end
+end
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].