This is an automated email from the ASF dual-hosted git repository.

sebb 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 0f8f88d  Add Petri listing
0f8f88d is described below

commit 0f8f88d1d3106bb355ee1e459aa594f27cd3be61
Author: Sebb <[email protected]>
AuthorDate: Mon Mar 8 22:37:44 2021 +0000

    Add Petri listing
---
 lib/whimsy/asf/petri.rb        | 25 +++++++++++++-----
 www/roster/main.rb             | 13 +++++++---
 www/roster/views/index.html.rb | 12 +++++++++
 www/roster/views/other.html.rb |  4 +--
 www/roster/views/petri.html.rb | 57 ++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 99 insertions(+), 12 deletions(-)

diff --git a/lib/whimsy/asf/petri.rb b/lib/whimsy/asf/petri.rb
index 3a9f2c6..4b8f3df 100644
--- a/lib/whimsy/asf/petri.rb
+++ b/lib/whimsy/asf/petri.rb
@@ -14,20 +14,32 @@ module ASF
   class Petri
     include Enumerable
 
+    attr_reader :id
     attr_reader :name
-
-    attr_reader  :description
+    attr_reader :description
+    attr_reader :status
+    attr_reader :status
+    attr_reader :mentors
+    attr_reader :website
+    attr_reader :mailinglists
+    attr_reader :repository
+    attr_reader :issues
+    attr_reader :wiki
+    attr_reader :release
+    attr_reader :licensing
 
     def initialize(entry)
-      @name = entry # currently only the name is provided
+      key, hash = entry
+      @id = key
+      hash.each { |name, value| instance_variable_set("@#{name}", value) }
     end
 
     # Array of all Petri culture entries
     def self.list
       @list = []
-      yaml = YAML.safe_load(ASF::Git.github(PETRI_INFO))
+      yaml = YAML.safe_load(ASF::Git.github(PETRI_INFO), [Symbol])
       # @mentors = yaml['mentors']
-      yaml['projects'].each do |proj|
+      yaml['cultures'].each do |proj|
         @list << new(proj)
       end
       @list
@@ -37,6 +49,7 @@ end
 
 if __FILE__ == $0
   ASF::Petri.list.each do |e|
-    p e.name
+    p e
+    p e.website
   end
 end
\ No newline at end of file
diff --git a/www/roster/main.rb b/www/roster/main.rb
index 8f77d64..e103161 100755
--- a/www/roster/main.rb
+++ b/www/roster/main.rb
@@ -46,10 +46,12 @@ get '/' do
     @members = ASF::Member.list.keys - ASF::Member.status.keys # i.e. active 
member ids
     @groups = Group.list
     @podlings = ASF::Podling.to_h.values
+    @petri = ASF::Petri.list
     @otherids = ASF::Project.list.map(&:name) -
                 @committees.map(&:name) -
                 @nonpmcs.map(&:name) -
-                ASF::Podling.currentids
+                ASF::Podling.currentids -
+                @petri.map(&:name)
     _html :index
   else
     redirect to('/')
@@ -81,10 +83,10 @@ get '/other/' do
   @otherids = ASF::Project.list.map(&:name) -
                 ASF::Committee.pmcs.map(&:name) -
                 ASF::Committee.nonpmcs.map(&:name) -
-                ASF::Podling.currentids
+                ASF::Podling.currentids -
+                ASF::Petri.list.map(&:name)
   @atticids = ASF::Committee.load_committee_metadata[:tlps].filter_map {|k,v| 
k if v[:retired]}
   @retiredids = ASF::Podling.retiredids
-  @petriids = ASF::Petri.list.map(&:name)
   @podlingAliases = {}
   @podlingURLs = {}
   ASF::Podling.list.each do |podling|
@@ -375,6 +377,11 @@ get '/podlings' do
   _html :podlings
 end
 
+get '/petri' do
+  @petri = ASF::Petri.list
+  _html :petri
+end
+
 # posted actions
 post '/actions/:file' do
   _json :"actions/#{params[:file]}"
diff --git a/www/roster/views/index.html.rb b/www/roster/views/index.html.rb
index fba5d89..7634505 100644
--- a/www/roster/views/index.html.rb
+++ b/www/roster/views/index.html.rb
@@ -122,6 +122,18 @@ _html do
 
         end
 
+        _tr do
+          _td do
+            _a @petri.length, href: 'petri'
+          end
+
+          _td do
+            _a 'Petri', href: 'petri'
+          end
+
+          _td 'Petri cultures'
+        end
+
         # LDAP project groups without a PMC or active podling etc
         _tr do
           _td do
diff --git a/www/roster/views/other.html.rb b/www/roster/views/other.html.rb
index 02a584b..a0e170b 100644
--- a/www/roster/views/other.html.rb
+++ b/www/roster/views/other.html.rb
@@ -19,12 +19,12 @@ _html do
         _li 'Current PMCs'
         _li 'ASF committees (non-PMCs)'
         _li 'Current podlings'
+        _li 'Petri cultures'
       end
       _ 'Any that remain are then checked against:'
       _ul do
         _li 'Attic projects'
         _li 'Retired podlings'
-        _li 'Petri projects (cultures)'
         _li 'Podling aliases'
         _li 'Podling graduated as part of another TLP'
       end
@@ -49,8 +49,6 @@ _html do
 
             if @atticids.include? other
               _td 'Attic'
-            elsif @petriids.include? other
-              _td 'Petri project'
             elsif @retiredids.include? other
               _td 'Retired Podling'
             elsif @podlingAliases.include? other
diff --git a/www/roster/views/petri.html.rb b/www/roster/views/petri.html.rb
new file mode 100644
index 0000000..e48526a
--- /dev/null
+++ b/www/roster/views/petri.html.rb
@@ -0,0 +1,57 @@
+#
+# List of all Podings
+#
+
+_html do
+  _link rel: 'stylesheet', href: "stylesheets/app.css?#{cssmtime}"
+  _style %{
+    p {margin-top: 0.5em}
+  }
+  _body? do
+    _whimsy_body(
+      title: 'ASF Petri Cultures',
+      breadcrumbs: {
+        roster: '.',
+        petri: 'petri'
+      }
+    ) do
+
+      _h2 'A listing of cultures from Apache Petri'
+      _p do
+        _ 'The data is derived from '
+        _a 'info.yaml', 'https://github.com/apache/petri/blob/master/info.yaml'
+      end
+
+      _br
+
+      _h5 'Click on a column heading to change the sort order'
+
+      _table.table.table_hover do
+        _thead do
+          _tr do
+            _th.sorting_asc 'Id', data_sort: 'string-ins'
+            _th 'Name', data_sort: 'string'
+            _th 'Status', data_sort: 'string'
+            _th 'Description', data_sort: 'string'
+          end
+        end
+        _tbody do
+          @petri.sort_by {|petri| petri.name.downcase}.each do |petri|
+            _tr do
+              _td do
+                _a petri.id, href: "http://petri.apache.org/#{petri.id}";
+              end
+              _td petri.name
+              _td petri.status
+              _td petri.description
+            end
+          end
+        end
+      end
+    end
+  end
+
+  _script %{
+    $(".table").stupidtable();
+  }
+end

Reply via email to