whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: add a calendar API
Date Fri, 09 Aug 2019 16:05:18 GMT
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 13a6cb1  add a calendar API
13a6cb1 is described below

commit 13a6cb1bbf10c25ebd8db751424f9acf6114a78c
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Fri Aug 9 12:04:51 2019 -0400

    add a calendar API
---
 www/board/agenda/config.ru |  7 +++++--
 www/board/agenda/routes.rb | 11 +++++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/www/board/agenda/config.ru b/www/board/agenda/config.ru
index 907d89d..63572aa 100644
--- a/www/board/agenda/config.ru
+++ b/www/board/agenda/config.ru
@@ -17,13 +17,16 @@ use ASF::Auth::MembersAndOfficers do |env|
 
   # allow access to historical-comments and post for reporter tool.
   # notes:
-  # - historical-comments is filtered by routes.rb to only include the list of
-  #   PMCs that the user is a member of for non-ASF-members and non-officers.
+  # - historical-comments and latest is filtered by routes.rb to only include
+  #   the list of PMCs that the user is a member of for non-ASF-members and
+  #   non-officers.
   # - post is limited to ASF members, officers, and members of the PMC whose
   #   report is being posted.
+  # - calendar is available to all committers
   next true if env['PATH_INFO'] == '/json/historical-comments'
   next true if env['PATH_INFO'] == '/json/post'
   next true if env['PATH_INFO'] == '/latest.json'
+  next true if env['PATH_INFO'] == '/calendar.json'
 
   # additionally authorize all invited guests
   agenda = dir('board_agenda_*.txt').sort.last
diff --git a/www/board/agenda/routes.rb b/www/board/agenda/routes.rb
index 95c4def..76b3942 100755
--- a/www/board/agenda/routes.rb
+++ b/www/board/agenda/routes.rb
@@ -27,6 +27,17 @@ get '/latest.json' do
   )
 end
 
+get '/calendar.json' do
+  _json do
+    {
+      nextMeeting: ASF::Board.nextMeeting.iso8601,
+      calendar: ASF::Board.calendar.map(&:iso8601),
+      agendas: dir('board_agenda_*.txt').sort,
+      drafts: dir('board_minutes_*.txt').sort
+    }
+  end
+end
+
 # icon
 get '/whimsy.svg' do
   send_file File.expand_path('../../../whimsy.svg', __FILE__),


Mime
View raw message