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 a008d1ea Allow for additional text in rejection message
a008d1ea is described below

commit a008d1ea42a844e17b2275e27618312237764091
Author: Sebb <[email protected]>
AuthorDate: Sun Jul 9 14:22:26 2023 +0100

    Allow for additional text in rejection message
---
 www/secretary/workbench/templates/incomplete.erb       |  5 ++++-
 .../workbench/views/actions/incomplete.json.rb         | 10 ++++++++++
 www/secretary/workbench/views/parts.js.rb              | 18 ++++++++++++++++++
 3 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/www/secretary/workbench/templates/incomplete.erb 
b/www/secretary/workbench/templates/incomplete.erb
index e3455098..2d20f1eb 100644
--- a/www/secretary/workbench/templates/incomplete.erb
+++ b/www/secretary/workbench/templates/incomplete.erb
@@ -2,7 +2,10 @@ Dear <%= @email.display_names.join(', ') %>,
 
 We received this document but we cannot file it as is.
 <%= @missing_items %>
-Please fill all required fields and resubmit all pages
+<% if @other_items.size > 0 %>The following also need to be fixed:
+<%= @other_items %>
+<% end %>
+Please complete all required fields and resubmit all pages
 to [email protected]
 https://apache.org/licenses/contributor-agreements.html#submitting
 
diff --git a/www/secretary/workbench/views/actions/incomplete.json.rb 
b/www/secretary/workbench/views/actions/incomplete.json.rb
index f7b979d8..61f33611 100644
--- a/www/secretary/workbench/views/actions/incomplete.json.rb
+++ b/www/secretary/workbench/views/actions/incomplete.json.rb
@@ -27,6 +27,11 @@ REASONS = {
   '@unsigned' => 'the document appears to be unsigned',
   '@script_font' => 'a name typed in a script font is not a signature',
 }
+# These aren't reasons for rejection, but need to be fixed
+OTHERS = {
+  '@upload_sig' => 'please also upload your signature to keyserver.ubuntu.com. 
(see the link below for details)',
+  '@invalid_availid' => 'please also provide a valid id',
+}
 
 # send rejection email
 task "email #{message.from}" do
@@ -38,6 +43,11 @@ task "email #{message.from}" do
   end
   missing_items << '' if missing_items.size > 0 # add separator
   @missing_items = missing_items.join("\n")
+  other_items = []
+  OTHERS.each do |k, v|
+    other_items << "- #{v}" if instance_variable_get(k) == 'true'
+  end
+  @other_items = other_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 515b0832..498b6219 100644
--- a/www/secretary/workbench/views/parts.js.rb
+++ b/www/secretary/workbench/views/parts.js.rb
@@ -25,6 +25,8 @@ class Parts < Vue
     @signature_not_armored = false
     @unsigned = false
     @script_font = false
+    @upload_sig = false
+    @invalid_availid = false
   end
 
   ########################################################################
@@ -200,6 +202,8 @@ class Parts < Vue
             _input type: 'hidden', name: 'signature_not_armored', value: 
@signature_not_armored
             _input type: 'hidden', name: 'unsigned', value: @unsigned
             _input type: 'hidden', name: 'script_font', value: @script_font
+            _input type: 'hidden', name: 'upload_sig', value: @upload_sig
+            _input type: 'hidden', name: 'invalid_availid', value: 
@invalid_availid
             # the above entries must agree with the checked: entries below
             # also any new entries must be added to the backend script 
incomplete.json.rb
 
@@ -324,6 +328,20 @@ class Parts < Vue
                   _span ' script font'
                 end
               end
+              _li do
+                _label do
+                  _input type: 'checkbox', checked: @upload_sig,
+                  onClick: -> {@upload_sig = !@upload_sig}
+                  _span ' upload signature'
+                end
+              end
+              _li do
+                _label do
+                  _input type: 'checkbox', checked: @invalid_availid,
+                  onClick: -> {@invalid_availid = !@invalid_availid}
+                  _span ' invalid availid'
+                end
+              end
             end
 
             # N.B. The checked: variable names must be reflected in the file 
incomplete.json.jb

Reply via email to