Sha256: 54ad72152e1981c7e9673e4c25e17dcad0a012eb3f45249cf70a6f727701582e

Contents?: true

Size: 744 Bytes

Versions: 31

Compression:

Stored size: 744 Bytes

Contents

# frozen_string_literal: true

module Decidim
  #
  # Decorator for conference speakers
  #
  class ConferenceSpeakerPresenter < SimpleDelegator
    include Decidim::ResourceHelper

    delegate :profile_path, to: :user, allow_nil: true

    def name
      user ? user.name : full_name
    end

    def nickname
      user.nickname if user
    end

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

    def badge
      user ? user.badge : false
    end

    def can_be_contacted?
      user ? true : false
    end

    def has_tooltip?
      false
    end

    private

    def user
      @user ||= begin
        if (user = __getobj__.user.presence)
          Decidim::UserPresenter.new(user)
        end
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
decidim-conferences-0.25.0.rc4 app/presenters/decidim/conference_speaker_presenter.rb
decidim-conferences-0.25.0.rc3 app/presenters/decidim/conference_speaker_presenter.rb
decidim-conferences-0.25.0.rc2 app/presenters/decidim/conference_speaker_presenter.rb
decidim-conferences-0.25.0.rc1 app/presenters/decidim/conference_speaker_presenter.rb
decidim-conferences-0.24.3 app/presenters/decidim/conference_speaker_presenter.rb
decidim-conferences-0.23.6 app/presenters/decidim/conference_speaker_presenter.rb
decidim-conferences-0.24.2 app/presenters/decidim/conference_speaker_presenter.rb
decidim-conferences-0.23.5 app/presenters/decidim/conference_speaker_presenter.rb
decidim-conferences-0.24.1 app/presenters/decidim/conference_speaker_presenter.rb
decidim-conferences-0.24.0 app/presenters/decidim/conference_speaker_presenter.rb
decidim-conferences-0.24.0.rc2 app/presenters/decidim/conference_speaker_presenter.rb
decidim-conferences-0.23.4 app/presenters/decidim/conference_speaker_presenter.rb
decidim-conferences-0.24.0.rc1 app/presenters/decidim/conference_speaker_presenter.rb
decidim-conferences-0.23.3 app/presenters/decidim/conference_speaker_presenter.rb
decidim-conferences-0.23.2 app/presenters/decidim/conference_speaker_presenter.rb
decidim-conferences-0.23.1 app/presenters/decidim/conference_speaker_presenter.rb
decidim-conferences-0.23.1.rc1 app/presenters/decidim/conference_speaker_presenter.rb
decidim-conferences-0.23.0 app/presenters/decidim/conference_speaker_presenter.rb
decidim-conferences-0.22.0 app/presenters/decidim/conference_speaker_presenter.rb
decidim-conferences-0.21.0 app/presenters/decidim/conference_speaker_presenter.rb