Module: Card::Set::Abstract::Tabs::HtmlFormat
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- platypus/tmp/set/gem-defaults/mod030-tabs/abstract/tabs.rb
Instance Method Summary collapse
-
#default_tab ⇒ Object
-
#tab_badge(count, label, opts = {}) ⇒ Object
-
#tab_list ⇒ Object
-
#tab_map ⇒ Object
-
#tab_options ⇒ Object
-
#tab_title(label, opts) ⇒ Object
-
#view: tabs ⇒ Object
Instance Method Details
#default_tab ⇒ Object
29 30 31 |
# File 'platypus/tmp/set/gem-defaults/mod030-tabs/abstract/tabs.rb', line 29 def default_tab tab_from_params || tab_map.keys.first end |
#tab_badge(count, label, opts = {}) ⇒ Object
33 34 35 |
# File 'platypus/tmp/set/gem-defaults/mod030-tabs/abstract/tabs.rb', line 33 def tab_badge count, label, opts={} haml :tab_badge, badge_haml_opts(count, label, opts) end |
#tab_list ⇒ Object
21 22 23 |
# File 'platypus/tmp/set/gem-defaults/mod030-tabs/abstract/tabs.rb', line 21 def tab_list [] end |
#tab_map ⇒ Object
17 18 19 |
# File 'platypus/tmp/set/gem-defaults/mod030-tabs/abstract/tabs.rb', line 17 def tab_map @tab_map ||= generate_tab_map end |
#tab_options ⇒ Object
25 26 27 |
# File 'platypus/tmp/set/gem-defaults/mod030-tabs/abstract/tabs.rb', line 25 def {} end |
#tab_title(label, opts) ⇒ Object
37 38 39 40 41 |
# File 'platypus/tmp/set/gem-defaults/mod030-tabs/abstract/tabs.rb', line 37 def tab_title label, opts opts ||= {} label = tab_badge opts[:count], label, opts if opts[:count] wrap_with(:div, class: "tab-title") { label } end |
#view: tabs ⇒ Object
11 12 13 14 15 |
# File 'platypus/tmp/set/gem-defaults/mod030-tabs/abstract/tabs.rb', line 11 view :tabs, cache: :never do tabs tab_map, default_tab, load: :lazy do _render! tab_map.dig(default_tab, :view) end end |