Sha256: f297ac80ff1a79f98991eb8fff8a9715f669066238f954a450956dfbf8a0ea0e
Contents?: true
Size: 826 Bytes
Versions: 28
Compression:
Stored size: 826 Bytes
Contents
module AmaLayout class NavigationDecorator < Draper::Decorator delegate_all def items object.items.map { |i| i.decorate } end def display_name_text name_or_email.truncate(30) end def sign_out_link return "" unless user h.content_tag :li, class: "side-nav__item" do h.concat h.link_to "Sign Out", "/logout", class: "side-nav__link" end end def top_nav h.render partial: "ama_layout/top_nav", locals: { navigation: self } if items.any? end def sidebar h.render partial: "ama_layout/sidebar", locals: { navigation: self } if items.any? end def name_or_email display_name.present? ? "Welcome, #{display_name.titleize}" : email end def account_toggle h.render partial: "account_toggle" end end end
Version data entries
28 entries across 28 versions & 1 rubygems