blob: 2651319062ef106e084fc3aef328993aa5c444bb [file] [log] [blame]
{% extends "base.html" %}
{% block app_content %}
<div class="jumbotron">
<h3>All Bookings</h3>
<br/>
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">User</th>
<th scope="col">Flavor</th>
<th scope="col">IP</th>
<th scope="col">Created On</th>
<th scope="col">Expires On</th>
<th scope="col">Status</th>
<th scope="col">Action</th>
</tr>
</thead>
<tbody>
{% for booking in bookings %}
{% set booking_status_text = booking_status_id_to_text[booking.status_id] %}
{% set booking_user = user_id_to_name[booking.user_id] %}
{% set text_color = '#808080' %}
{% if booking_status_text == 'new' %}
{% set text_color = '#808080' %}
{% elif booking_status_text == 'deploying' %}
{% set text_color = '#f4d03f' %}
{% elif booking_status_text == 'active' %}
{% set text_color = '#239b56' %}
{% elif booking_status_text == 'expired' %}
{% set text_color = '#eb984e' %}
{% elif booking_status_text == 'failed' %}
{% set text_color = '#ff0000' %}
{% elif booking_status_text == 'cancelled' %}
{% set text_color = '#cfcbcb' %}
{% endif -%}
<tr>
<th scope="row">{{ booking.id }}</th>
<td>{{ booking_user }}</td>
<td>{{ booking.scenario }}</td>
<td>{{ booking.floating_ip }}</td>
<td>{{ booking.created_on }}</td>
<td>{{ booking.expires_on }}</td>
<td><b><font color='{{ text_color }}'>{{ booking_status_text }}</font></b></td>
<td></td>
</tr>
{% endfor %}
</tbody>
</table>
<center>
{% if prev_url %}
<a href="{{ prev_url }}">Newer bookings</a>&nbsp&nbsp
{% endif %}
{% if next_url %}
<a href="{{ next_url }}">Previous bookings</a>
{% endif %}
</center>
</div>
<div class="jumbotron" style="background:white">
</div>
{% endblock %}