2014-03-23 00:22:25 +00:00
|
|
|
module GathersHelper
|
|
|
|
def render_gather
|
|
|
|
if @gather.status == Gather::STATE_RUNNING
|
2014-04-15 09:59:52 +00:00
|
|
|
headers['Gather'] = 'running'
|
|
|
|
|
|
|
|
render partial: 'running', layout: false
|
2014-03-23 00:22:25 +00:00
|
|
|
elsif @gather.status == Gather::STATE_VOTING
|
2014-04-15 09:59:52 +00:00
|
|
|
if @gatherer and @gather.gatherer_votes.first(conditions: { user_id: cuser.id })
|
|
|
|
headers['Gather'] = 'voted'
|
2014-03-23 00:22:25 +00:00
|
|
|
else
|
2014-04-15 09:59:52 +00:00
|
|
|
headers['Gather'] = 'voting'
|
2014-03-23 00:22:25 +00:00
|
|
|
end
|
2014-04-15 09:59:52 +00:00
|
|
|
|
|
|
|
render partial: 'voting', layout: false
|
2014-03-23 00:22:25 +00:00
|
|
|
elsif @gather.status == Gather::STATE_PICKING or @gather.status == Gather::STATE_FINISHED
|
2014-04-15 09:59:52 +00:00
|
|
|
headers['Gather'] = 'picking'
|
|
|
|
|
|
|
|
render partial: 'picking', layout: false
|
2014-03-23 00:22:25 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|