{% extends "wei/base.html" %}
{% comment %}
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load render_table from django_tables2 %}
{% load i18n %}

{% block profile_content %}
<div class="card">
    <div class="card-header text-center">
        <h4>{{ object.name }}</h4>
    </div>

    <div class="card-body">
        {{ object.description }}
    </div>

    <div class="card-footer text-center">
        {% if object.club %}
        <a class="btn btn-primary btn-sm my-1" href="{% url 'member:club_detail' pk=object.club.pk %}"
            data-turbolinks="false">{% trans "View club" %}</a>
        {% endif %}
        <a class="btn btn-primary btn-sm my-1" href="{% url 'wei:update_bus' pk=object.pk %}"
            data-turbolinks="false">{% trans "Edit" %}</a>
        <a class="btn btn-primary btn-sm my-1" href="{% url 'wei:update_bus_info' pk=object.pk %}"
            data-turbolinks="false">{% trans "Edit information for survey" %}</a>
        <a class="btn btn-primary btn-sm my-1" href="{% url 'wei:add_team' pk=object.pk %}"
            data-turbolinks="false">{% trans "Add team" %}</a>
    </div>
</div>

<hr>

{% if teams.data %}
<div class="card">
    <div class="card-header position-relative" id="clubListHeading">
        <a class="font-weight-bold">
            <i class="fa fa-bus"></i> {% trans "Teams" %}
        </a>
    </div>
    {% render_table teams %}
</div>

<hr>
{% endif %}

{% if memberships.data %}
<div class="card">
    <div class="card-header position-relative" id="clubListHeading">
        <a class="font-weight-bold">
            <i class="fa fa-bus"></i> {% trans "Members" %}
        </a>
    </div>
    {% render_table memberships %}
</div>

<hr>

<a href="{% url 'wei:wei_memberships_bus_pdf' wei_pk=club.pk bus_pk=object.pk %}" data-turbolinks="false">
    <button class="btn btn-block btn-danger"><i class="fa fa-file-pdf-o"></i> {% trans "View as PDF" %}</button>
</a>
{% endif %}
{% endblock %}