{% extends 'taxsystem/base.html' %}
{% load i18n %}
{% load humanize %}
{% load evelinks %}
{% load sri %}

{% block page_title %}
    {{ title }} ⋗ {% translate "Tax System" %}
{% endblock %}

{% block page_topic %}
    <h1 class="page-header text-center">
        {{ title }}
    </h1>
    <p class="text-center text-muted">
        {% blocktranslate count count=total_count %}
            {{ count }} Owner
        {% plural %}
            {{ count }} Owners
        {% endblocktranslate %}
        ({{ corporation_count }} {% translate "Corporations" %}, {{ alliance_count }} {% translate "Alliances" %})
    </p>
{% endblock page_topic %}

{% block taxsystem_block %}
<div class="card card-body bg-secondary">
    {% include 'taxsystem/partials/table/owner-overview.html' %}
</div>
{% endblock %}

{% block extra_javascript %}
    <!-- load the settings bundle -->
    {% include "taxsystem/bundles/settings-css.html" %}
    {% include 'taxsystem/bundles/settings-js.html' %}
    <!-- load datatables for owner overview -->
    {% include 'bundles/datatables-css-bs5.html' %}
    {% include 'bundles/datatables-js-bs5.html' %}
    <script>
        $(document).ready(function() {
            $('#ownerTable').DataTable({
                order: [[1, 'asc']],  // Sort by Name
                pageLength: 25,
                columnDefs: [
                    { orderable: false, targets: [0, 3] },  // Portrait and Actions not sortable
                    { width: '80px', targets: 0 },  // Portrait column width
                    { width: '120px', targets: 2 },  // Type column width
                    { width: '180px', targets: 3 }   // Actions column width
                ],
                language: {
                    emptyTable: "{% translate 'No owners found. You need permissions to view at least one corporation or alliance.' %}"
                }
            });
        });
    </script>
{% endblock %}
