{% extends "_base.html" %}
{% load i18n %}
{% block content %}
{% load static %}
<div class="table-header">
    <div class="flex flex-wrap justify-between">
        <h1 class="heading">{% trans 'Manage Organizations' %}</h1>
        {% if perms.cms.change_organization %}
            <a href="{% url 'new_organization' region_slug=request.region.slug %}" class="btn">
	            {% trans 'Create organization' %}
            </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">{% trans 'Name' %}</th>
                <th class="text-sm text-left uppercase py-3 px-2">{% trans 'Slug' %}</th>
                <th class="text-sm text-left uppercase py-3 px-2">{% trans 'Logo' %}</th>
                <th class="text-sm text-left uppercase py-3 p2-4 pr-4 min">{% trans 'Options' %}</th>
            </tr>
        </thead>
        <tbody>
        {% for organization in organizations %}
            {% include "organizations/organization_list_row.html" %}
        {% empty %}
            <tr>
	            <td colspan="6" class="px-4 py-3">
		            {% trans 'No organizations available yet.' %}
	            </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
</div>

{% include "../generic_confirmation_dialog.html" %}
{% url "organizations" as url %}
{% include "pagination.html" with chunk=organizations %}
{% endblock %}