Class: Decidim::ConferenceSpeakerPresenter

Inherits:
SimpleDelegator
  • Object
show all
Includes:
ResourceHelper
Defined in:
decidim-conferences/app/presenters/decidim/conference_speaker_presenter.rb

Overview

Decorator for conference speakers

Instance Method Summary collapse

Methods included from ResourceHelper

#linked_classes_filter_values_for, #linked_classes_for, #resource_locator, #resource_title

Instance Method Details

#avatarObject



36
37
38
# File 'decidim-conferences/app/presenters/decidim/conference_speaker_presenter.rb', line 36

def avatar
  attached_uploader(:avatar)
end

#avatar_url(variant = nil) ⇒ Object



40
41
42
43
44
# File 'decidim-conferences/app/presenters/decidim/conference_speaker_presenter.rb', line 40

def avatar_url(variant = nil)
  return avatar.default_url unless avatar.attached?

  avatar.path(variant:)
end

#badgeObject



24
25
26
# File 'decidim-conferences/app/presenters/decidim/conference_speaker_presenter.rb', line 24

def badge
  user ? user.badge : false
end

#can_be_contacted?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'decidim-conferences/app/presenters/decidim/conference_speaker_presenter.rb', line 28

def can_be_contacted?
  user ? true : false
end

#deleted?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'decidim-conferences/app/presenters/decidim/conference_speaker_presenter.rb', line 20

def deleted?
  user ? user.deleted? : false
end

#has_tooltip?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'decidim-conferences/app/presenters/decidim/conference_speaker_presenter.rb', line 32

def has_tooltip?
  false
end

#nameObject



12
13
14
# File 'decidim-conferences/app/presenters/decidim/conference_speaker_presenter.rb', line 12

def name
  user ? user.name : full_name
end

#nicknameObject



16
17
18
# File 'decidim-conferences/app/presenters/decidim/conference_speaker_presenter.rb', line 16

def nickname
  user.nickname if user
end