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

Instance Method Details



66
67
68
69
# File 'tmpsets/set/mod023-edit/all/bridge.rb', line 66

def breadcrumb_data title, html_class=nil
  html_class ||= title.underscore
  { "data-breadcrumb": title, "data-breadcrumb-class": html_class }
end

#bridge_breadcrumbsObject



37
38
39
40
41
42
43
44
45
46
# File 'tmpsets/set/mod023-edit/all/bridge.rb', line 37

def bridge_breadcrumbs
  <<-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


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_selectorObject



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_tabObject



29
30
31
# File 'tmpsets/set/mod023-edit/all/bridge.rb', line 29

def bridge_tab
  @bridge_tab ||= bridge_param :tab
end

#bridge_tabsObject



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_tabObject



62
63
64
# File 'tmpsets/set/mod023-edit/all/bridge.rb', line 62

def default_bridge_tab
   ? :account_tab : :engage_tab
end