Module: Card::Set::All::Html::Menu::HtmlFormat
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb
Instance Method Summary collapse
-
#bridge_icon ⇒ Object
-
#bridge_link(text: "", in_modal: true) ⇒ Object
-
#edit_in_bridge_link(opts = {}) ⇒ Object
-
#edit_link(view = :edit, link_text: nil, text: "", modal: nil) ⇒ Object
-
#edit_link_opts(modal: nil) ⇒ Object
-
#edit_link_view ⇒ Object
-
#edit_view ⇒ Object
-
#full_page_card ⇒ Object
-
#full_page_icon ⇒ Object
-
#full_page_link(text: "") ⇒ Object
-
#help_icon ⇒ Object
-
#help_link(text = nil, title = nil) ⇒ Object
-
#help_popover_opts(text = nil, title = nil) ⇒ Object
-
#help_title ⇒ Object
-
#menu_icon ⇒ Object
-
#menu_link ⇒ Object
-
#menu_link_classes ⇒ Object
-
#modal_icon ⇒ Object
-
#modal_page_link(text: "") ⇒ Object
-
#modal_page_size ⇒ Object
-
#name_parts_links ⇒ Object
-
#view: bridge_link ⇒ Object
-
#view: edit_button ⇒ Object
-
#view: edit_link ⇒ Object
-
#view: full_page_link ⇒ Object
-
#view: help_link ⇒ Object
no caching because help_text view doesn’t cache, and we can’t have a stub in the data-content attribute or it will get html escaped.
-
#view: menu ⇒ Object
Instance Method Details
#bridge_icon ⇒ Object
157 158 159 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 157 def bridge_icon fa_icon :box end |
#bridge_link(text: "", in_modal: true) ⇒ Object
63 64 65 66 67 68 69 70 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 63 def bridge_link text: "", in_modal: true opts = { class: "bridge-link" } if in_modal # add_class opts, "close" opts["data-slotter-mode"] = "modal-replace" end link_to_view :bridge, "#{bridge_icon} #{text}", opts end |
#edit_in_bridge_link(opts = {}) ⇒ Object
122 123 124 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 122 def edit_in_bridge_link opts={} edit_link :bridge, *opts end |
#edit_link(view = :edit, link_text: nil, text: "", modal: nil) ⇒ Object
126 127 128 129 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 126 def edit_link view=:edit, link_text: nil, text: "", modal: nil link_to_view view, link_text || "#{} #{text}", edit_link_opts(modal: (modal || :lg)) end |
#edit_link_opts(modal: nil) ⇒ Object
132 133 134 135 136 137 138 139 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 132 def edit_link_opts modal: nil opts = { class: classy("edit-link") } if modal opts[:"data-slotter-mode"] = "modal" opts[:"data-modal-class"] = "modal-#{modal}" end opts end |
#edit_link_view ⇒ Object
51 52 53 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 51 def edit_link_view :edit end |
#edit_view ⇒ Object
31 32 33 34 35 36 37 38 39 40 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 31 def edit_view case voo.edit when :inline :edit_inline when :full :edit else # :standard edit_link end end |
#full_page_card ⇒ Object
118 119 120 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 118 def full_page_card card end |
#full_page_icon ⇒ Object
149 150 151 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 149 def full_page_icon icon_tag :open_in_new end |
#full_page_link(text: "") ⇒ Object
104 105 106 107 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 104 def full_page_link text: "" link_to_card full_page_card, "#{full_page_icon} #{text}", class: classy("full-page-link") end |
#help_icon ⇒ Object
90 91 92 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 90 def help_icon material_icon("help") end |
#help_link(text = nil, title = nil) ⇒ Object
78 79 80 81 82 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 78 def help_link text=nil, title=nil opts = help_popover_opts text, title add_class opts, "_card-menu-popover" link_to help_icon, opts end |
#help_popover_opts(text = nil, title = nil) ⇒ Object
84 85 86 87 88 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 84 def help_popover_opts text=nil, title=nil text ||= render_help_text opts = { "data-bs-placement": :left, class: "help-link" } popover_opts text, title, opts end |
#help_title ⇒ Object
94 95 96 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 94 def help_title "#{name_parts_links} (#{render_type}) #{full_page_link unless card.simple?}" end |
#menu_icon ⇒ Object
145 146 147 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 145 def material_icon "edit" end |
#menu_link ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 20 def case voo.edit when :inline edit_inline_link when :full edit_in_bridge_link else # :standard edit_link end end |
#menu_link_classes ⇒ Object
141 142 143 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 141 def "nodblclick#{show_view?(:hover_link) ? ' _show-on-hover' : ''}" end |
#modal_icon ⇒ Object
153 154 155 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 153 def modal_icon fa_icon :expand end |
#modal_page_link(text: "") ⇒ Object
109 110 111 112 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 109 def modal_page_link text: "" modal_link "#{modal_icon} #{text}", path: { mark: card }, size: modal_page_size, class: "_modal-page-link" end |
#modal_page_size ⇒ Object
114 115 116 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 114 def modal_page_size :xl end |
#name_parts_links ⇒ Object
98 99 100 101 102 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 98 def name_parts_links card.name.parts.map do |part| link_to_card part end.join Card::Name.joint end |
#view: bridge_link ⇒ Object
59 60 61 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 59 view :bridge_link, unknown: true do bridge_link end |
#view: edit_button ⇒ Object
46 47 48 49 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 46 view :edit_button do view = voo.edit == :inline ? :edit_inline : :edit link_to_view view, "Edit", class: "btn btn-sm btn-outline-primary me-2" end |
#view: edit_link ⇒ Object
42 43 44 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 42 view :edit_link, unknown: true, denial: :blank do edit_link edit_link_view end |
#view: full_page_link ⇒ Object
55 56 57 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 55 view :full_page_link do full_page_link end |
#view: help_link ⇒ Object
no caching because help_text view doesn’t cache, and we can’t have a stub in the data-content attribute or it will get html escaped.
74 75 76 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 74 view :help_link, cache: :never, unknown: true do help_link render_help_text, help_title end |
#view: menu ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'platypus/tmp/set/gem-defaults/mod004-format/all/html/menu.rb', line 9 view :menu, denial: :blank, unknown: true do return "" unless card.known? # would be preferable to do this with unknown: :blank, but that fails with view # caching on, because voo always thinks it's the root. wrap_with :div, class: "card-menu #{}" do [render_help_link, , (voo.show?(:bridge_link) ? bridge_link(in_modal: false) : nil)] end end |