Class: Radiant::AdminUI
- Includes:
- Simpleton
- Defined in:
- lib/radiant/admin_ui.rb
Defined Under Namespace
Classes: DuplicateTabNameError, NavSubItem, NavTab, RegionPartials, RegionSet
Instance Attribute Summary collapse
-
#nav ⇒ Object
Returns the value of attribute nav.
Instance Method Summary collapse
-
#initialize ⇒ AdminUI
constructor
A new instance of AdminUI.
- #load_default_nav ⇒ Object
- #load_default_regions ⇒ Object
- #nav_item(*args) ⇒ Object
- #nav_tab(*args) ⇒ Object
- #tabs ⇒ Object
Methods included from Simpleton
Constructor Details
Instance Attribute Details
#nav ⇒ Object
Returns the value of attribute nav.
93 94 95 |
# File 'lib/radiant/admin_ui.rb', line 93 def nav @nav end |
Instance Method Details
#load_default_nav ⇒ Object
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/radiant/admin_ui.rb', line 118 def load_default_nav content = nav_tab(:content, "Content") content << nav_item(:pages, "Pages", "/admin/pages") nav << content design = nav_tab(:design, "Design", [:designer, :admin]) design << nav_item(:layouts, "Layouts", "/admin/layouts") design << nav_item(:snippets, "Snippets", "/admin/snippets") nav << design # media = NavTab.new(:assets, "Assets") # media << NavSubItem.new(:all, "All", "/admin/assets/") # media << NavSubItem.new(:all, "Unattached", "/admin/assets/unattached/") settings = nav_tab(:settings, "Settings") settings << nav_item(:general, "Personal", "/admin/preferences/edit") settings << nav_item(:users, "Users", "/admin/users") settings << nav_item(:extensions, "Extensions", "/admin/extensions") nav << settings end |
#load_default_regions ⇒ Object
139 140 141 142 143 144 145 |
# File 'lib/radiant/admin_ui.rb', line 139 def load_default_regions @page = load_default_page_regions @snippet = load_default_snippet_regions @layout = load_default_layout_regions @user = load_default_user_regions @extension = load_default_extension_regions end |
#nav_item(*args) ⇒ Object
99 100 101 |
# File 'lib/radiant/admin_ui.rb', line 99 def nav_item(*args) NavSubItem.new(*args) end |
#nav_tab(*args) ⇒ Object
95 96 97 |
# File 'lib/radiant/admin_ui.rb', line 95 def nav_tab(*args) NavTab.new(*args) end |
#tabs ⇒ Object
103 104 105 |
# File 'lib/radiant/admin_ui.rb', line 103 def tabs nav[:content] end |