diff options
author | Sean Smith <ssmith@iol.unh.edu> | 2020-09-18 15:26:53 -0400 |
---|---|---|
committer | Sean Smith <ssmith@iol.unh.edu> | 2020-09-18 15:52:47 -0400 |
commit | edf4c59212c757d81a51fbc8d587bb7384d921fa (patch) | |
tree | 490a9f8d23fd8e8fb8c5b2877147af80b840beff /src/dashboard/views.py | |
parent | 1ca205371c3306a23a817d9ea617c1a0596f7912 (diff) |
3 contact us buttons and booking links on landing
Signed-off-by: Sean Smith <ssmith@iol.unh.edu>
Change-Id: Ic50767e566f06d34457b6543644eeee03e584b89
Diffstat (limited to 'src/dashboard/views.py')
-rw-r--r-- | src/dashboard/views.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/dashboard/views.py b/src/dashboard/views.py index 2ace2d4..f9a908c 100644 --- a/src/dashboard/views.py +++ b/src/dashboard/views.py @@ -12,8 +12,12 @@ from django.shortcuts import get_object_or_404 from django.views.generic import TemplateView from django.shortcuts import render +from django.db.models import Q +from datetime import datetime +import pytz from account.models import Lab +from booking.models import Booking from resource_inventory.models import Image, ResourceProfile, ResourceQuery from workflow.workflow_manager import ManagerTracker @@ -65,12 +69,22 @@ def host_profile_detail_view(request): def landing_view(request): manager = ManagerTracker.managers.get(request.session.get('manager_session')) + user = request.user + if not user.is_anonymous: + bookings = Booking.objects.filter( + Q(owner=user) | Q(collaborators=user), + end__gte=datetime.now(pytz.utc) + ) + else: + bookings = None + return render( request, 'dashboard/landing.html', { 'manager': manager is not None, - 'title': "Welcome to the Lab as a Service Dashboard" + 'title': "Welcome to the Lab as a Service Dashboard", + 'bookings': bookings } ) |