{%extends "users/base.html" %}
{% block navi_content %}
    {%include "users/includes/navicontents_admin.html" %}
{% endblock %}
{% block usernavi_content %}
    {%include "users/includes/usernavicontents_admin.html" %}
{% endblock %}

{% block main_content %}
 <div class="header">
        <h4 class="title">List of Users</h4>
 </div>
 <div class="content table-responsive table-full-width" >

    <div style="color: lightgreen; text-align: center; padding-left: 20%; padding-top: 5%;">
        {% if messages %}
        <ul class="messages" style="text-align: left; color: lightgreen; list-style-type: none">
            {% for message in messages %}
            <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
            {% endfor %}
        </ul>
        {% endif %}
    </div>

     <table class="table table-hover table-striped" summary="user_list">

         <thead>
         <th>Username</th>
         <th>First Name</th>
         <th>Last Name</th>
         <th>Email Address</th>
         <th style="text-align:center">Edit</th>
         <th style="text-align:center" >Delete</th>
         </thead>
         <tbody>
         {% if all_users_list %}
             {% for users in all_users_list %}
                 <tr>
                         <td><a href="{% url 'user_detail' request.user.username users.username %}">{{ users.username }}</a></td>
                         <td>{{ users.first_name }}</td>
                         <td>{{ users.last_name }}</td>
                         <td>{{ users.email }}</td>
                         <td style="text-align:center">
                             <a href="{% url 'update_user' username=request.user.username user=users.username %}">
                                 <div class="font-icon-detail"><i class="pe-7s-note"></i>
                                 </div>
                             </a>
                         </td>
                         <td style="text-align:center">
                             <a href="{% url 'delete_user' username=request.user.username d=users.username %}">
                                 <div class="font-icon-detail"><i class="pe-7s-trash"></i>
                                 </div>
                             </a>
                         </td>
                     </tr>
             {% endfor %}
             </tbody>
         {% else %}
             <p>No users have been created</p>
         {% endif %}
     </table>
     {%include "users/includes/pagni.html" with page=all_users_list %}
</div>
{% endblock%}