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 f261556 Move processing up
f261556 is described below
commit f26155677adaaab3a5d4bb62c3a89fb65bd5cabb
Author: Sebb <[email protected]>
AuthorDate: Sun Mar 14 14:53:29 2021 +0000
Move processing up
---
www/roster/main.rb | 41 ++++++++++++++++++++++++++++++++---------
www/roster/views/other.html.rb | 27 ++++++---------------------
2 files changed, 38 insertions(+), 30 deletions(-)
diff --git a/www/roster/main.rb b/www/roster/main.rb
index 95c19b5..21c7378 100755
--- a/www/roster/main.rb
+++ b/www/roster/main.rb
@@ -95,20 +95,43 @@ end
# Handle projects without apparent connections
get '/other/' do
- @otherids = ASF::Project.list.map(&:name) -
+ otherids = ASF::Project.list.map(&:name) -
ASF::Committee.pmcs.map(&:name) -
ASF::Committee.nonpmcs.map(&:name) -
ASF::Podling.currentids -
ASF::Petri.list.map(&:id)
- @atticids = ASF::Committee.load_committee_metadata[:tlps].filter_map {|k,v|
k if v[:retired]}
- @retiredids = ASF::Podling.retiredids
- @podlingAliases = {}
- @podlingURLs = {}
- ASF::Podling.list.each do |podling|
- podling.resourceAliases.each {|ra| @podlingAliases[ra] = podling.name}
- if podling.graduated?
- @podlingURLs[podling.name] = podling.resolutionURL if
podling.resolutionURL
+ attics = ASF::Committee.load_committee_metadata[:tlps].filter {|k,v|
v[:retired]}
+ @others = {}
+ otherids.each do |id|
+ if attics.include? id
+ type = 'Attic'
+ date = attics[id][:retired]
+ else
+ podling = ASF::Podling.find(id)
+ if podling
+ case podling.status
+ when 'retired'
+ type = 'Retired Podling'
+ date = podling.enddate.to_s
+ when 'graduated'
+ type = "Podling graduated as #{podling.resolutionURL}"
+ date = podling.enddate.to_s
+ when 'current'
+ type = "Renamed Podling => #{podling.name}"
+ date = ''
+ else
+ type = 'Unknown Podling status - should not happen!'
+ date = podling.status
+ end
+ else # not podling or Attic
+ type = 'Unknown'
+ date = ''
+ end
end
+ @others[id] = {
+ type: type,
+ date: date
+ }
end
_html :other
end
diff --git a/www/roster/views/other.html.rb b/www/roster/views/other.html.rb
index a0e170b..3301233 100644
--- a/www/roster/views/other.html.rb
+++ b/www/roster/views/other.html.rb
@@ -38,30 +38,15 @@ _html do
_tr do
_th.sorting_asc 'Name', data_sort: 'string-ins'
_th 'Description', data_sort: 'string'
+ _th 'End Date', data_sort: 'string'
end
end
_tbody do
- @otherids.sort.each do |other|
- _tr_ do
- _td do
- _a other
- end
-
- if @atticids.include? other
- _td 'Attic'
- elsif @retiredids.include? other
- _td 'Retired Podling'
- elsif @podlingAliases.include? other
- _td "Podling alias for #{@podlingAliases[other]}"
- elsif @podlingURLs.include? other
- _td do
- url = @podlingURLs[other]
- _ "Podling graduated as"
- _a url, href: url
- end
- else
- _td 'Unkown'
- end
+ @others.sort.each do |k,v|
+ _tr do
+ _td k
+ _td v[:type]
+ _td v[:date]
end
end
end