{% load static %}


{% include "diaxeirisi/00_head.html" %}
<body id="app-container" class="menu-default show-spinner">
{% include "diaxeirisi/01_menu.html" %}

    <main>
        <div class="container-fluid">
            <div class="row mb-4">
             <div class="col-12">
                <h2>Καταστήματα</h2>
                <div class="separator mb-5"></div>
                 {% if messages %}
                    <div class="alert alert-success">
                        {% for m in messages %}
                        <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ m }}</li>
                        {% endfor %}
                    </div>
                 {% endif %}
             </div>
                <div class="col-9 col-xl-6 mb-4 mx-auto">
                    <div class="card">
                        <div class="card-body">
                            <table class="table table-responsive data-table data-table-feature4">
                                <thead>
                                    <tr>
                                        <th>Α/Α</th>
                                        <th>Όνομα</th>
                                        <th>Διεύθυνση</th>
                                        <th>Τηλέφωνο</th>
                                        {% if  user.get_username != 'spiti1' and user.get_username != 'spiti2' and user.get_username != 'spiti3' %}
                                        <th>Διαγραφή</th>
                                        {% else %}
                                        <th></th>
                                        {% endif %}
                                    </tr>
                                </thead>
                                <tbody>
                                {% for db_object in  DB_Objects %}
                                    <tr>
                                        <td>{{ db_object.id }}</td>
                                        <td>{{ db_object.name }}</td>
                                        <td>{{ db_object.address }}</td>
                                        <td>{{ db_object.telephone }}</td>
                                        {% if  user.get_username != 'spiti1' and user.get_username != 'spiti2' and user.get_username != 'spiti3' %}
                                        <td>
                                            <a href="/dx/store/delete/{{ db_object.id }}/">

                                            <button type="button" class="btn btn-outline-danger">
                                                Διαγραφή</button>
                                        </a>
                                        </td>
                                        {% else %}
                                        <td></td>
                                        {% endif %}

                                    </tr>
                                {% endfor %}
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </main>


{% include "diaxeirisi/99_footer.html" %}