whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Ruby <ru...@apache.org>
Subject [whimsy.git] [1/1] Commit dd84aac: members list
Date Tue, 16 Feb 2016 17:18:55 GMT
Commit dd84aaccf95a616343adf0ffd454a941e0b21a9c:
    members list


Branch: refs/heads/master
Author: Sam Ruby <rubys@intertwingly.net>
Committer: Sam Ruby <rubys@intertwingly.net>
Pusher: rubys <rubys@apache.org>

------------------------------------------------------------
lib/whimsy/asf/member.rb                                     | ++++ -
www/roster/main.rb                                           | ++++++++++ 
www/roster/public/stylesheets/app.css                        | + 
www/roster/views/index.html.rb                               | ++++++++ -
www/roster/views/members.html.rb                             | ++++++++++++ 
------------------------------------------------------------
125 changes: 123 additions, 2 deletions.
------------------------------------------------------------


diff --git a/lib/whimsy/asf/member.rb b/lib/whimsy/asf/member.rb
index 49615aa..52c3911 100644
--- a/lib/whimsy/asf/member.rb
+++ b/lib/whimsy/asf/member.rb
@@ -15,7 +15,10 @@ def self.each(&block)
     end
 
     def self.list
-      result = Hash[self.new(true).map {|name, text| [name, {text: text}]}]
+      result = Hash[self.new(true).map {|id, text| 
+        [id, {text: text, name: text[/(.*?)\s*(\(|\/\*|$)/, 1]}]
+      }]
+
       self.status.each do |name, value|
         result[name]['status'] = value
       end
diff --git a/www/roster/main.rb b/www/roster/main.rb
index 747f11c..5324d75 100755
--- a/www/roster/main.rb
+++ b/www/roster/main.rb
@@ -19,6 +19,7 @@
 get '/' do
   @committers = ASF::Person.list
   @committees = ASF::Committee.list
+  @members = ASF::Member.list.keys - ASF::Member.status.keys
   _html :index
 end
 
@@ -64,6 +65,15 @@
   _html :committer
 end
 
+# member list
+get '/members' do
+  _html :members
+end
+
+get '/members.json' do
+  _json Hash[ASF.members.map {|person| [person.id, person.public_name]}.sort]
+end
+
 # posted actions
 post '/actions/:file' do
   _json :"actions/#{params[:file]}"
diff --git a/www/roster/public/stylesheets/app.css b/www/roster/public/stylesheets/app.css
index 51c69b9..ac6eff6 100644
--- a/www/roster/public/stylesheets/app.css
+++ b/www/roster/public/stylesheets/app.css
@@ -6,6 +6,7 @@ h4 {margin-left: 1em}
 table ul {margin: 0; padding: 0; list-style: none}
 table {border-spacing: 0}
 table.wide {border-spacing: 0 1em}
+.counts td:first-child {text-align: right}
 .wide td:first-child {text-align: right; padding: 0}
 .wide td:first-child:after {content: ' —'}
 .wide td:last-child {border-left: solid 1px #000; padding: 0 0.5em}
diff --git a/www/roster/views/index.html.rb b/www/roster/views/index.html.rb
index 0db89bd..2a8b308 100644
--- a/www/roster/views/index.html.rb
+++ b/www/roster/views/index.html.rb
@@ -12,7 +12,7 @@
 
   _h1_ 'Roster'
 
-  _table do
+  _table.counts do
 
     ### committers
 
@@ -28,6 +28,20 @@
       _td 'Search for committers by name, user id, or email address'
     end
 
+    ### members
+
+    _tr do
+      _td do
+        _a @members.length, href: 'members'
+      end
+
+      _td do
+        _a 'Members', href: 'members'
+      end
+
+      _td 'Active ASF members'
+    end
+
     ### PMCs
 
     _tr do
diff --git a/www/roster/views/members.html.rb b/www/roster/views/members.html.rb
new file mode 100644
index 0000000..57e0f7e
--- /dev/null
+++ b/www/roster/views/members.html.rb
@@ -0,0 +1,93 @@
+#
+# A single committer
+#
+
+_html do
+  _base href: '..'
+  _title 'ASF Member list'
+  _link rel: 'stylesheet', href: 'stylesheets/app.css'
+
+  _banner breadcrumbs: {
+    roster: '.',
+    members: 'members'
+  }
+
+  members = ASF::Member.list.dup
+
+  # ********************************************************************
+  # *                             Summary                              *
+  # ********************************************************************
+
+  _h1 'Summary'
+
+  summary = ASF::Member.status
+
+  _table.counts do
+    _tr do
+      _td((members.keys - summary.keys).length)
+      _td 'Active members'
+    end
+
+    summary.group_by(&:last).each do |category, list|
+      _tr do
+        _td list.count
+        _td category + 's'
+      end
+    end
+  end
+
+  # ********************************************************************
+  # *                         Merge LDAP info                          *
+  # ********************************************************************
+
+  # merge ldap info, preferring public names over name listed in members.txt
+  ldap = ASF.members
+  preload = ASF::Person.preload('cn', ldap)
+
+  ldap.each do |person|
+    if members[person.id]
+      members[person.id][:name] = person.cn
+    else
+      members[person.id] = {name: person.cn, issue: 'not in members.txt'}
+    end
+  end
+
+  # ********************************************************************
+  # *                          Complete list                           *
+  # ********************************************************************
+
+  _h1 'Members'
+
+  _table.table.table_hover do
+    _thead do
+      _tr do
+        _th 'id'
+        _th 'public name'
+        _th 'status'
+      end
+    end
+
+    members.sort_by {|id, info| info[:name]}.each do |id, info|
+      _tr_ do
+        _td! do
+          if ldap.include? ASF::Person.find(id)
+            _b {_a id, href: "committer/#{id}"}
+          else
+            _a id, href: "committer/#{id}"
+            
+            info[:issue] ||= 'Not in LDAP' if not info['status']
+          end
+        end
+
+        _td info[:name]
+
+        if info[:issue]
+          _td.issue info[:issue]
+        elsif
+          _td info['status']
+        end
+      end
+    end
+  end
+
+end

Mime
View raw message