Sha256: f556d9238b2e1370b604f0ff270fcf8343d6c04f086b093adf1922e8dacfd9a6

Contents?: true

Size: 1016 Bytes

Versions: 2

Compression:

Stored size: 1016 Bytes

Contents

# -*- encoding : utf-8 -*-
class Card; module Set; class Abstract
# Set: Abstract (AccountDropdown)
#
module AccountDropdown;
extend Card::Set
def self.source_location; "/Users/ethan/dev/decko/gem/card-mod-layout/set/abstract/account_dropdown.rb"; end
module HtmlFormat; module_parent.send :register_set_format, Card::Format::HtmlFormat, self; extend Card::Set::AbstractFormat
  def link_to_mycard
    link_to_card Auth.current.name, nil,
                 id: "my-card-link", class: "nav-link #{classy('my-card')}"
  end

  def account_dropdown &render_role_item
    split_button link_to_mycard, nil do
      [
        link_to_card([Auth.current, :account_settings], "Account"),
        (["Roles", role_items(&render_role_item)] if special_roles?)
      ]
    end
  end

  def special_roles?
    Auth.current_roles.size > 1
  end

  def role_items &block
    Auth.current_roles.map(&block)
  end
end
end;end;end;end;
# ~~ generated from /Users/ethan/dev/decko/gem/card-mod-layout/set/abstract/account_dropdown.rb ~~

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
card-1.101.7 tmpsets/set/mod031-card-mod-layout/abstract/account_dropdown.rb
card-1.101.6 tmpsets/set/mod031-card-mod-layout/abstract/account_dropdown.rb