{% extends 'cabinet/_internal_base.html' %}

{% block breadcrumbs %}
    <li><span>Aggregator source list</span></li>
{% endblock %}

{% block content %}
    <section class="card">
        <header class="card-header">
            <div class="card-button-actions">
                <a href="{% url 'cabinet:aggregator:new' %}" class="btn btn-primary btn-sm" type="button">
                    Add new source
                </a>
            </div>
            <h2 class="card-title">Your sources</h2>
        </header>
        <div class="card-body">
            <table class="table table-hover table-responsive-md mb-0">
                <thead>
                <tr>
                    <th>Title</th>
                    <th>Chat ID</th>
                </tr>
                </thead>
                {% for source in object_list %}
                <tr class="clickable-row" data-href="{% url 'cabinet:aggregator:edit' pk=source.pk %}">
                    <td>{{ source.title }}</td>
                    <td>{{ source.chat_id }}</td>
                </tr>
                {% empty %}
                <tfoot>
                <tr>
                    <td colspan="2">No sources added</td>
                </tr>
                </tfoot>
                {% endfor %}
            </table>
        </div>
    </section>
{% endblock %}
