clarion/app/helpers/events_helper.rb

25 lines
989 B
Ruby
Raw Normal View History

2015-10-15 19:06:41 +03:00
module EventsHelper
2016-10-08 22:40:56 +03:00
def links_to_event_participants_for(event)
2015-10-15 19:06:41 +03:00
event.participants.map do |participant|
2016-10-08 22:40:56 +03:00
if participant.personal_profile(event.conference).present?
profile = participant.personal_profile(event.conference)
2016-10-08 22:56:03 +03:00
link_to icon(:user, profile.name),
management_conference_personal_profile_path(profile, conference_id: event.conference.id)
2016-10-08 22:40:56 +03:00
else
link_to icon('user-plus', participant.email),
new_management_conference_personal_profile_path(conference_id: event.conference.id,
user_id: participant.id),
title: t('.create_profile'), class: 'bg-danger'
end
end.join(', ').html_safe
2015-10-15 19:06:41 +03:00
end
def participant_names_or_emails(event)
event.participants.map do |participant|
participant.try(:personal_profile, current_conference).try(:name) ||
participant.personal_profiles.last.try(:name) ||
participant.email
end
end
2015-10-15 19:06:41 +03:00
end