22 lines
843 B
Python
22 lines
843 B
Python
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
|
|
|
|
|
|
@login_required
|
|
def home_view(request):
|
|
context = dict()
|
|
|
|
# Event participation for slider text
|
|
if EventParticipation.isMember(request.user):
|
|
context['hasParticipationSetForAllEvents'] = EventParticipation.hasUserSetParticipationForAllEvents(
|
|
request.user)
|
|
|
|
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)
|