Module: ControlCenter::Helpers::LayoutHelper

Defined in:
lib/control_center/helpers/layout_helper.rb

Instance Method Summary collapse

Instance Method Details

#current_sub_tabObject



30
31
32
# File 'lib/control_center/helpers/layout_helper.rb', line 30

def current_sub_tab
  @cc_current_sub_tab
end

#current_tabObject



15
16
17
# File 'lib/control_center/helpers/layout_helper.rb', line 15

def current_tab
  @cc_current_tab
end

#select_sub_tab(tab) ⇒ Object



27
28
29
# File 'lib/control_center/helpers/layout_helper.rb', line 27

def select_sub_tab(tab)
  @cc_current_sub_tab = tab
end

#select_tab(tab) ⇒ Object



12
13
14
# File 'lib/control_center/helpers/layout_helper.rb', line 12

def select_tab(tab)
  @cc_current_tab = tab
end

Sets up a sidebar in control center.



35
36
37
38
39
40
41
42
# File 'lib/control_center/helpers/layout_helper.rb', line 35

def sidebar
  if block_given?
    @sidebar_set = true
    content_for :sidebar do
      yield
    end
  end
end

#sidebar?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/control_center/helpers/layout_helper.rb', line 44

def sidebar?
  @sidebar_set ||= false
end

#sub_tab(tab_name, tab_url) ⇒ Object



56
57
58
59
60
61
62
# File 'lib/control_center/helpers/layout_helper.rb', line 56

def sub_tab(tab_name, tab_url)
  options = {}
  options[:class] = "active" if  current_sub_tab == tab_name
   "li", options, true do
    link_to tab_name, tab_url
  end
end

#sub_tabsObject



19
20
21
22
23
24
25
# File 'lib/control_center/helpers/layout_helper.rb', line 19

def sub_tabs
  if block_given?
    content_for :sub_tabs do
      yield
    end
  end
end

#tab(tab_name, tab_url) ⇒ Object



48
49
50
51
52
53
54
# File 'lib/control_center/helpers/layout_helper.rb', line 48

def tab(tab_name, tab_url)
  options = {}
  options[:class] = "active" if  current_tab == tab_name
   "li", options, true do
    link_to tab_name, tab_url
  end
end

#title(title) ⇒ Object



8
9
10
# File 'lib/control_center/helpers/layout_helper.rb', line 8

def title(title)
  @control_center_title = title
end