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
-
#bar_bottom(open: false) ⇒ Object
TODO: make card_stubs work.
-
#bar_menu_items ⇒ Object
-
#bar_wrap_data ⇒ Object
-
#build_accordion_bar(open: false) ⇒ Object
-
#build_bar ⇒ Object
-
#card_stub(path_args) ⇒ Object
TODO: move to a more general accessible place (or its own abstract module).
-
#class_up_cols(classes, cols, context = nil) ⇒ Object
-
#prepare_bar(two_cols, three_cols = nil) ⇒ Object
NOTE: currently bar always turns to mini-bar at md.
-
#view: accordion_bar ⇒ Object
-
#view: bar ⇒ Object
drops bar-middle in small viewports.
-
#view: bar_body ⇒ Object
-
#view: bar_bottom ⇒ Object
-
#view: bar_left ⇒ Object
-
#view: bar_menu ⇒ Object
-
#view: bar_middle ⇒ Object
-
#view: bar_right ⇒ Object
-
#view: closed ⇒ Object
-
#view: closed_bar ⇒ Object
-
#view: expanded_bar ⇒ Object
-
#view: full_bar ⇒ Object
-
#view: mini_bar ⇒ Object
-
#view: open ⇒ Object
-
#view: open_bar ⇒ Object
Instance Method Details
#bar_bottom(open: false) ⇒ Object
TODO: make card_stubs work
105 106 107 |
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 105 def open: false open ? : card_stub(view: :bar_bottom) end |
#bar_menu_items ⇒ Object
73 74 75 76 77 78 79 80 |
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 73 def [ full_page_link(text: "page"), modal_page_link(text: "modal"), edit_link(:edit, text: card.new? ? "create" : "edit"), board_link(text: "advanced") ] end |
#bar_wrap_data ⇒ Object
100 101 102 |
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 100 def full_page_card == card ? wrap_data : full_page_card.format.wrap_data end |
#build_accordion_bar(open: false) ⇒ Object
57 58 59 60 61 62 63 64 65 66 67 |
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 57 def open: false class_up "accordion-item", "bar #{classy 'bar'}" wrap do accordion_item , subheader: , body: (open: open), open: open, context: :closed end end |
#build_bar ⇒ Object
69 70 71 |
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 69 def wrap { haml :bar } end |
#card_stub(path_args) ⇒ Object
TODO: move to a more general accessible place (or its own abstract module)
110 111 112 113 114 115 116 |
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 110 def card_stub path_args wrap_with :div, class: "card-slot card-slot-stub", data: { "stub-url": path(path_args) } do "" end end |
#class_up_cols(classes, cols, context = nil) ⇒ Object
94 95 96 97 98 |
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 94 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
83 84 85 86 87 88 89 90 91 92 |
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 83 def 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_bar ⇒ Object
49 |
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 49 view :accordion_bar, :closed |
#view: bar ⇒ Object
drops bar-middle in small viewports
16 17 18 19 20 |
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 16 view :bar, unknown: :mini_bar, cache: :yes do cols = .size == 3 ? [, ] : [] (*cols) end |
#view: bar_body ⇒ Object
43 |
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 43 view :bar_body, unknown: true, template: :haml |
#view: bar_bottom ⇒ Object
37 38 39 40 |
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 37 view :bar_bottom do view = nest_mode == :edit ? :edit : :content render view, home_view: view end |
#view: bar_left ⇒ Object
33 |
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 33 view(:bar_left, unknown: true) { render_title } |
#view: bar_menu ⇒ Object
42 |
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 42 view :bar_menu, unknown: true, template: :haml |
#view: bar_middle ⇒ Object
34 |
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 34 view(:bar_middle, unknown: :blank) { "" } |
#view: bar_right ⇒ Object
35 |
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 35 view(:bar_right, unknown: :blank) { "" } |
#view: closed ⇒ Object
45 46 47 |
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 45 view :closed, unknown: :mini_bar, cache: :yes do end |
#view: closed_bar ⇒ Object
48 |
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 48 view :closed_bar, :closed |
#view: expanded_bar ⇒ Object
55 |
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 55 view :expanded_bar, :open |
#view: full_bar ⇒ Object
27 28 29 30 31 |
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 27 view :full_bar, unknown: :mini_bar, cache: :yes do class_up "bar", full_page_card.safe_set_keys class_up_cols %w[bar-left bar-middle bar-right], end |
#view: mini_bar ⇒ Object
22 23 24 25 |
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 22 view :mini_bar, cache: :yes, unknown: true do end |
#view: open ⇒ Object
51 52 53 |
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 51 view :open, cache: :yes do open: true end |
#view: open_bar ⇒ Object
54 |
# File 'platypus/tmp/set/gem-defaults/mod023-bar_and_box/all/bar.rb', line 54 view :open_bar, :open |