Skip to content

Commit

Permalink
Add simplistic display of director nominee nominations plus statements
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaneCurcuru committed Feb 2, 2025
1 parent fb2feb0 commit 8e0c72f
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
26 changes: 26 additions & 0 deletions lib/whimsy/asf/member-files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,32 @@ def self.board_nominees
end
nominees
end

# Return hash of board nomination statements
# TODO Annotate with board nominees data?
def self.board_statements
statements = {}
Dir["#{File.join(latest_meeting(), BOARD_BALLOT)}/*#{BOARD_BALLOT_EXT}"].each do |f|
statements[File.basename(f, BOARD_BALLOT_EXT)] = {'candidate_statement' => IO.read(f)}
end
return statements
end

# Merged board nominations and statements
def self.board_all
noms = board_nominees
stats = board_statements
combined = {}
noms.each do |availid, hash|
combined[availid] = hash.merge(stats.fetch(availid, {}))
combined[availid]['Nomination Statement'] = combined[availid]['Nomination Statement'].join('\n')
combined[availid]['nombyemail'] = combined[availid].fetch('Nominated by', '')
combined[availid]['nombyeavailid'] = combined[availid]['nombyemail'].sub('@apache.org', '')
person = ASF::Person.find(combined[availid]['nombyeavailid'])
combined[availid]['nombycn'] = person.public_name
end
return combined
end
end
end

Expand Down
51 changes: 51 additions & 0 deletions www/members/check_boardstmt.cgi
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env ruby
PAGETITLE = "Review existing Board statements" # Wvisible:meeting
$LOAD_PATH.unshift '/srv/whimsy/lib'
require 'wunderbar/bootstrap'
require 'whimsy/asf'
require 'whimsy/asf/member-files'
require 'whimsy/asf/meeting-util'

_html do
_body? do
latest_meeting_dir = ASF::MeetingUtil.latest_meeting_dir
timelines = ASF::MeetingUtil.get_timeline(latest_meeting_dir)
_whimsy_body(
title: PAGETITLE,
related: {
'meeting.cgi' => 'Member Meeting FAQ and info',
'nominate_board.cgi' => 'Nominate someone for the Board',
'check_membernoms.cgi' => 'Cross-check existing New Member nominations',
ASF::SVN.svnpath!('Meetings') => 'Official Meeting Agenda Directory'
},
helpblock: -> {
_b "For: #{timelines['meeting_type']} Meeting on: #{timelines['meeting_iso']}"
_ 'This script displays a list of currently nominated directors and both statements from the Nominator/seconds, and (when present) Candidate statements from the nominees themselves.'
_br
_ 'IMPORTANT: many director candidates may not add statements until near the nomination close deadline; this is just a preview!'
_br
_ 'This only works in the period shortly before or after a Members meeting!'
}
) do
statements = ASF::MemberFiles.board_all
statements.each do |availid, shash|
_div id: availid
_whimsy_panel("Director Nominee: #{shash.fetch('Public Name', '')} (#{availid})", style: 'panel-default') do
_p do
_strong "Director's Own Statement (once present)"
_br
_ shash.fetch('candidate_statement', '')
end
_p do
_strong "Nominated By: #{shash['nombycn']} (#{shash['nombyeavailid']})"
_br
_ "Testing: Seconded by = #{shash['Seconded by']}"
_ 'Nominator Statment(s):'
_br
_ shash.fetch('Nomination Statement', '')
end
end
end
end
end
end

0 comments on commit 8e0c72f

Please sign in to comment.