{% extends "jgo/manage/man_list_matcher.html" %}
{% load i18n %}
{% load juntagrico.config %}
{% block page_title %}
    <h3>
        {% blocktrans %}Abgeschlossene Patenschaften{% endblocktrans %}
    </h3>
{% endblock %}
{% block list %}
    {% if removed %}
        <div class="alert alert-success">
            {% trans "Patenschaft wurde gelöscht" %}
        </div>
    {% endif %}
    <table id="filter-table" class="list table" style="display: table;">
        <thead>
            <tr>
                <th class="filter">
                    {% trans "Gotte/Götti" %}
                </th>
                <th class="filter">
                    {% trans "Neumitglied" %}
                </th>
                <th class="filter">
                    {% trans "Angemeldet am" %}
                </th>
                <th class="filter">
                    {% trans "Notizen" %}
                </th>
                <th class="d-none">
                    {% trans "E-Mail" %}
                </th>
            </tr>
        </thead>
        <tbody>
            {% for godchild in management_list %}
                {% with godparent=godchild.godparent %}
                    <tr class="godparent-{{ godparent.id }} godchild-{{ godchild.id }}">
                        <td>
                            {% include 'jgo/snippets/match_entry.html' with subject=godparent matching_slots=godchild.slots %}
                        </td>
                        <td>
                            {% include 'jgo/snippets/match_entry.html' with subject=godchild matching_slots=godparent.slots %}
                        </td>
                        <td>
                            {{ godchild.creation_date }}
                        </td>
                        <td>
                            {{ godchild.notes }}
                            <a href="{% url godchild.admin_change_url_name godchild.id %}" class="fas fa-pen"></a>
                        </td>
                        <td class="email d-none">
                            {{ godparent.member.email }},{{ godchild.member.email }}
                        </td>
                    </tr>
                {% endwith %}
            {% endfor %}
        </tbody>
    </table>
{% endblock %}
