{% extends 'layout.html' %}
{% load i18n %}

{% block title %}{% trans "Administration" %}{% endblock %}

{% block content %}

<header class="block column is-offset-one-quarter pl-1">
    <div class="columns is-mobile">
        <div class="column">
            <h1 class="title">{% block header %}{% endblock %}</h1>
            {% block breadcrumbs %}{% endblock %}
        </div>
        <div class="column is-narrow">
            {% block edit-button %}{% endblock %}
        </div>
    </div>
</header>


<div class="block columns">
    <nav class="menu column is-one-quarter">
        <h2 class="menu-label">
            {% url 'settings-dashboard' as url %}
            <a
                href="{{ url }}"
                {% if url in request.path %} class="is-active" aria-selected="true"{% endif %}
            >{% trans "Dashboard" %}</a>
        </h2>
        {% if perms.bookwyrm.create_invites %}
        <h2 class="menu-label">{% trans "Manage Users" %}</h2>
        <ul class="menu-list">
            {% if perms.bookwyrm.moderate_user %}
            <li>
                {% url 'settings-users' as url %}
                <a href="{{ url }}"{% if url in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Users" %}</a>
            </li>
            {% endif %}
            <li>
                {% url 'settings-invite-requests' as url %}
                {% url 'settings-invites' as alt_url %}
                <a href="{{ url }}"{% if url in request.path or request.path in alt_url %} class="is-active" aria-selected="true"{% endif %}>{% trans "Invites" %}</a>
            </li>
            {% if perms.bookwyrm.control_federation %}
            <li>
                {% url 'settings-federation' as url %}
                <a href="{{ url }}"{% if url in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Federated Instances" %}</a>
            </li>
            {% endif %}
        </ul>
        {% endif %}
        {% if perms.bookwyrm.moderate_user %}
        <h2 class="menu-label">{% trans "Moderation" %}</h2>
        <ul class="menu-list">
            <li>
                {% url 'settings-reports' as url %}
                <a href="{{ url }}"{% if url in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Reports" %}</a>
            </li>
            <li>
                {% url 'settings-email-blocks' as url %}
                <a href="{{ url }}"{% if url in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Email Blocklist" %}</a>
            </li>
            <li>
                {% url 'settings-ip-blocks' as url %}
                <a href="{{ url }}"{% if url in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "IP Address Blocklist" %}</a>
            </li>
            <li>
                {% url 'settings-link-domain' as url %}
                <a href="{{ url }}"{% if url in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Link Domains" %}</a>
            </li>
        </ul>
        {% endif %}
        {% if perms.bookwyrm.edit_instance_settings %}
        <h2 class="menu-label">{% trans "Instance Settings" %}</h2>
        <ul class="menu-list">
            <li>
                {% url 'settings-announcements' as url %}
                <a href="{{ url }}"{% if url in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Announcements" %}</a>
            </li>
            <li>
                {% url 'settings-site' as url %}
                <a href="{{ url }}"{% if url in request.path %} class="is-active" aria-selected="true"{% endif %}>{% trans "Site Settings" %}</a>
                {% block site-subtabs %}{% endblock %}
            </li>
        </ul>
        {% endif %}
    </nav>
    <div class="column">
        {% block panel %}{% endblock %}
    </div>
</div>

{% endblock %}
