Sha256: d9dc428da193c42fd6239fce6b1930d777fe26e0a17b0db01eb47270d8314082
Contents?: true
Size: 1.16 KB
Versions: 3
Compression:
Stored size: 1.16 KB
Contents
require 'pagy' module CmAdmin module ViewHelpers module NavigationHelper include Pagy::Frontend def navigation_links(navigation_type) CmAdmin.cm_admin_models.map { |model| if model.is_visible_on_sidebar path = CmAdmin::Engine.mount_path + '/' + model.name.underscore.pluralize if navigation_type == "sidebar" content_tag(:a, href: path) do content_tag(:div, class: 'menu-item') do content_tag(:span, class: 'menu-icon') do concat tag.i class: 'fa fa-th-large' end + model.name end end elsif navigation_type == "quick_links" content_tag(:a, href: path, class: 'visible') do content_tag(:div, class: 'result-item') do content_tag(:span) do concat tag.i class: 'fa fa-th-large' end + content_tag(:span) do model.name end end end end end }.join.html_safe end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
cm-admin-0.5.6 | lib/cm_admin/view_helpers/navigation_helper.rb |
cm-admin-0.5.5 | lib/cm_admin/view_helpers/navigation_helper.rb |
cm-admin-0.5.4 | lib/cm_admin/view_helpers/navigation_helper.rb |