Commit c2ee9a0e0215594496a1e140844d6270aa4a796a:
add info
Branch: refs/heads/master
Author: Sam Ruby <[email protected]>
Committer: Sam Ruby <[email protected]>
Pusher: rubys <[email protected]>
------------------------------------------------------------
spec/item_spec.rb | ++++
views/agenda.js.rb | +
views/header.js.rb | +++++++++++++
------------------------------------------------------------
56 changes: 56 additions, 0 deletions.
------------------------------------------------------------
diff --git a/spec/item_spec.rb b/spec/item_spec.rb
index e565bb1..9dbf0cc 100644
--- a/spec/item_spec.rb
+++ b/spec/item_spec.rb
@@ -12,6 +12,10 @@
expect(page).to have_selector '.navbar-fixed-top.available .navbar-brand',
text: 'Secretary'
+ # info
+ expect(page).to have_selector 'dd', text: '4D'
+ expect(page).to have_selector 'dd', text: 'Craig'
+
# content
expect(page).to have_selector 'pre', text: /is running well/
diff --git a/views/agenda.js.rb b/views/agenda.js.rb
index 64b38e4..b0a9b49 100644
--- a/views/agenda.js.rb
+++ b/views/agenda.js.rb
@@ -33,6 +33,7 @@ def initialize(entry)
end
attr_reader :attach, :title, :owner, :shepherd, :index
+ attr_reader :approved, :roster, :prior_reports
def href
@title.gsub(/[^a-zA-Z0-9]+/, '-')
diff --git a/views/header.js.rb b/views/header.js.rb
index 18e8990..2c45b9c 100644
--- a/views/header.js.rb
+++ b/views/header.js.rb
@@ -1,8 +1,58 @@
+#
+# Header: title on the left, dropdowns on the right
+
class Header < React
def render
_header.navbar.navbar_fixed_top class: @@item.color do
_div.navbar_brand @@item.title
+
_ul.nav.nav_pills.navbar_right do
+
+ # 'info' dropdown
+ #
+ if @@item.attach
+ _li.dropdown do
+ _a.dropdown_toggle.nav! data_toggle: "dropdown" do
+ _ 'info'
+ _b.caret
+ end
+
+ _dl.dropdown_menu.dl_horizontal do
+ _dt 'Attach'
+ _dd @@item.attach
+
+ if @@item.owner
+ _dt 'Author'
+ _dd @@item.owner
+ end
+
+ if @@item.shepherd
+ _dt 'Shepherd'
+ _dd @@item.shepherd
+ end
+
+ if @@item.approved # and not @@item.approved.empty?
+ _dt 'Approved'
+ _dd @@item.approved.join(', ')
+ end
+
+ if @@item.roster or @@item.prior_reports
+ _dt 'Links'
+
+ if @@item.roster
+ _dd { _a 'Roster', href: @@item.roster }
+ end
+
+ if @item.prior_reports
+ _dd { _a 'Prior Reports', href: @@item.prior_reports }
+ end
+ end
+ end
+ end
+ end
+
+ # 'navigation' dropdown
+ #
_li.dropdown do
_a.dropdown_toggle.nav! data_toggle: "dropdown" do
_ 'navigation'
@@ -17,6 +67,7 @@ def render
end
end
end
+
end
end
end