Module: Card::Set::All::Tabs::HtmlFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
card/tmpsets/set/mod030-card-mod-layout/all/tabs.rb,
card/tmpsets/set/mod031-card-mod-layout/all/tabs.rb

Instance Method Summary collapse

Instance Method Details

#construct_static_tabs(tab_type) ⇒ Object



51
52
53
54
55
56
57
# File 'card/tmpsets/set/mod030-card-mod-layout/all/tabs.rb', line 51

def construct_static_tabs tab_type
  tabs = {}
  card.item_cards.each do |item|
    tabs[item.name] = nest item, item_view_options(args)
  end
  tabs tabs, nil, tab_type: tab_type
end

#construct_tab(tabs, name, explicit_options) ⇒ Object



24
25
26
27
28
29
30
31
32
# File 'card/tmpsets/set/mod030-card-mod-layout/all/tabs.rb', line 24

def construct_tab tabs, name, explicit_options
  tab_options = item_view_options explicit_options
  tabs[:paths][name] = {
    title: nest(name, view: :title, title: tab_options[:title]),
    path: nest_path(name, tab_options).html_safe
  }
  return unless tabs[:active].empty?
  tabs[:active] = { name: name, content: nest(name, tab_options) }
end

#construct_tabs(tab_type) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'card/tmpsets/set/mod030-card-mod-layout/all/tabs.rb', line 13

def construct_tabs tab_type
  tabs = { active: {}, paths: {} }
  voo.items[:view] ||= :content
  card.each_item_name_with_options(_render_raw) do |name, options|
    construct_tab tabs, name, options
  end
  tabs tabs[:paths], tabs[:active][:name], tab_type: tab_type, load: :lazy do
    tabs[:active][:content]
  end
end

#view: pillsObject

def tab_title title, name return name unless title name.to_name.title title, @context_names end



39
40
41
# File 'card/tmpsets/set/mod030-card-mod-layout/all/tabs.rb', line 39

view :pills do
  construct_tabs "pills"
end

#view: pills_staticObject



47
48
49
# File 'card/tmpsets/set/mod030-card-mod-layout/all/tabs.rb', line 47

view :pills_static do
  construct_static_tabs "pills"
end

#view: tabsObject



9
10
11
# File 'card/tmpsets/set/mod030-card-mod-layout/all/tabs.rb', line 9

view :tabs do
  construct_tabs "tabs"
end

#view: tabs_staticObject



43
44
45
# File 'card/tmpsets/set/mod030-card-mod-layout/all/tabs.rb', line 43

view :tabs_static do
  construct_static_tabs "tabs"
end