{% extends 'layouts/default.html' %}
{% block title %}Flowspec Users{% endblock %}
{% block content %}
    <table class="table table-hover">
    <tr>
    <th>UUID</th>
    <th>Name</th>
    <th>Email</th>
    <th>Phone</th>
    <th>Notice</th>
    <th>Role(s)</th>
    <th>Organization(s)</th>
    <th>Action</th>
    </tr>
    {% for user in users %}
        <tr>
        <td>{{ user.uuid }}</td>
        <td>{{ user.name if user.name }}</td>
        <td>{{ user.email if user.name }}</td>
        <td>{{ user.phone if user.name }}</td>
        <td>{{ user.comment if user.comment }}</td>
        <td>
        {% for role in user.role %}
          {{ role.name }} 
        {% endfor %}
        </td>
        <td>
        {% for org in user.organization %}
            {{ org.name }}
        {% endfor %}
        </td>
        <td>
        <a class="btn btn-info btn-sm" href="{{ url_for('admin.edit_user', user_id=user.id) }}" role="button">
            <i class="bi bi-pen"></i>
        </a>
        <a class="btn btn-danger btn-sm" href="{{ url_for('admin.delete_user', user_id=user.id) }}" role="button">
            <i class="bi bi-x-lg"></i>
        </a>
        </td>
        </tr>
    {% endfor %}
    </table>
{% endblock %}