Browse Source

Moved brands/models tab to the lower pane of bikes

topic-sass
Ron Warholic 11 years ago
parent
commit
9300ef83d1
  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
# (had to use hash for borders to get the title to display properly)
@@app_tab_panel_items = [ :bikes_border,
{ layout: :fit,
wrappedComponent: :brands_and_models_border,
title: "Brands/Models"}
]
@@app_tab_panel_items = [ :bikes_border ]
#for users only
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
include Netzke::Basepack::ItemPersistence
component :bikes
component :bike_logs_and_tasks_accordian
component :bike_lower_tabs
def configure(c)
super
@ -10,7 +10,7 @@ class BikesBorder < Netzke::Base
c.title = "Bikes"
c.items = [
{ 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

Loading…
Cancel
Save