{% extends 'base.html.twig' %}

{% block stylesheets %}
    <!-- Theme CSS - Includes Bootstrap -->
    <style type="text/css">
        .masthead{
            background: url(../img/bg-pattern.png),linear-gradient(to right,#943129,#826412) !important;
        }
    </style>
{% endblock %}
{% block menu %} {% endblock %}
{% block body %}
    <header class="masthead">
        <div class="container h-100">
            <div class="row h-100 align-items-center justify-content-center text-center">
                <div class="col-lg-10 align-self-end">
                    <h4 class="text-uppercase text-white font-weight-bold">Following screens exists</h4>
                    <hr class="divider my-4">
                </div>
                <div class="col-lg-8 align-self-baseline">
                    <table class="table table-striped table-light ml-5" style="background: #efeaea">
                        <thead>
                        <tr>
                            <th scope="col">#</th>
                            <th scope="col">Group name</th>
                            <th scope="col">Tatami</th>
                            <th scope="col">Status</th>
                            <th scope="col">Action</th>
                        </tr>
                        </thead>
                        <tbody>
                        {% for group in groups %}
                            <tr>
                                <th scope="row">{{ loop.index }}</th>
                                <td>{{ group.name }}</td>
                                <td>{{ group.tatami }}</td>
                                <td>{{ group.status }}</td>
                                <td><a class="btn btn-primary btn-sm " href="/screen/{{ group.id }}">Details</a></td>
                            </tr>
                        {% else %}
                            <tr>
                                <td colspan="5">No data available</td>
                            </tr>
                        {% endfor %}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </header>
    <script type="text/javascript">
        setTimeout(function(){
            window.location.reload(1);
        }, 5000);
    </script>
{% endblock %}
