Module: Card::Set::All::Overlay::HtmlFormat
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- platypus/tmp/set/gem-defaults/mod031-layout/all/overlay.rb
Constant Summary collapse
- OVERLAY_CLOSE_OPTS =
{ class: "_close-overlay btn-sm", "data-bs-dismiss": "overlay", type: "button" }.freeze
Instance Method Summary collapse
-
#add_open_guide_opts(opts) ⇒ Object
-
#close_overlay_link ⇒ Object
-
#haml_overlay_frame(slot = true, header = render_overlay_header, &block) ⇒ Object
-
#overlay_close_button(link_text = "Close", opts = {}) ⇒ Object
-
#overlay_delete_button ⇒ Object
-
#overlay_frame(slot = true, header = render_overlay_header, slot_opts = nil, &block) ⇒ Object
-
#overlay_header(title = nil) ⇒ Object
-
#overlay_menu_link(icon, args = {}) ⇒ Object
-
#overlay_save_and_close_button ⇒ Object
-
#slotify_overlay_link ⇒ Object
FIXME: probably shouldn’t be new window.
-
#view: overlay_header ⇒ Object
-
#view: overlay_help_link ⇒ Object
-
#view: overlay_menu ⇒ Object
-
#view: overlay_title ⇒ Object
Instance Method Details
#add_open_guide_opts(opts) ⇒ Object
42 43 44 45 46 47 48 49 50 51 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/overlay.rb', line 42 def add_open_guide_opts opts return unless card.guide_card slot_selector = ".board-sidebar > ._overlay-container-placeholder > .card-slot" opts.merge! remote: true, href: path(mark: card, view: :overlay_guide), "data-slot-selector": slot_selector, "data-slotter-mode": "overlay" add_class opts, "slotter" end |
#close_overlay_link ⇒ Object
58 59 60 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/overlay.rb', line 58 def :close, path: "#", "data-bs-dismiss": "overlay" end |
#haml_overlay_frame(slot = true, header = render_overlay_header, &block) ⇒ Object
97 98 99 100 101 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/overlay.rb', line 97 def slot=true, header=, &block slot, header, {} do haml_wrap_body(&block) end end |
#overlay_close_button(link_text = "Close", opts = {}) ⇒ Object
62 63 64 65 66 67 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/overlay.rb', line 62 def link_text="Close", opts={} classes = opts.delete(:class) = opts.merge(OVERLAY_CLOSE_OPTS) add_class , classes if classes link_text, end |
#overlay_delete_button ⇒ Object
69 70 71 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/overlay.rb', line 69 def OVERLAY_CLOSE_OPTS.merge(success: {}) end |
#overlay_frame(slot = true, header = render_overlay_header, slot_opts = nil, &block) ⇒ Object
90 91 92 93 94 95 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/overlay.rb', line 90 def slot=true, header=, slot_opts=nil, &block slot_opts ||= {} slot, header, slot_opts do wrap_body(&block) end end |
#overlay_header(title = nil) ⇒ Object
83 84 85 86 87 88 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/overlay.rb', line 83 def title=nil title ||= class_up "d0-card-header", "bg-body" class_up "d0-card-header-title", "d-flex" header_wrap [title, ] end |
#overlay_menu_link(icon, args = {}) ⇒ Object
78 79 80 81 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/overlay.rb', line 78 def icon, args={} add_class args, "text-muted p-1 ms-1" smart_link_to icon_tag(icon), args end |
#overlay_save_and_close_button ⇒ Object
73 74 75 76 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/overlay.rb', line 73 def text: "Save and Close", class: "_close-on-success", "data-cy": "submit-overlay" end |
#slotify_overlay_link ⇒ Object
FIXME: probably shouldn’t be new window. overlay?
54 55 56 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/overlay.rb', line 54 def :new_window, card: card end |
#view: overlay_header ⇒ Object
22 23 24 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/overlay.rb', line 22 view :overlay_header, unknown: true do end |
#view: overlay_help_link ⇒ Object
36 37 38 39 40 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/overlay.rb', line 36 view :overlay_help_link, cache: :never, unknown: true do opts = help_popover_opts add_open_guide_opts opts :help, opts end |
#view: overlay_menu ⇒ Object
30 31 32 33 34 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/overlay.rb', line 30 view :overlay_menu do wrap_with :div, class: "overlay-menu" do [, , ] end end |
#view: overlay_title ⇒ Object
26 27 28 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/overlay.rb', line 26 view :overlay_title do _render_title end |