Module: Card::Set::All::Tabs::HtmlFormat
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- platypus/tmp/set/gem-defaults/mod030-tabs/all/tabs.rb
Instance Method Summary collapse
-
#construct_static_tabs(tab_type) ⇒ Object
-
#construct_tab(tabs, name, explicit_options) ⇒ Object
-
#construct_tabs(tab_type) ⇒ Object
-
#tabs(tab_hash, active_name = nil, args = {}, &block) ⇒ HTML
beginning (default is the first).
-
#view: pills ⇒ Object
def tab_title title, name return name unless title name.to_name.title title, @context_names end.
-
#view: pills_static ⇒ Object
-
#view: tabs ⇒ Object
-
#view: tabs_static ⇒ Object
Instance Method Details
#construct_static_tabs(tab_type) ⇒ Object
91 92 93 94 95 96 97 |
# File 'platypus/tmp/set/gem-defaults/mod030-tabs/all/tabs.rb', line 91 def construct_static_tabs tab_type tabs = {} card.item_cards.each do |item| tabs[item.name] = nest item, (args) end tabs tabs, nil, tab_type: tab_type end |
#construct_tab(tabs, name, explicit_options) ⇒ Object
63 64 65 66 67 68 69 70 71 72 |
# File 'platypus/tmp/set/gem-defaults/mod030-tabs/all/tabs.rb', line 63 def construct_tab tabs, name, = tabs[:paths][name] = { title: nest(name, view: :title, title: [:title]), path: nest_path(name, ).html_safe } return unless tabs[:active].empty? tabs[:active] = { name: name, content: nest(name, ) } end |
#construct_tabs(tab_type) ⇒ Object
52 53 54 55 56 57 58 59 60 61 |
# File 'platypus/tmp/set/gem-defaults/mod030-tabs/all/tabs.rb', line 52 def construct_tabs tab_type tabs = { active: {}, paths: {} } voo.items[:view] ||= :content card.(_render_raw) do |name, | construct_tab tabs, name, end tabs tabs[:paths], tabs[:active][:name], tab_type: tab_type, load: :lazy do tabs[:active][:content] end end |
#tabs(tab_hash, active_name = nil, args = {}, &block) ⇒ HTML
beginning (default is the first)
36 37 38 39 40 41 42 43 44 45 46 |
# File 'platypus/tmp/set/gem-defaults/mod030-tabs/all/tabs.rb', line 36 def tabs tab_hash, active_name=nil, args={}, &block klass = args[:load] == :lazy ? Card::LazyTab : Card::Tab args.reverse_merge!( panel_attr: {}, pane_attr: {}, tab_type: "tabs", block: block, tab_objects: Card::Tab.tab_objects(self, tab_hash, active_name, klass) ) haml :tab_panel, args end |
#view: pills ⇒ Object
def tab_title title, name return name unless title name.to_name.title title, @context_names end
79 80 81 |
# File 'platypus/tmp/set/gem-defaults/mod030-tabs/all/tabs.rb', line 79 view :pills do construct_tabs "pills" end |
#view: pills_static ⇒ Object
87 88 89 |
# File 'platypus/tmp/set/gem-defaults/mod030-tabs/all/tabs.rb', line 87 view :pills_static do construct_static_tabs "pills" end |
#view: tabs ⇒ Object
48 49 50 |
# File 'platypus/tmp/set/gem-defaults/mod030-tabs/all/tabs.rb', line 48 view :tabs do construct_tabs "tabs" end |
#view: tabs_static ⇒ Object
83 84 85 |
# File 'platypus/tmp/set/gem-defaults/mod030-tabs/all/tabs.rb', line 83 view :tabs_static do construct_static_tabs "tabs" end |