
<div class="container-fluid dashboard-content">
    <!-- Header -->
    {% set title = "Bookings List" %}
    {% set navigation = [('Admin', ''), ('Bookings List', '')] %}
    {% include 'include_header.html' %}

    <!-- table row -->
    <div class="row">
        <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
            <div class="card">
                <div class="card-header">
                    <h5 class="mb-0">Bookings List</h5>
                </div>
                <div class="card-body">
                    <div class="table-responsive">
                        <table id="bookings-table" class="table table-striped table-bordered" style="width:100%">
                            <thead>
                            <tr>
                                <th>id</th>
                                <th>resource</th>
                                <th>type</th>
                                <th>title</th>
                                <th>creator</th>
                                <th>owner</th>
                                <th>operator</th>
                                <th>start/end</th>
                                <th>days</th>
                                <th>slot_auth</th>
                                <th>IS_USER_AUTH</th>
                                <th>repeat_id</th>
                                <th>repeat_value</th>
                                <th>experiment</th>
                                <th>costs</th>
                                <td>total_cost</td>
                            </tr>
                            </thead>
                            <tbody>
                            {% for b in bookings %}
                            <tr>
                                <td>{{ b['id'] }}</td>
                                <td>{{ b['resource']['name'] }}</td>
                                <td>{{ b['type'] }}</td>
                                <td>{{ b['title'] }}</td>
                                <td>{{ b['creator']['name'] }}</td>
                                <td>{{ b['owner']['name'] }}</td>
                                <td>{{ b['operator']['name'] }}</td>
                                <td>{{ b['start'] }} / {{ b['end'] }}</td>
                                <td>{{ b['days'] }}</td>
                                <td>{{ b['slot_auth'] }}</td>
                                <td>book={{b['user_can_book']}}, view={{b['user_can_view']}}, modify={{b['user_can_modify']}}</td>
                                <td>{{ b['repeat_id'] }}</td>
                                <td>{{ b['repeat_value'] }}</td>
                                <td>{{ b['experiment'] }}</td>
                                <td>{{ b['costs'] }}</td>
                                <td>{{ b['total_cost'] }}</td>
                            </tr>
                            {% endfor %}

                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- end table row -->

</div>

<script>
    $('#bookings-table').DataTable();
</script>