{% extends "shared/base.html" %}

{% block title %}
  <title>Permissions</title>
{% endblock %}

{% block content %}
  {% with msg=msg %}
    {% include "components/alerts.html" %}
  {% endwith %}
  <div class="container">
    <div class="row">
      <div class="col">
        <h1 class="display-5">Permissions..</h1>
      </div>
    </div>
    <div class="row">
      <table class="table table-hover">
        <thead><tr>
          <th scope="col">Name</th>
          <th colspan="2">Actions</th>
        </tr></thead>
        <tbody>
        {% for permission in permissions %}
          <tr>
            <th scope="row"><a href="/admins/permissions/{{permission.id}}">{{permission.name}}</a></th>
            <td><a href="/admin/permission/edit/{{permission.id}}" class="btn btn-outline-primary btn-sm active" role="button" aria-pressed="true">Edit</a></td>
            <td><a href="/admin/permission/delete/{{permission.id}}" class="btn btn-outline-danger btn-sm active" role="button" aria-pressed="true">Delete</a></td>
         </tr>
        {% endfor %}
        </tbody>
      </table>
      <div>
        <a href="/admin/permission/add" class="btn btn-outline-primary btn-sm active" role="button" aria-pressed="true">Add Permission</a>
      </div>
    </div>
  </div>
{% endblock %}
