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

Extended by:
Card::Set::AbstractFormat
Defined in:
card/tmpsets/set/mod020-card-mod-bar_and_box/all/bar.rb,
card/tmpsets/set/mod021-card-mod-bar_and_box/all/bar.rb

Instance Method Summary collapse

Instance Method Details

#bar_titleObject



63
64
65
66
67
68
69
70
71
# File 'card/tmpsets/set/mod020-card-mod-bar_and_box/all/bar.rb', line 63

def bar_title
  return render_missing if card.unknown?

  if voo.show?(:toggle)
    link_to_view bar_title_toggle_view, render_title
  else
    render_title
  end
end

#bar_title_toggle_viewObject



73
74
75
# File 'card/tmpsets/set/mod020-card-mod-bar_and_box/all/bar.rb', line 73

def bar_title_toggle_view
  voo.show?(:bar_bottom) ? :bar : :expanded_bar
end

#class_up_bar_sides(middle) ⇒ Object



48
49
50
51
# File 'card/tmpsets/set/mod020-card-mod-bar_and_box/all/bar.rb', line 48

def class_up_bar_sides middle
  class_up_cols %w[bar-left bar-right], bar_cols
  class_up_cols %w[bar-left bar-middle bar-right], info_bar_cols, "md" if middle
end

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



53
54
55
56
57
# File 'card/tmpsets/set/mod020-card-mod-bar_and_box/all/bar.rb', line 53

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

#view: barObject



22
23
24
25
26
27
28
# File 'card/tmpsets/set/mod020-card-mod-bar_and_box/all/bar.rb', line 22

view :bar, unknown: :unknown_bar do
  voo.hide :bar_middle
  voo.hide :bar_bottom # needed for toggle
  class_up_bar_sides(voo.show?(:bar_middle))
  # note: above cannot be in `before`, because before blocks run before viz processing
  wrap { haml :bar }
end

#view: bar_bottomObject



86
87
88
# File 'card/tmpsets/set/mod020-card-mod-bar_and_box/all/bar.rb', line 86

view :bar_bottom do
  render(nest_mode == :edit ? :edit : :core)
end


102
103
104
# File 'card/tmpsets/set/mod020-card-mod-bar_and_box/all/bar.rb', line 102

view :bar_collapse_link, unknown: true do
  link_to_view :bar, icon_tag(:keyboard_arrow_up)
end


98
99
100
# File 'card/tmpsets/set/mod020-card-mod-bar_and_box/all/bar.rb', line 98

view :bar_expand_link, unknown: true do
  link_to_view :expanded_bar, icon_tag(:keyboard_arrow_down)
end

#view: bar_leftObject



59
60
61
# File 'card/tmpsets/set/mod020-card-mod-bar_and_box/all/bar.rb', line 59

view :bar_left do
  bar_title
end

#view: bar_middleObject



82
83
84
# File 'card/tmpsets/set/mod020-card-mod-bar_and_box/all/bar.rb', line 82

view :bar_middle, unknown: :blank do
  render :short_content
end

#view: bar_navObject



90
91
92
93
94
95
96
# File 'card/tmpsets/set/mod020-card-mod-bar_and_box/all/bar.rb', line 90

view :bar_nav, unknown: true, wrap: { div: { class: "bar-nav" } } do
  [render_bar_expand_link,
   render_bar_collapse_link,
   render_full_page_link,
   render_edit_link,
   render_bridge_link]
end

#view: bar_rightObject



77
78
79
80
# File 'card/tmpsets/set/mod020-card-mod-bar_and_box/all/bar.rb', line 77

view :bar_right, unknown: :blank do
  [(render(:short_content) unless voo.show?(:bar_middle)),
   render(:edit_button, optional: :hide)]
end

#view: edit_buttonObject



106
107
108
109
# File 'card/tmpsets/set/mod020-card-mod-bar_and_box/all/bar.rb', line 106

view :edit_button do
  view = voo.edit == :inline ? :edit_inline : :edit
  link_to_view view, "Edit", class: "btn btn-sm btn-outline-primary mr-2"
end

#view: expanded_barObject



43
44
45
46
# File 'card/tmpsets/set/mod020-card-mod-bar_and_box/all/bar.rb', line 43

view :expanded_bar do
  class_up_bar_sides(false)
  wrap { haml :expanded_bar }
end

#view: info_barObject



12
13
14
# File 'card/tmpsets/set/mod020-card-mod-bar_and_box/all/bar.rb', line 12

view :info_bar do
  render_bar show: :bar_middle
end

#view: unknown_barObject



33
34
35
36
# File 'card/tmpsets/set/mod020-card-mod-bar_and_box/all/bar.rb', line 33

view :unknown_bar, unknown: true do
  voo.hide! :bar_middle, :bar_bottom, :bar_nav
  wrap { haml :bar }
end