Class: Radmin::AdminUI

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/radmin/admin_ui.rb

Defined Under Namespace

Classes: DuplicateTabNameError, NavSubItem, NavTab

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAdminUI

Returns a new instance of AdminUI.



111
112
113
114
# File 'lib/radmin/admin_ui.rb', line 111

def initialize
  @nav = NavTab.new("Tab Container")
  load_default_nav
end

Instance Attribute Details

Returns the value of attribute nav.



109
110
111
# File 'lib/radmin/admin_ui.rb', line 109

def nav
  @nav
end

Class Method Details

.tab(name, &block) ⇒ Object



95
96
97
98
99
100
101
102
103
104
105
# File 'lib/radmin/admin_ui.rb', line 95

def tab(name,&block)
  the_tab = instance.nav[name]
  unless the_tab
    the_tab = NavTab.new(name)
    instance.nav << the_tab
  end
  if block_given?
    yield(the_tab)
  end
  the_tab
end

Instance Method Details



120
121
122
# File 'lib/radmin/admin_ui.rb', line 120

def nav_item(*args)
  NavSubItem.new(*args)
end


116
117
118
# File 'lib/radmin/admin_ui.rb', line 116

def nav_tab(*args)
  NavTab.new(*args)
end