You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by Sebastian Bazley <se...@apache.org> on 2016/03/18 17:53:12 UTC

[whimsy.git] [2/2] Commit 87545aa: Merge branch 'master' of https://github.com/apache/whimsy

Commit 87545aa4ee246390009aed8766db600b636c3f72:
    Merge branch 'master' of https://github.com/apache/whimsy


Branch: refs/heads/master
Author: Sebb <se...@apache.org>
Committer: Sebb <se...@apache.org>
Pusher: sebb <se...@apache.org>

------------------------------------------------------------
lib/whimsy/asf/mail.rb                                       | + -
www/board/agenda/views/actions/feedback.json.rb              | + 
www/board/agenda/views/feedback.html.rb                      | +++++++++ ----
------------------------------------------------------------
28 changes: 20 additions, 8 deletions.
------------------------------------------------------------


diff --git a/lib/whimsy/asf/mail.rb b/lib/whimsy/asf/mail.rb
index 62701c2..c7629c7 100644
--- a/lib/whimsy/asf/mail.rb
+++ b/lib/whimsy/asf/mail.rb
@@ -117,7 +117,7 @@ def mail_list
       when 'executive assistant'
         'ea@apache.org'
       when 'legal affairs'
-        'legal-discuss@apache.org'
+        'legal-internal@apache.org'
       when 'marketing and publicity'
         'press@apache.org'
       when 'tac'
diff --git a/www/board/agenda/views/actions/feedback.json.rb b/www/board/agenda/views/actions/feedback.json.rb
index a3df23f..d014531 100644
--- a/www/board/agenda/views/actions/feedback.json.rb
+++ b/www/board/agenda/views/actions/feedback.json.rb
@@ -31,6 +31,7 @@
   # select exec officer, additional officer, and committee reports
   next unless item[:attach] =~ /^(4[A-Z]|\d|[A-Z]+)$/
   next unless item['chair_email']
+  next unless @dryrun or @checked[item['title'].gsub(/\s/, '_')]
 
   # collect comments and minutes
   text = ''
diff --git a/www/board/agenda/views/feedback.html.rb b/www/board/agenda/views/feedback.html.rb
index a5af238..9a5066e 100644
--- a/www/board/agenda/views/feedback.html.rb
+++ b/www/board/agenda/views/feedback.html.rb
@@ -1,6 +1,7 @@
 _html do
-  _head do
-    _style %{
+  _head_ do
+    _meta name: "viewport", content: 'width=device-width', initial_scale: 1
+    _style_ %{
       div:empty {display: none}
     }
   end
@@ -8,25 +9,34 @@
   _body do
     _div.alert
 
-    _form method: 'post' do
+    _form_ method: 'post' do
       _button.btn.btn_primary 'Send email', type: 'submit', disabled: true
     end
 
-    _p 'loading'
+    _p_ 'loading'
 
-    _script %{
+    _script %q{
       var button = document.querySelector('button');
       var alert = document.querySelector('.alert');
+      var form = document.querySelector('form');
 
       jQuery.getJSON('feedback.json', function(data) {
         data.forEach(function(message) {
           var h1 = document.createElement('h1');
           h1.setAttribute('id', message.title);
           h1.textContent = message.title;
+
+          var input = document.createElement('input');
+          input.setAttribute('type', 'checkbox');
+          input.setAttribute('name', 'checked[' +
+            message.title.replace(/\s/g, '_') + ']');
+          input.checked = true;
+          h1.insertBefore(input, h1.firstChild);
+
           var pre = document.createElement('pre');
           pre.textContent = message.mail;
-          document.body.appendChild(h1);
-          document.body.appendChild(pre);
+          form.appendChild(h1);
+          form.appendChild(pre);
         });
 
         document.querySelector('p').remove();
@@ -39,6 +49,7 @@
         button.disabled = true;
         jQuery.ajax('feedback.json', {
           method: 'POST',
+          data: $(form).serialize(),
 
           success: function(event) {
             alert.classList.add('alert-success');