Module: Card::Set::Self::AccountLinks::HtmlFormat

Extended by:
AbstractFormat
Defined in:
tmpsets/set/mod025-account/self/account_links.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details



27
28
29
30
31
# File 'tmpsets/set/mod025-account/self/account_links.rb', line 27

def self.link_options opts={}
  options = { denial: :blank, cache: :never }.merge opts
  options[:perms] = ->(r) { yield r } if block_given?
  options.clone
end

Instance Method Details



72
73
74
75
# File 'tmpsets/set/mod025-account/self/account_links.rb', line 72

def  purpose
  voo.title ||
    I18n.t(purpose, scope: "mod.account.set.self.account_links")
end


20
21
22
23
24
25
# File 'tmpsets/set/mod025-account/self/account_links.rb', line 20

def item_links _args=nil
  # removed invite for now
  %i[my_card sign_out sign_up sign_in].map do |link_view|
    render link_view
  end.compact
end


77
78
79
# File 'tmpsets/set/mod025-account/self/account_links.rb', line 77

def nav_link_class type
  "nav-link #{classy(type)}"
end

#rolesObject



68
69
70
# File 'tmpsets/set/mod025-account/self/account_links.rb', line 68

def roles
  [Card[:eagle], Auth.current.fetch(trait: :roles)&.item_names].flatten.compact
end

#show_invite_link?Boolean

Returns:

  • (Boolean)


85
86
87
88
# File 'tmpsets/set/mod025-account/self/account_links.rb', line 85

def show_invite_link?
  Auth.signed_in? &&
    Card.new(type_id: Card.default_accounted_type_id).ok?(:create)
end

#show_signup_link?Boolean

Returns:

  • (Boolean)


81
82
83
# File 'tmpsets/set/mod025-account/self/account_links.rb', line 81

def 
  !Auth.signed_in? && Card.new(type_id: Card::SignupID).ok?(:create)
end