aboutsummaryrefslogtreecommitdiffstats
path: root/src/booking/views.py
diff options
context:
space:
mode:
authorSean Smith <ssmith@iol.unh.edu>2020-09-18 15:26:53 -0400
committerSean Smith <ssmith@iol.unh.edu>2020-09-18 15:52:47 -0400
commitedf4c59212c757d81a51fbc8d587bb7384d921fa (patch)
tree490a9f8d23fd8e8fb8c5b2877147af80b840beff /src/booking/views.py
parent1ca205371c3306a23a817d9ea617c1a0596f7912 (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/booking/views.py')
-rw-r--r--src/booking/views.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/booking/views.py b/src/booking/views.py
index bd57812..c41a7d6 100644
--- a/src/booking/views.py
+++ b/src/booking/views.py
@@ -19,7 +19,7 @@ from django.db.models import Q
from django.urls import reverse
from resource_inventory.models import ResourceBundle, ResourceProfile, Image, ResourceQuery
-from account.models import Downtime
+from account.models import Downtime, Lab
from booking.models import Booking
from booking.stats import StatisticsManager
from booking.forms import HostReImageForm
@@ -44,6 +44,7 @@ def quick_create(request):
context['form'] = QuickBookingForm(lab_data=attrs, default_user=request.user.username, user=request.user)
context['lab_profile_map'] = {}
context.update(drop_filter(request.user))
+ context['contact_email'] = Lab.objects.filter(name="UNH_IOL").first().contact_email
return render(request, 'booking/quick_deploy.html', context)
if request.method == 'POST':
@@ -74,9 +75,15 @@ class BookingView(TemplateView):
def get_context_data(self, **kwargs):
booking = get_object_or_404(Booking, id=self.kwargs['booking_id'])
title = 'Booking Details'
+ contact = Lab.objects.filter(name="UNH_IOL").first().contact_email
downtime = Downtime.objects.filter(lab=booking.lab, start__lt=timezone.now, end__gt=timezone.now()).first()
context = super(BookingView, self).get_context_data(**kwargs)
- context.update({'title': title, 'booking': booking, 'downtime': downtime})
+ context.update({
+ 'title': title,
+ 'booking': booking,
+ 'downtime': downtime,
+ 'contact_email': contact
+ })
return context