You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2019/07/21 00:28:27 UTC

[whimsy] branch master updated: Also support deceased status

This is an automated email from the ASF dual-hosted git repository.

sebb 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 8dad731  Also support deceased status
8dad731 is described below

commit 8dad7319c6d4df656ec1c2d2b2376d0ef18edd33
Author: Sebb <se...@apache.org>
AuthorDate: Sun Jul 21 01:28:23 2019 +0100

    Also support deceased status
---
 www/roster/views/actions/memstat.json.rb |  5 +++++
 www/roster/views/person/memstat.js.rb    | 13 +++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/www/roster/views/actions/memstat.json.rb b/www/roster/views/actions/memstat.json.rb
index ccb57e6..91a807f 100644
--- a/www/roster/views/actions/memstat.json.rb
+++ b/www/roster/views/actions/memstat.json.rb
@@ -18,8 +18,13 @@ _svn.update members_txt, message: message do |dir, text|
   # determine where to put the entry
   if @action == 'emeritus'
     index = text.index(/^\s\*\)\s/, text.index(/^Emeritus/))
+    entry.sub! %r{\s*/\* deceased, .+?\*/},'' # drop the deceased comment if necessary
   elsif @action == 'active'
     index = text.index(/^\s\*\)\s/, text.index(/^Active/))
+    entry.sub! %r{\s*/\* deceased, .+?\*/},'' # drop the deceased comment if necessary
+  elsif @action == 'deceased'
+    index = text.index(/^\s\*\)\s/, text.index(/^Deceased/))
+    entry.sub! %r{\n}, " /* deceased, #{@dod} */\n" # add the deceased comment
   else
     raise Exception.new("invalid action #{action.inspect}")
   end
diff --git a/www/roster/views/person/memstat.js.rb b/www/roster/views/person/memstat.js.rb
index 330ad53..39367c4 100644
--- a/www/roster/views/person/memstat.js.rb
+++ b/www/roster/views/person/memstat.js.rb
@@ -14,13 +14,26 @@ class PersonMemberStatus < Vue
           _span committer.member.status
 
          if @@edit == :memstat
+           opt = { year: 'numeric', month: 'long' } # Suggested date
+           dod = Date.new.toLocaleDateString('en-US', opt)
            _form.inline method: 'post' do
              if committer.member.status.include? 'Active'
                _button.btn.btn_primary 'move to emeritus',
                  name: 'action', value: 'emeritus'
+               _button.btn.btn_primary 'move to deceased',
+                 name: 'action', value: 'deceased'
+               _input 'dod', name: 'dod', value: dod
              elsif committer.member.status.include? 'Emeritus'
                _button.btn.btn_primary 'move to active',
                  name: 'action', value: 'active'
+               _button.btn.btn_primary 'move to deceased',
+                 name: 'action', value: 'deceased'
+               _input 'dod', name: 'dod', value: dod
+             elsif committer.member.status.include? 'Deceased'
+               _button.btn.btn_primary 'move to active',
+                 name: 'action', value: 'active'
+               _button.btn.btn_primary 'move to emeritus',
+                 name: 'action', value: 'emeritus'
              end
            end
          end