Sha256: fc1ee418f4d70ca24412e78db27a0e41427f6ad6ac4769a18b0971ff8bfaafca
Contents?: true
Size: 1.24 KB
Versions: 11
Compression:
Stored size: 1.24 KB
Contents
# frozen_string_literal: true module Lipstick module Helpers module NavHelper def nav_bar content_tag('nav', class: 'navbar shrink') { yield } end def nav_first_item(text, url) content_tag('div', class: 'nav navbar-header') do concat(nav_collapse_button) concat(content_tag('a', text, href: url, class: 'navbar-brand')) end end def nav_collapsing_items attrs = { class: 'collapse navbar-collapse', id: 'aaf-nav-collapse' } content_tag('div', attrs) do content_tag('ul', class: 'nav navbar-nav') { yield } end end def nav_item(text, url, html_opts = {}) content_tag('li') do content_tag('a', text, html_opts.merge(href: url)) end end private def nav_collapse_button attrs = { type: 'button', class: 'navbar-toggle collapsed', 'data-toggle': 'collapse', 'data-target': '#aaf-nav-collapse', 'aria-expanded': 'false' } content_tag('button', attrs) do concat(content_tag('span', 'Toggle navigation', class: 'sr-only')) 3.times { concat(content_tag('span', '', class: 'icon-bar')) } end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems