diff options
author | Parker Berberian <pberberian@iol.unh.edu> | 2019-01-24 10:25:30 -0500 |
---|---|---|
committer | Parker Berberian <pberberian@iol.unh.edu> | 2019-02-25 13:38:20 -0500 |
commit | 0b06dba533ad66af82785b961dad1fb37e09c94d (patch) | |
tree | 29408e39872e40690bcb121a320e830d9c69fa09 /dashboard/src/templates/account | |
parent | 879ebf85275e5f8942eb1a1e30d76cbee2a70715 (diff) |
Hides expired bookings in the "My Bookings" Page
This commit hides bookings that have ended from cluttering
the "My Bookings" page.
Change-Id: I0f98fbff97b1474e73a666aa0000e1923266fafb
Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
Diffstat (limited to 'dashboard/src/templates/account')
-rw-r--r-- | dashboard/src/templates/account/booking_list.html | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/dashboard/src/templates/account/booking_list.html b/dashboard/src/templates/account/booking_list.html index e56b19e..ed59b81 100644 --- a/dashboard/src/templates/account/booking_list.html +++ b/dashboard/src/templates/account/booking_list.html @@ -8,7 +8,7 @@ <h3>Booking {{booking.id}}</h3> <ul class="list-group"> <li class="list-group-item">id: {{booking.id}}</li> - <li class="list-group-item">lab: {{booking.resource.template.lab.lab_user.username}}</li> + <li class="list-group-item">lab: {{booking.lab}}</li> <li class="list-group-item">resource: {{booking.resource.template.name}}</li> <li class="list-group-item">start: {{booking.start}}</li> <li class="list-group-item">end: {{booking.end}}</li> @@ -36,7 +36,7 @@ <ul class="list-group"> <li class="list-group-item">id: {{booking.id}}</li> <li class="list-group-item">lab: {{booking.lab}}</li> - <li class="list-group-item">resource: {{booking.resource_name}}</li> + <li class="list-group-item">resource: {{booking.resource.template.name}}</li> <li class="list-group-item">start: {{booking.start}}</li> <li class="list-group-item">end: {{booking.end}}</li> <li class="list-group-item">purpose: {{booking.purpose}}</li> @@ -47,6 +47,28 @@ {% endfor %} </div> + <h2>Expired Bookings + <i class="fa fa-fw fa-caret-down" onclick='toggle_display("expired_bookings");'></i> + </h2> + <div id="expired_bookings" class="card_container" style="display:none;"> + {% for booking in expired_bookings %} + <div class="detail_card"> + <div> + <h3>Booking {{booking.id}}</h3> + <ul class="list-group"> + <li class="list-group-item">id: {{booking.id}}</li> + <li class="list-group-item">lab: {{booking.lab}}</li> + <li class="list-group-item">resource: {{booking.resource.template.name}}</li> + <li class="list-group-item">start: {{booking.start}}</li> + <li class="list-group-item">end: {{booking.end}}</li> + <li class="list-group-item">purpose: {{booking.purpose}}</li> + <li class="list-group-item">owner: {{booking.owner.userprofile.email_addr}}</li> + </ul> + </div> + <a class="btn btn-primary" href="/booking/detail/{{booking.id}}/">Details</a> + </div> + {% endfor %} + </div> <script> var current_booking_id = -1; function cancel_booking(booking_id) { @@ -64,6 +86,15 @@ req.onerror = function() { alert("problem submitting form"); } req.send(formData); } + + function toggle_display(elem_id){ + var e = document.getElementById(elem_id); + if (e.style.display === "none"){ + e.style.display = "grid"; + } else { + e.style.display = "none"; + } + } </script> <div class="modal fade" id="resModal" tabindex="-1" role="dialog" aria-labelledby="my_modal" aria-hidden="true"> <div class="modal-dialog" style="width: 450px;" role="document"> |