digitalfabrik/integreat-cms

View on GitHub
integreat_cms/cms/templates/languages/language_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 "Manage Languages" %}
            </h1>
            {% if perms.cms.change_language %}
                <a href="{% url 'new_language' %}" class="btn">{% translate "Create language" %}</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">
                    {% get_current_language as LANGUAGE_CODE %}
                    <th class="text-sm text-left uppercase py-3 pl-4 pr-2">
                        {% translate "Name in" %} {{ LANGUAGE_CODE|language_name_local }}
                    </th>
                    <th class="text-sm text-left uppercase py-3 pr-2">
                        {% translate "Native 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 "BCP47 Tag" %}
                    </th>
                    <th class="text-sm text-left uppercase py-3 pr-2">
                        {% translate "Country Flags" %}
                    </th>
                    <th class="text-sm text-left uppercase py-3 pr-2">
                        {% translate "Language Color" %}
                    </th>
                    <th class="text-sm text-left uppercase py-3 pr-2">
                        {% translate "Text direction" %}
                    </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">
                        {% translate "Last updated" %}
                    </th>
                    <th class="text-sm text-right uppercase py-3 pr-2"
                        title="{% translate "Number of regions where this language is used" %}">
                        {% translate "Number of regions" %}
                    </th>
                    <th class="text-sm text-right uppercase py-3 pl-2 pr-4 min">
                        {% translate "Options" %}
                    </th>
                </tr>
            </thead>
            <tbody>
                {% for language in languages %}
                    {% include "languages/language_list_row.html" %}
                {% empty %}
                    <tr>
                        <td colspan="6" class="px-2 py-3">
                            {% translate "No languages available yet." %}
                        </td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
    {% url "languages" as url %}
    {% include "pagination.html" with chunk=page_obj %}
    {% include "../generic_confirmation_dialog.html" %}
{% endblock content %}