{% extends "base.html" %}
{% comment %}
Copyright (C) 2018-2025 by BDE ENS Paris-Saclay
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load render_table from django_tables2 %}
{% load i18n %}

{% block content %}
<div class="row">
    <div class="col-xl-12">
        <div class="btn-group btn-group-toggle" style="width: 100%; padding: 0 0 2em 0">
            <a href="{% url "family:family_list" %}" class="btn btn-sm btn-outline-primary">
                {% trans "Families" %}
            </a>
            <a href="#" class="btn btn-sm btn-outline-primary active">
                {% trans "Challenges" %}
            </a>
            {% if can_manage %}
            <a href="{% url "family:manage" %}" class="btn btn-sm btn-outline-primary">
                {% trans "Manage" %}
            </a>
            {% endif %}
        </div>
    </div>
</div>

<div class="card bg-white mb-3">
    <h3 class="card-header text-center">
        {{ title }}
    </h3>
    {% render_table table %}
</div>
{% endblock %}

{% block extrajavascript %}
<script type="text/javascript">
    $(".table-row").click(function () {
            window.document.location = $(this).data("href");
        });
</script>
{% endblock %}
