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 8719020 Support for sending out reminders before the agenda is created
8719020 is described below
commit 8719020f71dd59580cdf5dc7e42adbee57761fc5
Author: Sam Ruby <[email protected]>
AuthorDate: Thu Mar 21 17:55:29 2019 -0400
Support for sending out reminders before the agenda is created
---
www/board/agenda/routes.rb | 21 ++++++++++++++++++++-
www/board/agenda/views/models/agenda.js.rb | 2 +-
2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/www/board/agenda/routes.rb b/www/board/agenda/routes.rb
index cf6f540..bbf20b4 100755
--- a/www/board/agenda/routes.rb
+++ b/www/board/agenda/routes.rb
@@ -54,7 +54,26 @@ end
# redirect missing to missing page for the latest agenda
get '/missing' do
agenda = dir('board_agenda_*.txt').sort.last
- pass unless agenda # is this correct?
+ pass unless agenda # this will result in a 404
+
+ // Support for sending out reminders before the agenda is created.
+ // Useful in cases where the agenda creation is delayed due to
+ // a board election.
+ if agenda < Date.today.strftime('board_agenda_%Y_%m_%d.txt')
+ // update in memory cache with a dummy agenda. The only relevant
+ // part of the agenda that matters for this operation is the list
+ // of pmcs (@pmcs).
+ template = File.read('templates/agenda.erb')
+ @meeting = ASF::Board.nextMeeting
+ agenda = @meeting.strftime('board_agenda_%Y_%m_%d.txt')
+ @directors = ['TBD']
+ @minutes = []
+ @owner = ASF::Board::ShepherdStream.new
+ @pmcs = ASF::Board.reporting(@meeting)
+ contents = Erubis::Eruby.new(template).result(binding)
+ Agenda.update_cache(agenda, nil, contents, true)
+ end
+
response.headers['Location'] =
"#{agenda[/\d+_\d+_\d+/].gsub('_', '-')}/missing"
status 302
diff --git a/www/board/agenda/views/models/agenda.js.rb
b/www/board/agenda/views/models/agenda.js.rb
index 4f01956..a28898a 100644
--- a/www/board/agenda/views/models/agenda.js.rb
+++ b/www/board/agenda/views/models/agenda.js.rb
@@ -246,7 +246,7 @@ class Agenda
if @attach =~ /^[A-Z]+$/
Agenda.index.each do |item|
- items << item if item.attach =~ /^7/ and item.roster == @roster
+ items << item if item.attach =~ /^7\w/ and item.roster == @roster
end
end