Module: Card::Set::All::NavbarLinks::HtmlFormat
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- platypus/tmp/set/gem-defaults/mod031-layout/all/navbar_links.rb
Instance Method Summary collapse
-
#dropdown_menu ⇒ Object
-
#dropdown_menu_items ⇒ Object
-
#dropdown_toggle_link ⇒ Object
-
#nav_dropdown ⇒ Object
-
#navbar_items(view: :nav_item, link_class: "nav-link") ⇒ Object
Iterates over all nests and links and renders them as bootstrap navbar items.
-
#view: nav_item ⇒ Object
overridden in Abstract::Items to render dropdown.
-
#view: nav_link_in_dropdown ⇒ Object
-
#view: navbar_links ⇒ Object
-
#wrap_with_nav_item(content) ⇒ Object
Instance Method Details
#dropdown_menu ⇒ Object
57 58 59 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/navbar_links.rb', line 57 def wrap_with :div, , class: "dropdown-menu" end |
#dropdown_menu_items ⇒ Object
61 62 63 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/navbar_links.rb', line 61 def view: :nav_link_in_dropdown, link_class: "dropdown-item" end |
#dropdown_toggle_link ⇒ Object
52 53 54 55 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/navbar_links.rb', line 52 def dropdown_toggle_link link_to(render_title, href: "#", class: "nav-link dropdown-toggle", "data-bs-toggle": "dropdown") end |
#nav_dropdown ⇒ Object
43 44 45 46 47 48 49 50 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/navbar_links.rb', line 43 def nav_dropdown wrap_with(:li, class: "nav-item dropdown") do [ dropdown_toggle_link, ] end end |
#navbar_items(view: :nav_item, link_class: "nav-link") ⇒ Object
Iterates over all nests and links and renders them as bootstrap navbar items. Items that are pointer cards become dropdowns
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/navbar_links.rb', line 17 def view: :nav_item, link_class: "nav-link" process_content nil, chunk_list: :references do |chunk| case chunk when Card::Content::Chunk::Link chunk, view, link_class when Card::Content::Chunk::Nest chunk, view else chunk.process_chunk end end end |
#view: nav_item ⇒ Object
overridden in Abstract::Items to render dropdown
31 32 33 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/navbar_links.rb', line 31 view :nav_item do wrap_with_nav_item link_view(class: "nav-link") end |
#view: nav_link_in_dropdown ⇒ Object
39 40 41 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/navbar_links.rb', line 39 view :nav_link_in_dropdown do link_to_card card, render_title, class: "dropdown-item" end |
#view: navbar_links ⇒ Object
9 10 11 12 13 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/navbar_links.rb', line 9 view :navbar_links, perms: :none do wrap_with :ul, class: "navbar-nav" do end end |
#wrap_with_nav_item(content) ⇒ Object
35 36 37 |
# File 'platypus/tmp/set/gem-defaults/mod031-layout/all/navbar_links.rb', line 35 def wrap_with_nav_item content wrap_with(:li, content, class: "nav-item") end |