
 {% load static %}
{% include 'dashboard/admin_dashboard/header.html' %}
{% include 'dashboard/admin_dashboard/body.html' %}
<!-- Right side column. Contains the navbar and content of the page -->
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <div style="padding:10px;">
      {% if messages %}
          {% for message in messages %}
          <div class="alert {% if 'success' in message.tags %}alert-success{% elif 'danger' in message.tags %}alert-danger{% endif %}" role="alert" id="success-alert">
  <!--                            <div class="alert alert-success" role="alert" id="success-alert">-->
              {{message}}
              <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                  <span aria-hidden="true">&times;</span>
              </button>
          </div>
          {% endfor %}
      {% endif %}
    </div>
    <section class="content-header">
      <h1>
        Roles Management
        <small>Control panel</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
        <li class="active">Roles</li>
      </ol>
    </section>
    <section class="content">
    <!-- Small boxes (Stat box) -->
      <div class="row">
        <div class="col-xs-12">

          <div class="box">
          <div class="box-header">
          </div>
          <a href="{% url 'admin_role_add' %}" class="btn btn-primary" style="margin: 10px;">ADD
            ROLES</a>
<!--          <button id="delete-selected" class="btn btn-danger" style="margin: 10px;"><i class="fa fa-trash-o"></i> DELETE SELECTED</button>-->
          <div class="table-responsive" style="margin: 10px;">
            <table id="roles_table" class="table table-bordered table-striped" style="width:100%;">
                <thead>
                  <tr>
                    <th>ID</th>
                    <th>NAME</th>                    
                    <th>ACTIONS</th>
                  </tr>
                </thead>
                <tbody>
                {% for all_data in all_role %}
                <tr>
                    <td>{{all_data.id}}</td>
                    <td>{{all_data.name}}</td>
                    <td>
                      {% if all_data.name != "Admin" and all_data.name != "admin" %}
                          <a href="{% url 'admin_role_edit' all_data.id %}" class="btn btn-primary">
                              <i class="fa fa-pencil"></i>
                          </a>
                          <button class="btn btn-danger delete-link" data-id="{{ all_data.id }}" id="delete" value="{% url 'admin_role_delete' all_data.id %}">
                              <i class="fa fa-trash-o"></i>
                          </button>
                      {% endif %}
                  </td>
                </tr> 
                {%  endfor %}
                </tbody>  

            </table>
            {% csrf_token %}

      </div>
</section>
</div>
</div>









{% include 'dashboard/visitors_dashboard/footer.html' %}


<script src="{% static 'dist/js/pages/roles_delete.js' %}" type="text/javascript"></script>
