rearrange helper functions

This commit is contained in:
hitman 2017-03-10 02:18:26 +05:30 committed by Stella Rouzi
parent f63259f187
commit 5b1a730e19
5 changed files with 30 additions and 71 deletions

View file

@ -10,6 +10,18 @@ module EventsHelper
"Registered: #{event.registrations.count}"
end
##
# Checks if the voting has already started, or if it has already ended
#
def voting_open_or_close(program)
return if program.voting_period?
if program.voting_start_date > Time.current
return 'Voting period has not started yet!'
else # voting_end_date > Date.today because voting_start_date < voting_end_date
return 'Voting period is over!'
end
end
def event_types(conference)
all = conference.program.event_types.map { |et| et.title.pluralize }
first = all[0...-1]