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: add a 'send feedback' button
Date Tue, 19 Apr 2016 17:50:31 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  519098c   add a 'send feedback' button
519098c is described below

commit 519098cf2983bfa936530d0879e2e5e9fd9d9456
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Tue Apr 19 13:50:13 2016 -0400

    add a 'send feedback' button
---
 www/board/agenda/routes.rb                    |  2 +-
 www/board/agenda/views/app.js.rb              |  1 +
 www/board/agenda/views/buttons/feedback.js.rb | 12 ++++++++++++
 www/board/agenda/views/models/agenda.js.rb    | 10 ++++++++--
 4 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/www/board/agenda/routes.rb b/www/board/agenda/routes.rb
index 241ce9e..0cce25e 100755
--- a/www/board/agenda/routes.rb
+++ b/www/board/agenda/routes.rb
@@ -116,7 +116,7 @@ get %r{/(\d\d\d\d-\d\d-\d\d)/(.*)} do |date, path|
 end
 
 # append slash to agenda page if not present
-get %r{/(\d\d\d\d-\d\d-\d\d)$} do |date|
+get %r{^/(\d\d\d\d-\d\d-\d\d)$} do |date|
   redirect to("/#{date}/")
 end
 
diff --git a/www/board/agenda/views/app.js.rb b/www/board/agenda/views/app.js.rb
index eaf9905..5d9d3e3 100644
--- a/www/board/agenda/views/app.js.rb
+++ b/www/board/agenda/views/app.js.rb
@@ -42,6 +42,7 @@ 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
new file mode 100644
index 0000000..8d3906a
--- /dev/null
+++ b/www/board/agenda/views/buttons/feedback.js.rb
@@ -0,0 +1,12 @@
+#
+# SendFeedback
+#
+class SendFeedback < React
+  def render
+    _button.btn.btn_warning 'send feedback', onClick: self.click
+  end
+
+  def click(event)
+    window.location.href = 'feedback'
+  end
+end
diff --git a/www/board/agenda/views/models/agenda.js.rb b/www/board/agenda/views/models/agenda.js.rb
index a4fd3d3..642d3eb 100644
--- a/www/board/agenda/views/models/agenda.js.rb
+++ b/www/board/agenda/views/models/agenda.js.rb
@@ -190,6 +190,8 @@ class Agenda
         list << {form: PublishMinutes}
       elsif Minutes.ready_to_post_draft
         list << {form: DraftMinutes}
+      else
+        list << {button: SendFeedback}
       end
     end
 
@@ -387,8 +389,12 @@ class Agenda
         then
           list << {form: PublishMinutes}
         end
-      elsif @title == 'Adjournment' and Minutes.ready_to_post_draft
-        list << {form: DraftMinutes}
+      elsif @title == 'Adjournment' 
+        if Minutes.ready_to_post_draft
+          list << {form: DraftMinutes}
+        else
+          list << {button: SendFeedback}
+        end
       end
     end
 

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

Mime
View raw message