blechreiz-website/website/views.py

22 lines
843 B
Python
Raw Permalink Normal View History

from django.shortcuts import render
from django.conf import settings
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')
context['GOOGLE_MAPS_API_KEY'] = settings.GOOGLE_MAPS_API_KEY
return render(request, 'website/mainpage.html', context)