2014-01-11 15:01:40 +01:00
|
|
|
from django.shortcuts import render
|
2013-06-15 21:50:12 +02:00
|
|
|
|
2013-09-22 11:11:48 +02:00
|
|
|
from django.contrib.auth.decorators import login_required
|
2014-01-11 15:01:40 +01:00
|
|
|
from eventplanner.snippets import addEventCountdownForNextEventToContext, addEventRouteForNextEventToContext
|
|
|
|
from eventplanner.models import EventParticipation
|
2013-09-15 14:48:40 +02:00
|
|
|
|
2013-09-26 21:56:32 +02:00
|
|
|
|
2013-09-22 11:11:48 +02:00
|
|
|
@login_required
|
2013-06-15 21:50:12 +02:00
|
|
|
def home_view(request):
|
2013-09-15 14:48:40 +02:00
|
|
|
context = dict()
|
2013-09-22 11:11:48 +02:00
|
|
|
|
2013-09-26 21:56:32 +02:00
|
|
|
# Event participation for slider text
|
2013-10-14 19:46:53 +02:00
|
|
|
if EventParticipation.isMember( request.user ):
|
|
|
|
context['hasParticipationSetForAllEvents'] = EventParticipation.hasUserSetParticipationForAllEvents( request.user)
|
2013-09-26 21:56:32 +02:00
|
|
|
|
2014-01-11 15:01:40 +01:00
|
|
|
addEventCountdownForNextEventToContext( context, request.user );
|
|
|
|
addEventRouteForNextEventToContext(context, request.user, 'Conc' )
|
2013-09-26 21:56:32 +02:00
|
|
|
|
2013-09-15 14:48:40 +02:00
|
|
|
return render( request, 'website/mainpage.html', context )
|
2013-06-15 21:50:12 +02:00
|
|
|
|