Browse Source

Merge pull request #87 from spacemunkay/move-brands-80

Moved brands/models tab to the lower pane of bikes
topic-sass
Jason Denney 11 years ago
parent
commit
bca0903862
  1. 6
      app/components/app_tab_panel.rb
  2. 10
      app/components/bike_logs_and_tasks_accordian.rb
  3. 12
      app/components/bike_lower_tabs.rb
  4. 4
      app/components/bikes_border.rb

6
app/components/app_tab_panel.rb

@ -19,11 +19,7 @@ class AppTabPanel < Netzke::Basepack::TabPanel
#all users #all users
# (had to use hash for borders to get the title to display properly) # (had to use hash for borders to get the title to display properly)
@@app_tab_panel_items = [ :bikes_border, @@app_tab_panel_items = [ :bikes_border ]
{ layout: :fit,
wrappedComponent: :brands_and_models_border,
title: "Brands/Models"}
]
#for users only #for users only
if not controller.current_user.role?(:admin) if not controller.current_user.role?(:admin)

10
app/components/bike_logs_and_tasks_accordian.rb

@ -1,10 +0,0 @@
class BikeLogsAndTasksAccordian < Netzke::Basepack::Accordion
component :bike_logs
component :tasks
def configure(c)
c.prevent_header = true
c.items = [ :bike_logs, :tasks ]
super
end
end

12
app/components/bike_lower_tabs.rb

@ -0,0 +1,12 @@
class BikeLowerTabs < Netzke::Basepack::TabPanel
component :bike_logs
component :tasks
component :brands_and_models_border
def configure(c)
c.prevent_header = true
c.items = [ :bike_logs, :tasks,
{netzke_component: :brands_and_models_border, title: "Brands and Models"} ]
super
end
end

4
app/components/bikes_border.rb

@ -2,7 +2,7 @@ class BikesBorder < Netzke::Base
# Remember regions collapse state and size # Remember regions collapse state and size
include Netzke::Basepack::ItemPersistence include Netzke::Basepack::ItemPersistence
component :bikes component :bikes
component :bike_logs_and_tasks_accordian component :bike_lower_tabs
def configure(c) def configure(c)
super super
@ -10,7 +10,7 @@ class BikesBorder < Netzke::Base
c.title = "Bikes" c.title = "Bikes"
c.items = [ c.items = [
{ netzke_component: :bikes, region: :center, split: true }, { netzke_component: :bikes, region: :center, split: true },
{ netzke_component: :bike_logs_and_tasks_accordian, region: :south, height: 300, split: true} { netzke_component: :bike_lower_tabs, region: :south, height: 300, split: true}
] ]
end end

Loading…
Cancel
Save