Module: Card::Set::All::Bar::HtmlFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb

Instance Method Summary collapse

Instance Method Details

#bar_menu_itemsObject



62
63
64
65
66
67
68
69
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 62

def bar_menu_items
  [
    full_page_link(text: "page"),
    modal_page_link(text: "modal"),
    edit_link(:edit, text: card.new? ? "create" : "edit"),
    bridge_link(text: "advanced")
  ]
end

#bar_wrap_dataObject



89
90
91
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 89

def bar_wrap_data
  full_page_card == card ? wrap_data : full_page_card.format.wrap_data
end

#build_accordion_bar(open: false) ⇒ Object



48
49
50
51
52
53
54
55
56
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 48

def build_accordion_bar open: false
  prepare_bar mini_bar_cols
  class_up "accordion-item", "bar #{classy 'bar'}"
  accordion_item render_bar_body,
                 subheader: render_menu,
                 body: render_bar_bottom,
                 open: open,
                 context: :accordion_bar
end

#build_barObject



58
59
60
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 58

def build_bar
  wrap { haml :bar }
end

#class_up_cols(classes, cols, context = nil) ⇒ Object



83
84
85
86
87
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 83

def class_up_cols classes, cols, context=nil
  classes.each_with_index do |cls, i|
    class_up cls, ["col", context, cols[i]].compact.join("-")
  end
end

#prepare_bar(two_cols, three_cols = nil) ⇒ Object

NOTE: currently bar always turns to mini-bar at md



72
73
74
75
76
77
78
79
80
81
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 72

def prepare_bar two_cols, three_cols=nil
  class_up "bar", full_page_card.safe_set_keys
  class_up_cols %w[bar-left bar-right], two_cols
  class_up "bar-middle", "d-none d-md-flex"
  if three_cols
    class_up_cols %w[bar-left bar-middle bar-right], three_cols, "md"
  else
    voo.hide :bar_middle
  end
end

#view: accordion_barObject



38
39
40
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 38

view :accordion_bar, unknown: :mini_bar do
  build_accordion_bar
end

#view: barObject



15
16
17
18
19
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 15

view :bar, unknown: :mini_bar do
  cols = bar_cols.size == 3 ? [mini_bar_cols, bar_cols] : [bar_cols]
  prepare_bar(*cols)
  build_bar
end

#view: bar_bodyObject



36
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 36

view :bar_body, unknown: true, template: :haml

#view: bar_bottomObject



30
31
32
33
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 30

view :bar_bottom do
  view = nest_mode == :edit ? :edit : :content
  render view, home_view: view
end

#view: bar_leftObject



26
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 26

view(:bar_left, unknown: true) { render_title }

#view: bar_menuObject



35
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 35

view :bar_menu, unknown: true, template: :haml

#view: bar_middleObject



27
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 27

view(:bar_middle, unknown: :blank) { "" }

#view: bar_rightObject



28
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 28

view(:bar_right, unknown: :blank) { "" }

#view: closed_barObject



41
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 41

view :closed_bar, :accordion_bar

#view: expanded_barObject



46
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 46

view :expanded_bar, :open_bar

#view: mini_barObject



21
22
23
24
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 21

view :mini_bar, unknown: true do
  prepare_bar mini_bar_cols
  build_bar
end

#view: open_barObject



43
44
45
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 43

view :open_bar do
  build_accordion_bar open: true
end