blechreiz-website/website/views.py

21 lines
750 B
Python
Raw Normal View History

from django.shortcuts import render
from django.contrib.auth.decorators import login_required
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
@login_required
def home_view(request):
2013-09-15 14:48:40 +02:00
context = dict()
2013-09-26 21:56:32 +02:00
# Event participation for slider text
if EventParticipation.isMember( request.user ):
context['hasParticipationSetForAllEvents'] = EventParticipation.hasUserSetParticipationForAllEvents( request.user)
2013-09-26 21:56:32 +02: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 )