You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by Sam Ruby <ru...@apache.org> on 2016/02/27 11:27:11 UTC

[whimsy.git] [1/1] Commit 50ede3f: split committee groups from other groups

Commit 50ede3f901b0ac5c594bc5ed78b4adbcb43a9a83:
    split committee groups from other groups


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

------------------------------------------------------------
www/roster/models/committer.rb                               | +++++++++ -
www/roster/views/committer.js.rb                             | ++++++++ ----
------------------------------------------------------------
64 changes: 47 additions, 17 deletions.
------------------------------------------------------------


diff --git a/www/roster/models/committer.rb b/www/roster/models/committer.rb
index c8d7814..ca7e8a6 100644
--- a/www/roster/models/committer.rb
+++ b/www/roster/models/committer.rb
@@ -30,10 +30,25 @@ def self.serialize(id, env)
 
     response[:urls] = person.urls unless person.urls.empty?
 
-    response[:groups] = person.groups.map(&:name)
-
     response[:committees] = person.committees.map(&:name)
 
+    response[:groups] = []
+    response[:committer] = []
+    committees = ASF::Committee.list.map(&:id)
+    person.groups.map(&:name).each do |group|
+      if committees.include? group
+        unless response[:committees].include? group
+          response[:committer] << group 
+        end
+      else
+        response[:groups] << group
+      end
+    end
+
+    response[:committees].sort!
+    response[:groups].sort!
+    response[:committer].sort!
+
     if ASF::Person.find(env.user).asf_member?
       member = {}
 
diff --git a/www/roster/views/committer.js.rb b/www/roster/views/committer.js.rb
index 74ddb68..84aac3b 100644
--- a/www/roster/views/committer.js.rb
+++ b/www/roster/views/committer.js.rb
@@ -38,23 +38,38 @@ def render
         end
       end
 
-      _tr do
-        _td 'Committees'
-        _td do
-          _ul @@committer.committees do |pmc|
-            _li {_a pmc, href: "committee/#{pmc}"}
-          end
-        end
+      unless @@committer.committees.empty?
+	_tr do
+	  _td 'Committees'
+	  _td do
+	    _ul @@committer.committees do |pmc|
+	      _li {_a pmc, href: "committee/#{pmc}"}
+	    end
+	  end
+	end
       end
 
-      _tr do
-        _td 'Groups'
-        _td do
-          _ul @@committer.groups do |pmc|
-            next if @@committer.committees.include? pmc
-            _li {_a pmc, href: "committee/#{pmc}"}
-          end
-        end
+      unless @@committer.committer.empty?
+	_tr do
+	  _td 'Committer'
+	  _td do
+	    _ul @@committer.committer do |pmc|
+	      _li {_a pmc, href: "committee/#{pmc}"}
+	    end
+	  end
+	end
+      end
+
+      if false # not ready yet
+	_tr do
+	  _td 'Groups'
+	  _td do
+	    _ul @@committer.groups do |pmc|
+	      next if @@committer.committees.include? pmc
+	      _li {_a pmc, href: "committee/#{pmc}"}
+	    end
+	  end
+	end
       end
 
       if @@committer.member