{% load i18n %}

{% if message %}
    <p class="alert text-center alert-warning">{% translate "Group Error" %}: {{message}} </p>
{% endif %}

<table class="table table-striped table-hover">
    <thead>
        <tr>
            <th>{% translate "Requirement(s)" %}</th>
            <th class="text-center">{% translate "Note" %}</th>
            <th class="text-right"><!-- {% translate "Result" %} --></th>
        </tr>
    </thead>

    <tbody>
        {% for filter in filters %}
            <tr>
                <td><p>{{ filter.name }}</p></td>
                <td class="text-center"><p>{{ filter.message|safe }}</p></td>
                <td>
                    {% if filter.check %}
                        <button class="pull-right btn btn-sm btn-success">
                            <i class="fas fa-check-circle"></i>
                        </button>
                    {% else %}
                        <button class="pull-right btn btn-sm btn-danger">
                            <i class="fas fa-times-circle"></i>
                        </button>
                    {% endif %}
                </td>
            </tr>
        {% endfor %}
    </tbody>
</table>

<div class="clearfix">
    <a class="btn btn-primary pull-right" {% if pass_checks %}href="{% url 'securegroups:request_add' group_id %}" {% else %}disabled{% endif %}>
        {% if pass_checks %}
            {% translate "Join Group" %}
        {% else %}
            {% translate "Ineligible" %}
        {% endif %}
    </a>
</div>
