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

Extended by:
Card::Set::AbstractFormat
Defined in:
tmpsets/set/mod003-core/all/tabs.rb

Instance Method Summary collapse

Instance Method Details

#construct_static_tabs(tab_type) ⇒ Object



50
51
52
53
54
55
56
# File 'tmpsets/set/mod003-core/all/tabs.rb', line 50

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

#construct_tab(tabs, name, explicit_options) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'tmpsets/set/mod003-core/all/tabs.rb', line 23

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
# File 'tmpsets/set/mod003-core/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
  lazy_loading_tabs tabs[:paths], tabs[:active][:name],
                    tabs[:active][:content], type: tab_type
end