Module: Card::Set::All::Bridge::HtmlFormat
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- tmpsets/set/mod023-edit/all/bridge.rb
Constant Summary collapse
- BRIDGE_TABS =
{ account_tab: "Account", engage_tab: "Engage", history_tab: "History", related_tab: "Related", rules_tab: "Rules" }.freeze
Instance Method Summary collapse
- #breadcrumb_data(title, html_class = nil) ⇒ Object
- #bridge_breadcrumbs ⇒ Object
- #bridge_link_opts(opts = {}) ⇒ Object
- #bridge_param(key) ⇒ Object
- #bridge_slot_selector ⇒ Object
- #bridge_tab ⇒ Object
- #bridge_tabs ⇒ Object
- #default_bridge_tab ⇒ Object
Instance Method Details
#breadcrumb_data(title, html_class = nil) ⇒ Object
66 67 68 69 |
# File 'tmpsets/set/mod023-edit/all/bridge.rb', line 66 def title, html_class=nil html_class ||= title.underscore { "data-breadcrumb": title, "data-breadcrumb-class": html_class } end |
#bridge_breadcrumbs ⇒ Object
37 38 39 40 41 42 43 44 45 46 |
# File 'tmpsets/set/mod023-edit/all/bridge.rb', line 37 def <<-HTML.strip_heredoc <nav aria-label="breadcrumb"> <ol class="breadcrumb _bridge-breadcrumb"> <li class="breadcrumb-item">#{card.name}</li> <li class="breadcrumb-item active">Edit</li> </ol> </nav> HTML end |
#bridge_link_opts(opts = {}) ⇒ Object
48 49 50 51 52 53 54 55 |
# File 'tmpsets/set/mod023-edit/all/bridge.rb', line 48 def bridge_link_opts opts={} opts[:"data-slot-selector"] = bridge_slot_selector opts[:remote] = true add_class opts, "slotter" opts.bury :path, :layout, :overlay opts[:path][:view] ||= :content opts end |
#bridge_param(key) ⇒ Object
33 34 35 |
# File 'tmpsets/set/mod023-edit/all/bridge.rb', line 33 def bridge_param key params.dig(:bridge, key)&.to_sym || try("default_bridge_#{key}") end |
#bridge_slot_selector ⇒ Object
57 58 59 60 |
# File 'tmpsets/set/mod023-edit/all/bridge.rb', line 57 def bridge_slot_selector ".bridge-main > .overlay-container > .card-slot._bottomlay-slot," \ ".bridge-main > ._overlay-container-placeholder > .card-slot" end |
#bridge_tab ⇒ Object
29 30 31 |
# File 'tmpsets/set/mod023-edit/all/bridge.rb', line 29 def bridge_tab @bridge_tab ||= bridge_param :tab end |
#bridge_tabs ⇒ Object
23 24 25 26 27 |
# File 'tmpsets/set/mod023-edit/all/bridge.rb', line 23 def bridge_tabs wrap do lazy_loading_tabs visible_bridge_tabs, bridge_tab, _render(bridge_tab) end end |
#default_bridge_tab ⇒ Object
62 63 64 |
# File 'tmpsets/set/mod023-edit/all/bridge.rb', line 62 def default_bridge_tab show_account_tab? ? :account_tab : :engage_tab end |