2014-01-11 15:01:40 +01:00
|
|
|
from django.shortcuts import render
|
2019-01-05 11:27:15 +01:00
|
|
|
from django.conf import settings
|
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
|
2019-01-05 11:27:15 +01:00
|
|
|
if EventParticipation.isMember(request.user):
|
|
|
|
context['hasParticipationSetForAllEvents'] = EventParticipation.hasUserSetParticipationForAllEvents(
|
|
|
|
request.user)
|
2013-09-26 21:56:32 +02:00
|
|
|
|
2019-01-05 11:27:15 +01:00
|
|
|
addEventCountdownForNextEventToContext(context, request.user)
|
|
|
|
addEventRouteForNextEventToContext(context, request.user, 'Conc')
|
2013-06-15 21:50:12 +02:00
|
|
|
|
2019-01-05 11:27:15 +01:00
|
|
|
context['GOOGLE_MAPS_API_KEY'] = settings.GOOGLE_MAPS_API_KEY
|
|
|
|
return render(request, 'website/mainpage.html', context)
|