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 1bdbc5a  Specify missing items
1bdbc5a is described below

commit 1bdbc5aa234adf7ac4612b57fdf8c7fe41336b2c
Author: Sebb <[email protected]>
AuthorDate: Wed Mar 17 17:40:35 2021 +0000

    Specify missing items
---
 www/secretary/workbench/templates/incomplete.erb   |  1 +
 .../workbench/views/actions/incomplete.json.rb     |  7 ++++++
 www/secretary/workbench/views/parts.js.rb          | 28 ++++++++++++++++++++++
 3 files changed, 36 insertions(+)

diff --git a/www/secretary/workbench/templates/incomplete.erb 
b/www/secretary/workbench/templates/incomplete.erb
index 90db4f3..3b71b5b 100644
--- a/www/secretary/workbench/templates/incomplete.erb
+++ b/www/secretary/workbench/templates/incomplete.erb
@@ -1,6 +1,7 @@
 Dear <%= @email.display_names.join(', ') %>,
 
 We received this document but it appears to be incomplete.
+<%= @missing_items %>
 Please fill all required fields and resubmit all pages
 to [email protected]
 https://www.apache.org/licenses/#submitting
diff --git a/www/secretary/workbench/views/actions/incomplete.json.rb 
b/www/secretary/workbench/views/actions/incomplete.json.rb
index c556575..fbdbd74 100644
--- a/www/secretary/workbench/views/actions/incomplete.json.rb
+++ b/www/secretary/workbench/views/actions/incomplete.json.rb
@@ -15,6 +15,13 @@ _extract_project
 task "email #{message.from}" do
   # build mail from template
   @email = message.from
+  @test2 = [@missing_phone, @missing_address]
+  missing_items = []
+  missing_items << '- missing phone number' if @missing_phone == 'true'
+  missing_items << '- missing or incomplete postal address' if 
@missing_address == 'true'
+  missing_items << '- missing email address' if @missing_email == 'true'
+  missing_items << '' if missing_items.size > 0 # add separator
+  @missing_items = missing_items.join("\n")
   mail = message.reply(
     from: @from,
     cc: [
diff --git a/www/secretary/workbench/views/parts.js.rb 
b/www/secretary/workbench/views/parts.js.rb
index 056df1e..c54591c 100644
--- a/www/secretary/workbench/views/parts.js.rb
+++ b/www/secretary/workbench/views/parts.js.rb
@@ -12,6 +12,9 @@ class Parts < Vue
     @form = :categorize
     @menu = nil
     @project = nil
+    @missing_phone = false
+    @missing_address = false
+    @missing_email = false
   end
 
   ########################################################################
@@ -155,6 +158,31 @@ class Parts < Vue
               value: window.parent.location.pathname
             _input type: 'hidden', name: 'selected', value: @@selected
             _input type: 'hidden', name: 'signature', value: @@signature
+            _input type: 'hidden', name: 'missing_phone', value: @missing_phone
+            _input type: 'hidden', name: 'missing_address', value: 
@missing_address
+            _input type: 'hidden', name: 'missing_email', value: @missing_email
+
+            spacer = "\u00A0"*4 # non-breaking space as UTF-8
+            _label do
+              _ spacer
+              _input type: 'checkbox', checked: @missing_phone,
+              onClick:-> {@missing_phone = !@missing_phone}
+              _span ' missing phone number'
+            end
+
+            _label do
+              _ spacer
+              _input type: 'checkbox', checked: @missing_address,
+              onClick:-> {@missing_address = !@missing_address}
+              _span ' missing or partial postal address'
+            end
+
+            _label do
+              _ spacer
+              _input type: 'checkbox', checked: @missing_email,
+              onClick:-> {@missing_email = !@missing_email}
+              _span ' missing email address'
+            end
 
             _label do
               _input type: 'radio', name: 'doctype', value: 'incomplete',

Reply via email to