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: only allow membership applications during the 30 days after the meeting reconvenes
Date Tue, 01 May 2018 06:17:43 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 60956bb  only allow membership applications during the 30 days after the meeting
reconvenes
60956bb is described below

commit 60956bbf3d13e531beec5a2fc4bc4e59194cf401
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Tue May 1 02:17:13 2018 -0400

    only allow membership applications during the 30 days after the
    meeting reconvenes
---
 www/secretary/workbench/server.rb            |  7 +++++++
 www/secretary/workbench/views/memapp.json.rb |  8 ++++++--
 www/secretary/workbench/views/parts.html.rb  |  3 ++-
 www/secretary/workbench/views/parts.js.rb    | 10 ++++++----
 4 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/www/secretary/workbench/server.rb b/www/secretary/workbench/server.rb
index e84c369..2da2fb0 100644
--- a/www/secretary/workbench/server.rb
+++ b/www/secretary/workbench/server.rb
@@ -150,6 +150,13 @@ get %r{/(\d{6})/(\w+)/_index_} do |month, hash|
   @cssmtime = File.mtime('public/secmail.css').to_i
   @appmtime = Wunderbar::Asset.convert(File.join(settings.views, 'app.js.rb')).mtime.to_i
   @projects = (ASF::Podling.current+ASF::Committee.pmcs).map(&:name).sort
+
+  # Section 4.1 of the ASF bylaws provides requirements for when membership
+  # applications can be accepted.  Two days are added to cover the adjournment
+  # period of the meeting during which the vote takes place.
+  received = Dir["#{ASF::SVN['Meetings']}/2*/memapp-received.txt"].sort.last
+  @meeting = Date.today - Date.parse(received[/\d+/]) <= 32
+
   _html :parts
 end
 
diff --git a/www/secretary/workbench/views/memapp.json.rb b/www/secretary/workbench/views/memapp.json.rb
index e24ed7b..db97348 100644
--- a/www/secretary/workbench/views/memapp.json.rb
+++ b/www/secretary/workbench/views/memapp.json.rb
@@ -1,12 +1,16 @@
 # parse and return the contents of the latest memapp-received file
 
 # find latest memapp-received.txt file in the foundation/Meetings directory
-meetings = ASF::SVN['private/foundation/Meetings']
+meetings = ASF::SVN['Meetings']
 received = Dir["#{meetings}/2*/memapp-received.txt"].sort.last.untaint
 
 # extract contents
 pattern = /^\w+\s+(\w+)\s+(\w+)\s+(\w+)\s+(\w+)\s+(.*?)\s*\n/
-table = File.read(received).scan(pattern)
+if Date.today - Date.parse(received[/\d+/]) <= 32
+  table = File.read(received).scan(pattern)
+else
+  table = []
+end
 
 # map contents to a hash
 fields = %w(apply mail karma id name)
diff --git a/www/secretary/workbench/views/parts.html.rb b/www/secretary/workbench/views/parts.html.rb
index 7b31095..6f9c074 100644
--- a/www/secretary/workbench/views/parts.html.rb
+++ b/www/secretary/workbench/views/parts.html.rb
@@ -92,7 +92,8 @@ _html do
 
   _script src: "../../app.js?#{@appmtime}"
   _.render '#parts' do
-    _Parts attachments: @attachments, headers: @headers, projects: @projects
+    _Parts attachments: @attachments, headers: @headers, projects: @projects,
+      meeting: @meeting
   end
 
 end
diff --git a/www/secretary/workbench/views/parts.js.rb b/www/secretary/workbench/views/parts.js.rb
index e5c21eb..696fc89 100644
--- a/www/secretary/workbench/views/parts.js.rb
+++ b/www/secretary/workbench/views/parts.js.rb
@@ -129,10 +129,12 @@ class Parts < Vue
             _span 'software grant'
           end
 
-          _label do
-            _input type: 'radio', name: 'doctype', value: 'mem',
-              onClick: -> {@form = MemApp}
-            _span 'membership application'
+          if @@meeting
+            _label do
+              _input type: 'radio', name: 'doctype', value: 'mem',
+                onClick: -> {@form = MemApp}
+              _span 'membership application'
+            end
           end
 
           _hr

-- 
To stop receiving notification emails like this one, please contact
rubys@apache.org.

Mime
View raw message