Sha256: 1ce2c905478a285eb15f4c41545fff76f9d111fb5632d2be9cce8ed552dd836f
Contents?: true
Size: 944 Bytes
Versions: 11
Compression:
Stored size: 944 Bytes
Contents
format :html do def link_to_mycard text=nil link_to_card Auth.current.name, text, id: "my-card-link", class: "nav-link #{classy('my-card')}" end def account_dropdown class_up "dropdown-toggle-split", "nav-link" split_dropdown_button account_dropdown_label do account_dropdown_items end end private def account_dropdown_label link_to_mycard end def account_dropdown_items [[[Auth.current, :account_settings], "Account"], [:signin, t("account_sign_out"), { path: { action: :delete } }]] + account_dropdown_roles end def account_dropdown_roles return [] unless special_roles? [dropdown_header("Roles")] + account_dropdown_role_items end def account_dropdown_role_items Auth.current_roles.map { |role| [role] } end def special_roles? Auth.current_roles.size > 1 end def role_items &block Auth.current_roles.map(&block) end end
Version data entries
11 entries across 11 versions & 1 rubygems