{% extends "orga/cfp/base.html" %}
{% load bootstrap4 %}
{% load i18n %}
{% load rules %}
{% load url_replace %}
{% load pretalx_hitalx %}

{% block content %}
    <h2>
        {{ page_obj.paginator.count }} {% translate 'Speakers' %}
    </h2>

    <div class="submit-group search-submit-group">
        <form class="search-form">
            {% bootstrap_form search_form %}
            {% bootstrap_form filter_form %}
            <button class="btn btn-info btn-search" type="submit">{% translate "Search" %}</button>
        </form>
    </div>
    <div class="table-responsive">
        <table class="table table-sm table-hover table-flip">
            <thead>
            <tr>
                <th>{% translate "Name" %}</th>
                <th>{% translate "Expenses (Paid / Total)" %}</th>
                <th>{% translate "Tours" %}</th>
            </tr>
            </thead>
            <tbody>
            {% for profile in speakers %}
                <tr>
                    <td><a href="{{ profile.orga_urls.base }}">{{ profile.user.get_display_name }}</a></td>
                    <td>
                        <a href="{% url "plugins:pretalx_hitalx:expenses.view" event=request.event.slug speaker_id=profile.user.id %}">{{ profile.user | paid_expenses | euro_amount }} / {{ profile.user | total_expenses | euro_amount }}</a>
                    </td>
                    <td>
                        <a href="{% url "plugins:pretalx_hitalx:speaker_tours.view" event=request.event.slug pk=profile.id %}">{{ profile.tours.count }}</a>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
    {% include "orga/pagination.html" %}
{% endblock %}
