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
- #account_link_text(purpose) ⇒ Object
- #item_links(_args = nil) ⇒ Object
- #nav_link_class(type) ⇒ Object
- #roles ⇒ Object
- #show_invite_link? ⇒ Boolean
- #show_signup_link? ⇒ Boolean
Class Method Details
.link_options(opts = {}) ⇒ Object
27 28 29 30 31 |
# File 'tmpsets/set/mod025-account/self/account_links.rb', line 27 def self. opts={} = { denial: :blank, cache: :never }.merge opts [:perms] = ->(r) { yield r } if block_given? .clone end |
Instance Method Details
#account_link_text(purpose) ⇒ Object
72 73 74 75 |
# File 'tmpsets/set/mod025-account/self/account_links.rb', line 72 def account_link_text purpose voo.title || I18n.t(purpose, scope: "mod.account.set.self.account_links") end |
#item_links(_args = nil) ⇒ Object
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 |
#nav_link_class(type) ⇒ Object
77 78 79 |
# File 'tmpsets/set/mod025-account/self/account_links.rb', line 77 def nav_link_class type "nav-link #{classy(type)}" end |
#roles ⇒ Object
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
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
81 82 83 |
# File 'tmpsets/set/mod025-account/self/account_links.rb', line 81 def show_signup_link? !Auth.signed_in? && Card.new(type_id: Card::SignupID).ok?(:create) end |