Sha256: 2a3499b1afdc6c3c235092120ce814ff050fc3e7914ed04e1cc3e30a21e1fbf7
Contents?: true
Size: 937 Bytes
Versions: 15
Compression:
Stored size: 937 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 def avatar attached_uploader(:avatar) end def avatar_url(variant = nil) return avatar.default_url unless avatar.attached? avatar.path(variant: variant) end private def user @user ||= begin if (user = __getobj__.user.presence) Decidim::UserPresenter.new(user) end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems