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

{% block title %}
  <title>Profiles</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">Profiles..</h1>
      </div>
    </div>
    <div class="row">
      <table class="table table-hover">
        <thead><tr>
          <th scope="col">Username</th>
          <th scope="col">First Name</th>
          <th scope="col">Last Name</th>
          <th colspan="2">Actions</th>
        </tr></thead>
        <tbody>
        {% for profile in profiles %}
          <tr>
            <th scope="row"><a href="/admins/profiles/{{profile.id}}">{{profile.user_name}}</a></th>
            <th scope="row">{{profile.first_name}}</th>
            <th scope="row">{{profile.last_name}}</th>
            <th scope="row">{{profile.email}}</th>
            <td><a href="/admin/profile/edit/{{profile.id}}" class="btn btn-outline-primary btn-sm active" role="button" aria-pressed="true">Edit</a></td>
            <td><a href="/admin/profile/delete/{{profile.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/profile/add" class="btn btn-outline-primary btn-sm active" role="button" aria-pressed="true">Add Profile</a>
      </div>
    </div>
  </div>
{% endblock %}
