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 a128be7 minor refactoring and cleanup of inactive helpblock a128be7 is described below commit a128be788146006ca56d8405748e4d40c3b617c3 Author: Sam Ruby <ru...@intertwingly.net> AuthorDate: Wed Mar 23 14:51:23 2022 -0400 minor refactoring and cleanup of inactive helpblock --- www/members/inactive.cgi | 28 ++++++++-------------------- www/members/meeting-util.rb | 15 +++++++++++++++ www/members/non-participants.cgi | 10 +--------- 3 files changed, 24 insertions(+), 29 deletions(-) diff --git a/www/members/inactive.cgi b/www/members/inactive.cgi index 3c9cd64..276c856 100755 --- a/www/members/inactive.cgi +++ b/www/members/inactive.cgi @@ -62,16 +62,7 @@ _html do begin tracker = JSON.parse(IO.read(File.join(latest, 'non-participants.json'))) rescue Errno::ENOENT => err - meetingsMissed = @meetingsMissed - _attendance, matrix, _dates, _nameMap = MeetingUtil.get_attend_matrices(MEETINGS) - inactive = matrix.select do |id, _name, _first, missed| - id and missed >= meetingsMissed - end - - current_status = MeetingUtil.current_status(latest) - tracker = inactive.map {|id, name, _first, missed| - [id, {'name' => name, 'missed' => missed, 'status' => current_status[id]}] - }.to_h + tracker = MeetingUtil.tracker(@meetingsMissed) end # determine user's name as found in members.txt @@ -96,16 +87,13 @@ _html do MeetingUtil::RECORDS => 'Official Past Meeting Records' }, helpblock: -> { - _p do - _ "This page shows your personal attendance record at past Member's meetings, as of meeting #{latest}." - _ %{ - It is also a poll of members who have not participated in - ASF Members Meetings or Elections in the past three years, and - if you have been inactive, asks you if you wish to remain active or go emeritus. Inactive members - (only) will see a form below and can - indicate their choice and provide feedback on meetings by pushing one of the buttons below. - } - end + _p "This page shows your personal attendance record at past Member's meetings, as of meeting #{latest}." + _p %{ + Inactive members (only) will see a button to request a proxy for the next meeting, and + a second button that they can use to request to go emeritus. They also + will see the text of an issue that will be placed before the membership + for a vote should they not take either of these two options. + } } ) do diff --git a/www/members/meeting-util.rb b/www/members/meeting-util.rb index 27c9690..da6eae5 100644 --- a/www/members/meeting-util.rb +++ b/www/members/meeting-util.rb @@ -194,6 +194,21 @@ class MeetingUtil end end end + + # return the current status of all inactive members + def self.tracker(meetingsMissed) + cur_mtg_dir = MeetingUtil.get_latest(ASF::SVN['Meetings']) + current_status = self.current_status(cur_mtg_dir) + + _attendance, matrix, _dates, _nameMap = MeetingUtil.get_attend_matrices(MEETINGS) + inactive = matrix.select do |id, _name, _first, missed| + id and missed >= meetingsMissed + end + + Hash[inactive.map {|id, name, _first, missed| + [id, {'name' => name, 'missed' => missed, 'status' => current_status[id]}] + }] + end end # ## ### #### ##### ###### diff --git a/www/members/non-participants.cgi b/www/members/non-participants.cgi index 3b53390..bec9235 100755 --- a/www/members/non-participants.cgi +++ b/www/members/non-participants.cgi @@ -126,13 +126,5 @@ _html do end _json do - meetingsMissed = (@meetingsMissed || 3).to_i - _attendance, matrix, _dates, _nameMap = MeetingUtil.get_attend_matrices(MEETINGS) - inactive = matrix.select do |id, _name, _first, missed| - id and missed >= meetingsMissed - end - - Hash[inactive.map {|id, name, _first, missed| - [id, {name: name, missed: missed, status: current_status[id]}] - }] + MeetingUtil.tracker((@meetingsMissed || 3).to_i) end