summaryrefslogtreecommitdiffstats
path: root/dashboard/src/templates
diff options
context:
space:
mode:
authorSawyer Bergeron <sbergeron@iol.unh.edu>2018-02-26 17:52:25 -0500
committerSawyer Bergeron <sbergeron@iol.unh.edu>2018-03-26 18:42:42 +0000
commitdd7e16215d3bf6bb21a6d4325171d9d556c5da2d (patch)
tree4bcc357d920e29c3f74e1a7879f8c77d5c3097c3 /dashboard/src/templates
parent2085e52073396b265789fecd44a56c3b4e0d4970 (diff)
Limit User Booking Length and Extensions
Jira: PHAROS-363 Bookings can now only be 3 weeks upon creation with a maximum of 2 1 week extensions. Change-Id: I677770de3f62f188d23e60be6d71b42b25bf007e Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Diffstat (limited to 'dashboard/src/templates')
-rw-r--r--dashboard/src/templates/booking/booking_calendar.html15
-rw-r--r--dashboard/src/templates/booking/booking_detail.html6
2 files changed, 19 insertions, 2 deletions
diff --git a/dashboard/src/templates/booking/booking_calendar.html b/dashboard/src/templates/booking/booking_calendar.html
index 81efbe5..b60db3c 100644
--- a/dashboard/src/templates/booking/booking_calendar.html
+++ b/dashboard/src/templates/booking/booking_calendar.html
@@ -64,13 +64,26 @@
{% bootstrap_form_errors form type='non_fields' %}
<form method="post" action="" class="form" id="bookingeditform">
{% csrf_token %}
-
+ <div id='hide_if_noext'>
<div class='input-group' id='starttimeeditpicker'>
{% bootstrap_field form.start addon_after='<span class="glyphicon glyphicon-calendar"></span>' %}
</div>
<div class='input-group' id='endtimeeditpicker'>
{% bootstrap_field form.end addon_after='<span class="glyphicon glyphicon-calendar"></span>' %}
</div>
+ </div>
+ <script type="text/javascript">
+ if( {{ booking.ext_count }} <= 0 ){
+ var hidediv = document.getElementById('hide_if_noext');
+ hidediv.style.display = 'none';
+ var par = document.createElement("div");
+ var text = document.createTextNode("No Extensions Remaining");
+ par.appendChild(text);
+ par.style.fontWeight = 'bold';
+ par.style.paddingBottom = '15pt';
+ hidediv.parentNode.insertBefore(par,hidediv.nextSibling);
+ }
+ </script>
{% bootstrap_field form.purpose %}
{% bootstrap_field form.installer %}
{% bootstrap_field form.scenario %}
diff --git a/dashboard/src/templates/booking/booking_detail.html b/dashboard/src/templates/booking/booking_detail.html
index c88cd84..4628a62 100644
--- a/dashboard/src/templates/booking/booking_detail.html
+++ b/dashboard/src/templates/booking/booking_detail.html
@@ -44,6 +44,10 @@
<p>
<b>Scenario: </b> {{ booking.scenario }}
</p>
+<p>
+ <b>Extensions Remaining: </b> {{ booking.ext_count }}
+</p>
+
{% if user.is_authenticated %}
{% if user.get_username == booking.user.username %}
<p>
@@ -67,4 +71,4 @@
</div>
</p>
{% endif %}
-{% endif %} \ No newline at end of file
+{% endif %}