digitalfabrik/integreat-cms

View on GitHub
integreat_cms/cms/templates/offertemplates/offertemplate_list.html

Summary

Maintainability
Test Coverage
{% extends "_base.html" %}
{% load i18n %}
{% block content %}
    {% load static %}
    <div class="table-header">
        <div class="flex flex-wrap justify-between">
            <h1 class="heading">
                {% translate "Offer Templates" %}
            </h1>
            {% if perms.cms.change_offertemplate %}
                <a href="{% url 'new_offertemplate' %}" class="btn">{% translate "Create offer template" %}</a>
            {% endif %}
        </div>
    </div>
    <div class="table-listing">
        <table class="w-full mt-4 rounded border border-solid border-gray-200 shadow bg-white">
            <thead>
                <tr class="border-b border-solid border-gray-200">
                    <th class="text-sm text-left uppercase py-3 pl-4 pr-2">
                        {% translate "Name" %}
                    </th>
                    <th class="text-sm text-left uppercase py-3 pr-2">
                        {% translate "Slug" %}
                    </th>
                    <th class="text-sm text-left uppercase py-3 pr-2">
                        {% translate "URL" %}
                    </th>
                    <th class="text-sm text-left uppercase py-3 pr-2">
                        {% translate "Last updated" %}
                    </th>
                    <th class="text-sm text-left uppercase py-3 pr-2">
                        {% translate "Created" %}
                    </th>
                    <th class="text-sm text-left uppercase py-3 pr-2"
                        title="{% translate "Number of regions where this offer is enabled" %}">
                        {% translate "Number of regions" %}
                    </th>
                    <th class="text-sm text-left uppercase py-3 p2-4 pr-4 min">
                        {% translate "Options" %}
                    </th>
                </tr>
            </thead>
            <tbody>
                {% for offer_template in offertemplates %}
                    {% include "offertemplates/offertemplate_list_row.html" %}
                {% empty %}
                    <tr>
                        <td colspan="7" class="px-4 py-3">
                            {% translate "No offer templates available yet." %}
                        </td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
    {% url "offertemplates" as url %}
    {% include "pagination.html" with chunk=page_obj %}
    {% include "../generic_confirmation_dialog.html" %}
{% endblock content %}