Module: Card::Set::All::Board::HtmlFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
platypus/tmp/set/gem-defaults/mod011-edit/all/board.rb

Instance Method Summary collapse

Instance Method Details

#board_breadcrumbsObject



44
45
46
47
48
49
50
51
52
53
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/board.rb', line 44

def board_breadcrumbs
  <<-HTML.strip_heredoc
  <nav aria-label="breadcrumb">
    <ol class="breadcrumb _board-breadcrumb">
      <li class="breadcrumb-item">#{card.name}</li>
      <li class="breadcrumb-item active">Edit</li>
    </ol>
  </nav>
  HTML
end


55
56
57
58
59
60
61
62
63
64
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/board.rb', line 55

def board_link_opts opts={}
  opts[:"data-slot-selector"] = board_slot_selector
  opts[:"data-slotter-mode"] = :override
  opts[:remote] = true
  add_class opts, "slotter"
  opts.bury :path, :layout, :overlay
  opts.bury :path, :slot, :items, :view, :closed
  opts[:path][:view] ||= :content
  opts
end

#board_menuObject



80
81
82
83
84
85
86
87
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/board.rb', line 80

def board_menu
  wrap_with_modal_menu do
    [
      render_close_modal_link,
      switch_to_edit_link
    ]
  end
end

#board_param(key) ⇒ Object



40
41
42
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/board.rb', line 40

def board_param key
  params.dig(:board, key)&.to_sym || try("default_board_#{key}")
end

#board_slot_selectorObject



66
67
68
69
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/board.rb', line 66

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

#board_tabObject



36
37
38
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/board.rb', line 36

def board_tab
  @board_tab ||= board_param :tab
end

#board_tabsObject



28
29
30
31
32
33
34
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/board.rb', line 28

def board_tabs
  wrap do
    tabs(visible_board_tabs, BOARD_TAB_NAMES[board_tab], load: :lazy) do
      _render board_tab
    end
  end
end


75
76
77
78
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/board.rb', line 75

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

#default_board_tabObject



71
72
73
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/board.rb', line 71

def default_board_tab
  show_guide_tab? ? :guide_tab : :engage_tab
end


89
90
91
92
93
94
95
96
# File 'platypus/tmp/set/gem-defaults/mod011-edit/all/board.rb', line 89

def switch_to_edit_link
  edit_link_opts = {
    "data-slotter-mode": "modal-replace",
    "data-modal-class": "modal-lg"
  }
  confirm_edit_loss(edit_link_opts)
  link_to_view(:edit, menu_icon, edit_link_opts)
end