Browse Source

Changed tab titles, and removed some redundant panel headers(titles)

denney-disable-on-select
Jason Denney 12 years ago
parent
commit
92f7a3178c
  1. 14
      app/components/app_tab_panel.rb
  2. 3
      app/components/brands_and_models_border.rb
  3. 1
      app/components/logs.rb
  4. 2
      app/components/user_profile_border.rb
  5. 2
      app/components/users_and_profiles_border.rb

14
app/components/app_tab_panel.rb

@ -1,5 +1,6 @@
class AppTabPanel < Netzke::Basepack::TabPanel class AppTabPanel < Netzke::Basepack::TabPanel
action :sign_out do |c| action :sign_out do |c|
c.icon = :door_out c.icon = :door_out
c.text = "Sign out #{controller.current_user.email}" if controller.current_user c.text = "Sign out #{controller.current_user.email}" if controller.current_user
@ -8,19 +9,26 @@ class AppTabPanel < Netzke::Basepack::TabPanel
def configure(c) def configure(c)
#all users #all users
@@app_tab_panel_items = [ :bikes_border, :brands_and_models_border] # (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"}]
#for users #for users
if controller.current_user.user? if controller.current_user.user?
@@app_tab_panel_items.concat [:user_profile_border] # (had to use hash for borders to get the title to display properly)
@@app_tab_panel_items.concat [{ layout: :fit, wrappedComponent: :user_profile_border, title: "Profile"}]
end end
#for admins #for admins
if controller.current_user.admin? if controller.current_user.admin?
@@app_tab_panel_items.concat [:users_and_profiles_border, :logs] # (had to use hash for borders to get the title to display properly)
@@app_tab_panel_items.concat [{ layout: :fit, wrappedComponent: :users_and_profiles_border, title: "Users/Profiles"}, :logs]
end end
@@app_tab_panel_items.each do |item| @@app_tab_panel_items.each do |item|
if item.kind_of?(Symbol)
self.class.component item self.class.component item
elsif item.kind_of?(Hash)
self.class.component item[:wrappedComponent]
end
end end
c.active_tab = 0 c.active_tab = 0

3
app/components/brands_and_models_border.rb

@ -1,3 +1,4 @@
class BrandsAndModelsBorder < Netzke::Base class BrandsAndModelsBorder < Netzke::Base
# Remember regions collapse state and size # Remember regions collapse state and size
include Netzke::Basepack::ItemPersistence include Netzke::Basepack::ItemPersistence
@ -5,7 +6,7 @@ class BrandsAndModelsBorder < Netzke::Base
component :bike_models component :bike_models
def configure(c) def configure(c)
super super
c.title = "Brands/Models" c.header = false
c.items = [ c.items = [
{ netzke_component: :bike_brands, region: :center, split: true }, { netzke_component: :bike_brands, region: :center, split: true },
{ netzke_component: :bike_models, region: :east, width: 500, split: true} { netzke_component: :bike_models, region: :east, width: 500, split: true}

1
app/components/logs.rb

@ -2,6 +2,7 @@ class Logs < Netzke::Basepack::Grid
def configure(c) def configure(c)
super super
c.header = false
c.model = "ActsAsLoggable::Log" c.model = "ActsAsLoggable::Log"
c.columns = [ c.columns = [
:loggable_id, :loggable_id,

2
app/components/user_profile_border.rb

@ -7,7 +7,7 @@ class UserProfileBorder < Netzke::Base
def configure(c) def configure(c)
super super
c.title = "Profile" c.header = false
c.items = [ c.items = [
{ netzke_component: :user_logs, region: :center, split: true}, { netzke_component: :user_logs, region: :center, split: true},
{ netzke_component: :user_stats, region: :east, width: 350, split: true}, { netzke_component: :user_stats, region: :east, width: 350, split: true},

2
app/components/users_and_profiles_border.rb

@ -7,7 +7,7 @@ class UsersAndProfilesBorder < Netzke::Base
def configure(c) def configure(c)
super super
c.title = "Users/Profiles" c.header = false
c.items = [ c.items = [
{ netzke_component: :users, region: :center, width: 300, split: true }, { netzke_component: :users, region: :center, width: 300, split: true },
{ netzke_component: :user_profiles, region: :south, height: 150, split: true}, { netzke_component: :user_profiles, region: :south, height: 150, split: true},

Loading…
Cancel
Save