{% extends 'aacampaign/base.html' %}

{% load i18n %}
{% load humanize %}

{% block details %}
    <div class="card card-primary">
        <div class="card-header">
            <h3 class="card-title">{% translate "Active Campaigns" %}</h3>
        </div>

        <div class="card-body">
            <div class="table-responsive">
                <table class="table table-striped table-hover">
                    <thead>
                        <tr>
                            <th>{% translate "Campaign" %}</th>
                            <th>{% translate "Start Date" %}</th>
                            <th>{% translate "End Date" %}</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for campaign in campaigns %}
                            <tr>
                                <td>
                                    <a href="{% url 'aacampaign:campaign_details' campaign.id %}">
                                        {{ campaign.name }}
                                    </a>
                                </td>
                                <td>{{ campaign.start_date|date:"Y-m-d" }}</td>
                                <td>{{ campaign.end_date|date:"Y-m-d"|default:"-" }}</td>
                            </tr>
                        {% empty %}
                            <tr>
                                <td colspan="3" class="text-center">{% translate "No active campaigns found." %}</td>
                            </tr>
                        {% endfor %}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
{% endblock %}

{% block extra_javascript %}
{% endblock %}

{% block extra_css %}
{% endblock %}

{% block extra_script %}
{% endblock %}
