Module: Card::Set::All::Bridge::HtmlFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
card/tmpsets/set/mod012-card-mod-edit/all/bridge.rb,
card/tmpsets/set/mod011-card-mod-edit/all/bridge.rb

Instance Method Summary collapse

Instance Method Details



67
68
69
70
# File 'card/tmpsets/set/mod012-card-mod-edit/all/bridge.rb', line 67

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

#bridge_breadcrumbsObject



38
39
40
41
42
43
44
45
46
47
# File 'card/tmpsets/set/mod012-card-mod-edit/all/bridge.rb', line 38

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


49
50
51
52
53
54
55
56
# File 'card/tmpsets/set/mod012-card-mod-edit/all/bridge.rb', line 49

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



34
35
36
# File 'card/tmpsets/set/mod012-card-mod-edit/all/bridge.rb', line 34

def bridge_param key
  params.dig(:bridge, key)&.to_sym || try("default_bridge_#{key}")
end

#bridge_slot_selectorObject



58
59
60
61
# File 'card/tmpsets/set/mod012-card-mod-edit/all/bridge.rb', line 58

def bridge_slot_selector
  ".bridge-main > .overlay-container > .card-slot._bottomlay-slot," \
  ".bridge-main > ._overlay-container-placeholder > .card-slot"
end

#bridge_tabObject



30
31
32
# File 'card/tmpsets/set/mod012-card-mod-edit/all/bridge.rb', line 30

def bridge_tab
  @bridge_tab ||= bridge_param :tab
end

#bridge_tabsObject



24
25
26
27
28
# File 'card/tmpsets/set/mod012-card-mod-edit/all/bridge.rb', line 24

def bridge_tabs
  wrap do
    tabs(visible_bridge_tabs, bridge_tab, load: :lazy) { _render bridge_tab }
  end
end

#default_bridge_tabObject



63
64
65
# File 'card/tmpsets/set/mod012-card-mod-edit/all/bridge.rb', line 63

def default_bridge_tab
  show_guide_tab? ? :guide_tab : :engage_tab
end