You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by ru...@apache.org on 2016/09/23 15:14:23 UTC
[whimsy] branch master updated: add forward form and action
This is an automated email from the ASF dual-hosted git repository.
rubys pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new e7fe351 add forward form and action
e7fe351 is described below
commit e7fe3512d92269bd1b3010f39c73ad4f839ac468
Author: Sam Ruby <ru...@intertwingly.net>
AuthorDate: Fri Sep 23 11:14:04 2016 -0400
add forward form and action
---
www/secmail/views/actions/forward.json.rb | 32 ++++++++++++++++++++++
www/secmail/views/app.js.rb | 1 +
www/secmail/views/forms/forward.js.rb | 44 +++++++++++++++++++++++++++++++
www/secmail/views/parts.js.rb | 8 ++++++
4 files changed, 85 insertions(+)
diff --git a/www/secmail/views/actions/forward.json.rb b/www/secmail/views/actions/forward.json.rb
new file mode 100644
index 0000000..467d07b
--- /dev/null
+++ b/www/secmail/views/actions/forward.json.rb
@@ -0,0 +1,32 @@
+#
+# File an ICLA:
+# - add files to documents/grants
+# - add entry to officers/grants.txt
+# - respond to original email
+#
+
+# extract message
+message = Mailbox.find(@message)
+
+# obtain per-user information
+_personalize_email(env.user)
+
+########################################################################
+# forward email #
+########################################################################
+
+# send confirmation email
+task "email #@email" do
+ mail = Mail.new(message.raw)
+ mail.to = @destination
+
+ # echo email
+ form do
+ _message mail.to_s
+ end
+
+ # deliver mail
+ complete do
+ mail.deliver!
+ end
+end
diff --git a/www/secmail/views/app.js.rb b/www/secmail/views/app.js.rb
index 773cdef..fb695d6 100644
--- a/www/secmail/views/app.js.rb
+++ b/www/secmail/views/app.js.rb
@@ -11,3 +11,4 @@ require_relative 'forms/grant'
require_relative 'forms/ccla'
require_relative 'forms/nda'
require_relative 'forms/memapp'
+require_relative 'forms/forward'
diff --git a/www/secmail/views/forms/forward.js.rb b/www/secmail/views/forms/forward.js.rb
new file mode 100644
index 0000000..53a2dc1
--- /dev/null
+++ b/www/secmail/views/forms/forward.js.rb
@@ -0,0 +1,44 @@
+class Forward < React
+ def render
+ _h4 'Forward'
+
+ # forward message to appropriate destination
+ _form.doctype method: 'POST', target: 'content' do
+
+ _input type: 'hidden', name: 'message',
+ value: window.parent.location.pathname
+ _input type: 'hidden', name: 'selected', value: @@selected
+ _input type: 'hidden', name: 'signature', value: @@signature
+
+ _label do
+ _input type: 'radio', name: 'destination',
+ onClick: self.forward, value: 'accounting@apache.org'
+ _span 'accounting'
+ end
+
+ _label do
+ _input type: 'radio', name: 'destination',
+ onClick: self.forward, value: 'legal-internal@apache.org'
+ _span 'legal-internal'
+ end
+
+ _label do
+ _input type: 'radio', name: 'destination',
+ onClick: self.forward, value: 'operations@apache.org'
+ _span 'operations'
+ end
+
+ _label do
+ _input type: 'radio', name: 'destination',
+ onClick: self.forward, value: 'trademarks@apache.org'
+ _span 'trademarks'
+ end
+ end
+ end
+
+ def forward(event)
+ form = jQuery(event.target).closest('form')
+ form.attr('action', "../../tasklist/forward")
+ form.submit()
+ end
+end
diff --git a/www/secmail/views/parts.js.rb b/www/secmail/views/parts.js.rb
index d3ee121..7ed7c6a 100644
--- a/www/secmail/views/parts.js.rb
+++ b/www/secmail/views/parts.js.rb
@@ -140,6 +140,14 @@ class Parts < React
_span 'upload public key'
end
end
+
+ _hr
+
+ _label do
+ _input type: 'radio', name: 'doctype', value: 'forward',
+ onClick: -> {@form = Forward}
+ _span 'forward email'
+ end
end
elsif @form == :edit
--
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].