whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Ruby <ru...@apache.org>
Subject [whimsy.git] [26/50] Commit 1219872: rough in a button
Date Fri, 22 Jan 2016 02:40:55 GMT
Commit 12198728913b40a44efdef673efa6fc32d2f2815:
    rough in a button


Branch: refs/heads/master
Author: Sam Ruby <rubys@intertwingly.net>
Committer: Sam Ruby <rubys@intertwingly.net>
Pusher: rubys <rubys@apache.org>

------------------------------------------------------------
public/stylesheets/app.css                                   | +++++ -
views/agenda.js.rb                                           | ++++++ 
views/app.js.rb                                              | +++ 
views/footer.js.rb                                           | +++++++++ 
------------------------------------------------------------
33 changes: 32 additions, 1 deletions.
------------------------------------------------------------


diff --git a/public/stylesheets/app.css b/public/stylesheets/app.css
index d60d119..b518248 100644
--- a/public/stylesheets/app.css
+++ b/public/stylesheets/app.css
@@ -156,7 +156,11 @@ footer .btn {
 }
 
 .modal-body {
-  background-color: white
+  background-color: white;
+}
+
+.modal-content {
+  text-align: left;
 }
 
 body {
diff --git a/views/agenda.js.rb b/views/agenda.js.rb
index 55729a9..e00e6ad 100644
--- a/views/agenda.js.rb
+++ b/views/agenda.js.rb
@@ -106,6 +106,12 @@ def view
     Report
   end
 
+  def buttons
+    [
+      (AddComment unless @comments === undefined)
+    ]
+  end
+
   def color
     if not @title
       'blank'
diff --git a/views/app.js.rb b/views/app.js.rb
index 67d0ab8..62fa318 100644
--- a/views/app.js.rb
+++ b/views/app.js.rb
@@ -9,6 +9,9 @@
 require_relative 'search'
 require_relative 'comments'
 
+# Button + forms
+require_relative 'add-comment'
+
 # Common elements
 require_relative 'link'
 
diff --git a/views/footer.js.rb b/views/footer.js.rb
index 3838fb5..9f70025 100644
--- a/views/footer.js.rb
+++ b/views/footer.js.rb
@@ -1,4 +1,16 @@
 class Footer < React
+  def initialize
+    @buttons = nil
+  end
+
+  def componentWillMount()
+    self.componentWillReceiveProps(self.props)
+  end
+
+  def componentWillReceiveProps(newprops)
+    @buttons = newprops.item.buttons
+  end
+
   def render
     _footer.navbar.navbar_fixed_bottom class: @@item.color do
       if @@item.prev
@@ -6,6 +18,12 @@ def render
          href: @@item.prev.href
       end
 
+      if @buttons
+        @buttons.each do |button|
+          React.createElement(button, item: @@item) if button
+        end
+      end
+
       if @@item.next
         _Link.nextlink.navbar_brand text: @@item.next.title, rel: 'next', 
          href: @@item.next.href

Mime
View raw message