3 contact us buttons and booking links on landing 59/71159/1
authorSean Smith <ssmith@iol.unh.edu>
Fri, 18 Sep 2020 19:26:53 +0000 (15:26 -0400)
committerSean Smith <ssmith@iol.unh.edu>
Fri, 18 Sep 2020 19:52:47 +0000 (15:52 -0400)
Signed-off-by: Sean Smith <ssmith@iol.unh.edu>
Change-Id: Ic50767e566f06d34457b6543644eeee03e584b89

src/booking/views.py
src/dashboard/views.py
src/templates/akraino/booking/quick_deploy.html
src/templates/base/booking/booking_detail.html
src/templates/base/booking/quick_deploy.html
src/templates/base/dashboard/landing.html
src/templates/base/workflow/viewport-base.html
src/templates/laas/dashboard/landing.html
src/workflow/views.py

index bd57812..c41a7d6 100644 (file)
@@ -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
 
 
index 2ace2d4..f9a908c 100644 (file)
 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
         }
     )
 
index af9b3d3..c3e519f 100644 (file)
@@ -6,7 +6,8 @@
     Please select a host type you wish to book.
     Only available types are shown.
     More information can be found here:
-    <a href="https://wiki.akraino.org/display/AK/Shared+Community+Lab">Akraino Wiki</a>
+    <a href="https://wiki.akraino.org/display/AK/Shared+Community+Lab">Akraino Wiki</a>.
+    If something isn't working right, let us know <a href="mailto:{{contact_email}}"> here! </a> 
 </p>
 {% endblock form-text %}
 {% block collab %}
index 4b70f69..24a654c 100644 (file)
         <div class="card mb-3">
             <div class="card-header d-flex">
                 <h4 class="d-inline">Deployment Progress</h4>
-                <p>These are the different tasks that have to be completed before your deployment is ready</p>
+                <p>These are the different tasks that have to be completed before your deployment is ready.
+                If this is taking a really long time, let us know <a href="mailto:{{contact_email}}">here!</a></p>
                 <button data-toggle="collapse" data-target="#panel_tasks" class="btn btn-outline-secondary ml-auto">Expand</button>
             </div>
             <div class="collapse show" id="panel_tasks">
index e4b9431..c954073 100644 (file)
@@ -9,7 +9,10 @@
         <div class="row mx-0 px-0">
             <div class="col-12 mx-0 px-0 mt-2">
                 {% block form-text %}
-                <p class="my-0">Please select a host type you wish to book. Only available types are shown.</p>
+                <p class="my-0">
+                    Please select a host type you wish to book. Only available types are shown.
+                    If something isn't working right, let us know <a href="mailto:{{contact_email}}"> here! </a> 
+                </p>
                 {% endblock form-text %}
                 {% bootstrap_field form.filter_field show_label=False %}
             </div>
index ed50638..ecb12c6 100644 (file)
 {% csrf_token %}
 
 <div class="row">
-    <!-- About us -->
     <div class="col-12 col-lg-6 mb-4">
+        <!-- About us -->
         <h2 class="border-bottom">About Us</h2>
         {% block about_us %}
         <p>Here is some information about us!</p>
         {% endblock about_us %}
+        {% block welcome_back %}
+            {% if user.is_authenticated %}
+            <h2 class="border-bottom">Welcome Back!</h2>
+                {% if bookings %}
+                    <h5> These are your current bookings: </h5>
+                    <ul style="list-style: none;">
+                    {% for book in bookings %}
+                        <li><a href="/booking/detail/{{ book.id }}/">{{ book.purpose }}</a></li>
+                    {% endfor %}
+                    </ul>
+                {% else %}
+                    <h5> You have no current bookings <h5>
+                {% endif %}
+            {% endif %}
+        {% endblock welcome_back %}
     </div>
 
     <!-- Get started -->
index d08145c..d9648c2 100644 (file)
             </ul>
         </nav>
     </div>
+</div>
+  <div class=”row”>
+    <div class=”col-xs-6 col-md-4”>
+    Is something not working right? Let us know <a href="mailto::{{contact_email}}"> here! </a>
+    </div>
 </div>
 <!-- Top header -->
 <div class="row">
index a8e0ff8..fc6b3e3 100644 (file)
@@ -9,4 +9,4 @@
     book a
     whole block of servers with customized layer2 networks (e.g. a Pharos Pod). Read more here: 
     <a href="https://wiki.opnfv.org/x/HAE-Ag" target="_blank">LaaS Wiki</a></p>
-{% endblock about_us %}
+{% endblock %}
\ No newline at end of file
index 9666d72..fb311b7 100644 (file)
@@ -10,6 +10,7 @@
 
 from django.http import HttpResponse
 from django.shortcuts import render
+from account.models import Lab
 
 import uuid
 
@@ -73,7 +74,12 @@ def viewport_view(request):
 
     if request.method != 'GET':
         return HttpResponse(status=405)
-    return render(request, 'workflow/viewport-base.html')
+
+    context = {
+        'contact_email': Lab.objects.get(name="UNH_IOL").contact_email
+    }
+
+    return render(request, 'workflow/viewport-base.html', context)
 
 
 def create_workflow(request):