whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: Move send feedback link to main part of the adjournment page
Date Sun, 31 Jul 2016 23:30:32 GMT
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  4841313   Move send feedback link to main part of the adjournment page
4841313 is described below

commit 484131324a438c6051f54f4d51b3a31e294604a0
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Sun Jul 31 19:29:47 2016 -0400

    Move send feedback link to main part of the adjournment page
---
 www/board/agenda/views/actions/feedback.json.rb |  3 +++
 www/board/agenda/views/app.js.rb                |  1 -
 www/board/agenda/views/buttons/feedback.js.rb   | 13 -------------
 www/board/agenda/views/feedback.html.rb         |  2 +-
 www/board/agenda/views/models/agenda.js.rb      |  1 -
 www/board/agenda/views/pages/adjournment.js.rb  | 21 +++++++++++++++++++++
 6 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/www/board/agenda/views/actions/feedback.json.rb b/www/board/agenda/views/actions/feedback.json.rb
index df6a6a1..fa8e4ed 100644
--- a/www/board/agenda/views/actions/feedback.json.rb
+++ b/www/board/agenda/views/actions/feedback.json.rb
@@ -16,6 +16,8 @@ else
   minutes = {}
 end
 
+feedback_sent = minutes[:todos][:feedback_sent] rescue []
+
 # extract values for common fields
 if @from
   from = @from
@@ -89,6 +91,7 @@ Agenda.parse(@agenda, :full).each do |item|
   output << {
     attach: item[:attach],
     title: item['title'],
+    sent: feedback_sent.include?(item['title']),
     mail: mail.to_s
   }
 end
diff --git a/www/board/agenda/views/app.js.rb b/www/board/agenda/views/app.js.rb
index 26095b6..21fbdce 100644
--- a/www/board/agenda/views/app.js.rb
+++ b/www/board/agenda/views/app.js.rb
@@ -44,7 +44,6 @@ require_relative 'buttons/showseen'
 require_relative 'buttons/timestamp'
 require_relative 'buttons/vote'
 require_relative 'buttons/email'
-require_relative 'buttons/feedback'
 
 # Common elements
 require_relative 'elements/additional-info'
diff --git a/www/board/agenda/views/buttons/feedback.js.rb b/www/board/agenda/views/buttons/feedback.js.rb
deleted file mode 100644
index 4e8b379..0000000
--- a/www/board/agenda/views/buttons/feedback.js.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# SendFeedback
-#
-class SendFeedback < React
-  def render
-    _button.btn.btn_warning 'send feedback to PMCs', onClick: self.click,
-    title: 'prepare feedback for PMCs from board meeting'
-  end
-
-  def click(event)
-    window.location.href = 'feedback'
-  end
-end
diff --git a/www/board/agenda/views/feedback.html.rb b/www/board/agenda/views/feedback.html.rb
index 9a5066e..23a2bc9 100644
--- a/www/board/agenda/views/feedback.html.rb
+++ b/www/board/agenda/views/feedback.html.rb
@@ -30,7 +30,7 @@ _html do
           input.setAttribute('type', 'checkbox');
           input.setAttribute('name', 'checked[' +
             message.title.replace(/\s/g, '_') + ']');
-          input.checked = true;
+          input.checked = !message.sent;
           h1.insertBefore(input, h1.firstChild);
 
           var pre = document.createElement('pre');
diff --git a/www/board/agenda/views/models/agenda.js.rb b/www/board/agenda/views/models/agenda.js.rb
index 519362d..8fc3b5b 100644
--- a/www/board/agenda/views/models/agenda.js.rb
+++ b/www/board/agenda/views/models/agenda.js.rb
@@ -242,7 +242,6 @@ class Agenda
 
     if Server.role == :secretary 
       if Server.drafts.include? Agenda.file.sub('agenda', 'minutes')
-        list << {button: SendFeedback}
         list << {form: PublishMinutes}
       elsif Minutes.ready_to_post_draft
         list << {form: DraftMinutes}
diff --git a/www/board/agenda/views/pages/adjournment.js.rb b/www/board/agenda/views/pages/adjournment.js.rb
index 3795d5f..9dbd1e1 100644
--- a/www/board/agenda/views/pages/adjournment.js.rb
+++ b/www/board/agenda/views/pages/adjournment.js.rb
@@ -8,6 +8,7 @@ class Adjournment < React
       add: [],
       remove: [],
       establish: [],
+      feedback: [],
       loading: true,
       fetched: false
     })
@@ -44,6 +45,10 @@ class Adjournment < React
         unless Todos.establish.empty?
           _EstablishActions action: 'remove'
         end
+
+        unless Todos.feedback.empty?
+          _FeedbackReminder
+        end
       end
 
       _section do
@@ -279,6 +284,22 @@ class EstablishActions < React
   end
 end
 
+########################################################################
+#                      Reminder to draft feedback                      #
+########################################################################
+
+class FeedbackReminder < React
+  def render
+    _p 'Draft feedback:'
+
+    _ul Todos.feedback do |title|
+      _li title
+    end
+
+    _button.checklist.btn.btn_default 'Submit',
+      onClick:-> {window.location.href = 'feedback'}
+  end
+end
 
 ########################################################################
 #                             shared state                             #

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message