whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: make Project.list like the other *.list methods
Date Wed, 17 May 2017 12:55:39 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys 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  0681012   make Project.list like the other *.list methods
0681012 is described below

commit 068101225b3b9fd99a6c3962d09158dcc5a2149b
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Wed May 17 08:55:07 2017 -0400

    make Project.list like the other *.list methods
---
 lib/whimsy/asf/ldap.rb         | 8 +++++++-
 www/roster/models/committer.rb | 2 ++
 www/roster/views/ppmcs.html.rb | 3 ++-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/lib/whimsy/asf/ldap.rb b/lib/whimsy/asf/ldap.rb
index 3245d4e..ac41bf3 100644
--- a/lib/whimsy/asf/ldap.rb
+++ b/lib/whimsy/asf/ldap.rb
@@ -551,6 +551,12 @@ module ASF
       end
     end
 
+    def projects
+      weakref(:projects) do
+        Project.list("member=uid=#{name},#{base}")
+      end
+    end
+
     def groups
       weakref(:groups) do
         Group.list("memberUid=#{name}")
@@ -699,7 +705,7 @@ module ASF
     @base = 'ou=project,ou=groups,dc=apache,dc=org'
 
     def self.list(filter='cn=*')
-      ASF.search_one(base, filter, 'cn').flatten
+      ASF.search_one(base, filter, 'cn').flatten.map {|cn| Project.find(cn)}
     end
 
     def self.preload
diff --git a/www/roster/models/committer.rb b/www/roster/models/committer.rb
index 26217f0..6c71910 100644
--- a/www/roster/models/committer.rb
+++ b/www/roster/models/committer.rb
@@ -51,6 +51,8 @@ class Committer
 
     response[:committees] = person.committees.map(&:name)
 
+    response[:projects] = person.projects.map(&:name)
+
     response[:groups] = person.services
     response[:committer] = []
     committees = ASF::Committee.list.map(&:id)
diff --git a/www/roster/views/ppmcs.html.rb b/www/roster/views/ppmcs.html.rb
index 9666353..9bfa51e 100644
--- a/www/roster/views/ppmcs.html.rb
+++ b/www/roster/views/ppmcs.html.rb
@@ -23,10 +23,11 @@ _html do
       end
     end
 
+    project_names = @projects.map {|project| project.name}
     @ppmcs.sort_by {|ppmc| ppmc.display_name.downcase}.each do |ppmc|
       _tr_ do
         _td do
-          if @projects.include? ppmc.name
+          if project_names.include? ppmc.name
             _a ppmc.display_name, href: "ppmc/#{ppmc.name}"
           else
             _span ppmc.display_name

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

Mime
View raw message