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/29 22:35:36 UTC

[whimsy.git] [1/1] Commit ac05c0e: groups

Commit ac05c0ef641fab963c36597fa50b3af8ab3d0b98:
    groups


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

------------------------------------------------------------
www/roster/main.rb                                           | +++++++ 
www/roster/models/group.rb                                   | ++++++++++ 
www/roster/views/committer.js.rb                             | +++++++ -
www/roster/views/groups.html.rb                              | +++++++++ 
www/roster/views/index.html.rb                               | ++++++++++++++ 
------------------------------------------------------------
118 changes: 117 additions, 1 deletions.
------------------------------------------------------------


diff --git a/www/roster/main.rb b/www/roster/main.rb
index dec065e..d4df7c9 100755
--- a/www/roster/main.rb
+++ b/www/roster/main.rb
@@ -22,6 +22,7 @@
   @committers = ASF::Person.list
   @committees = ASF::Committee.list
   @members = ASF::Member.list.keys - ASF::Member.status.keys
+  @groups = Group.list
   @podlings = ASF::Podlings.new.to_h.values
   _html :index
 end
@@ -94,6 +95,12 @@
   _html :group
 end
 
+get '/group/' do
+  @groups = Group.list
+  @podlings = ASF::Podlings.new.to_h
+  _html :groups
+end
+
 # member list
 get '/members' do
   _html :members
diff --git a/www/roster/models/group.rb b/www/roster/models/group.rb
index 43a99ce..acc40e9 100644
--- a/www/roster/models/group.rb
+++ b/www/roster/models/group.rb
@@ -3,6 +3,25 @@
 #
 
 class Group
+  def self.list
+    # start with groups that aren't PMCs
+    groups = ASF::Group.list.map(&:id)
+    groups -= ASF::Committee.list.map(&:id)
+    groups.map! {|group| [group, "LDAP group"]}
+
+    # add services...
+    groups += ASF::Service.list.map {|service| [service, "LDAP service"]}
+
+    # add authorization (asf and pit)
+    groups += ASF::Authorization.new('asf').to_h.
+      map {|id, list| [id, "ASF Auth"]}
+
+    groups += ASF::Authorization.new('pit').to_h.
+      map {|id, list| [id, "PIT Auth"]}
+
+    groups.sort
+  end
+
   def self.serialize(id)
     response = {}
 
diff --git a/www/roster/views/committer.js.rb b/www/roster/views/committer.js.rb
index d1fa28a..e4d9d62 100644
--- a/www/roster/views/committer.js.rb
+++ b/www/roster/views/committer.js.rb
@@ -77,6 +77,8 @@ def render
           _td 'Groups'
           _td do
             _ul @committer.groups do |group|
+              next if group == 'apldap'
+
               if group == 'committers'
                 _li {_a group, href: "committer/"}
               elsif group == 'member'
@@ -127,7 +129,11 @@ def render
         if @committer.member.status
           _tr do
             _td 'Member status'
-            _td @committer.member.status
+            if @committer.member.info
+              _td @committer.member.status
+            else
+              _td.not_found 'Not in members.txt'
+            end
           end
         end
 
diff --git a/www/roster/views/groups.html.rb b/www/roster/views/groups.html.rb
new file mode 100644
index 0000000..2b6a817
--- /dev/null
+++ b/www/roster/views/groups.html.rb
@@ -0,0 +1,70 @@
+#
+# List of all other groups
+#
+
+_html do
+  _base href: '..'
+  _title 'ASF Group list'
+  _link rel: 'stylesheet', href: 'stylesheets/app.css'
+
+  _banner breadcrumbs: {
+    roster: '.',
+    group: 'group'
+  }
+
+  # ********************************************************************
+  # *                             Summary                              *
+  # ********************************************************************
+
+  _h1_ 'Summary'
+ 
+  _table.counts do
+    @groups.group_by(&:last).sort.each do |name, list|
+      _tr do
+        _td list.count
+        _td name
+      end
+    end
+  end
+
+  # ********************************************************************
+  # *                          Complete list                           *
+  # ********************************************************************
+
+  _h1_ 'Groups'
+
+  _table.table.table_hover do
+    _thead do
+      _tr do
+        _th.sorting_asc 'name', data_sort: 'string-ins'
+        _th 'group type', data_sort: 'string'
+        _th 'notes', data_sort: 'notes'
+      end
+    end
+
+    _tbody do
+      @groups.each do |name, type|
+        next if name == 'apldap'
+        _tr_ do
+          _td {_a name, href: "group/#{name}"}
+          _td type
+
+          if @podlings[name]
+            if @podlings[name][:status] == 'retired'
+              _td.issue "retired podling"
+            else
+              _td "#{@podlings[name][:status]} podling"
+            end
+          else
+            _td
+          end
+        end
+      end
+    end
+  end
+
+
+  _script %{
+    $(".table").stupidtable();
+  }
+end
diff --git a/www/roster/views/index.html.rb b/www/roster/views/index.html.rb
index fbaebc3..cde3c63 100644
--- a/www/roster/views/index.html.rb
+++ b/www/roster/views/index.html.rb
@@ -71,5 +71,19 @@
       _td 'Active podlings at the ASF'
     end
 
+    ### Groups
+
+    _tr do
+      _td do
+        _a @groups.length, href: 'group/'
+      end
+
+      _td do
+        _a 'Groups', href: 'group/'
+      end
+
+      _td 'Assorted other groups from various sources'
+    end
+
   end
 end