{% extends "base.html" %}
{% load static %}
{% load i18n %}

{% block title %}
    {% trans "Groups" %}
{% endblock %}

{% block content %}
    <div class="page-header">
        <h1>{% trans "Groups" %}</h1>
    </div>
    {% if perms.auth.add_group %}
        <a class="btn btn-secondary mb-3" href="{% url "core:group_add" %}"><span
                class="fa fa-plus"></span> {% trans "Add group" %}</a>
    {% endif %}
    <table id="event_table" class="table table-striped display">
        <thead>
        <tr>
            <th>{% trans "Name" %}</th>
            <th>{% trans "Action" %}</th>
        </tr>
        </thead>
        <tbody>
        {% for group in group_list %}
            <tr>
                <td>{{ group.name }}</td>
                <td class="d-flex">
                    <a class="btn btn-secondary btn-sm text-nowrap" href="{% url "core:group_edit" group.pk %}"><span
                            class="fa fa-edit"></span> <span class="d-none d-md-inline">{% trans "Edit" %}</span></a>
                    <a class="btn btn-secondary btn-sm text-nowrap ms-1" href="{% url "core:group_delete" group.pk %}"><span
                            class="fa fa-trash-alt"></span> <span class="d-none d-md-inline">{% trans "Delete" %}</span></a>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
{% endblock %}
