{% extends 'base.jinja2' %}

{% block body %}
    <div class="d-flex wrapper">
        <div class="bg-light border-right sidebar-wrapper">
            {% if realms %}
                <h2 class="sidebar-heading">Realms</h2>
                <div class="list-group list-group-flush">
                    {% for realm_item in realms %}
                        <a href="{{ url('realm-detail', args=[realm_item.id]) }}"
                           class="list-group-item list-group-item-action bg-light">{{ realm_item.name }} </a>
                    {% endfor %}
                </div>
            {% else %}
                <h2 class="sidebar-heading">Bereich</h2>
                <a href="{{ url('realm-home') }}" class="list-group-item list-group-item-action bg-light">
                    Bereichsübersicht</a>
                {% if realm %}
                    <h2 class="sidebar-heading">{{ realm.name }}</h2>
                    <div class="list-group list-group-flush">
                        <a href="{{ url('realm-detail', args=[realm.id]) }}"
                           class="list-group-item list-group-item-action bg-light">Bereichsinformationen</a>
                        <a href="{{ url('realm-user-list', args=[realm.id]) }}"
                           class="list-group-item list-group-item-action bg-light">Nutzer</a>
                        <a href="{{ url('realm-group-list', args=[realm.id]) }}"
                           class="list-group-item list-group-item-action bg-light">Gruppen</a>
                    </div>
                {% endif %}
            {% endif %}
        </div>

        <div class="page-content-wrapper">
            <div class="container-fluid">
                {% block admin_content %}{% endblock %}
            </div>
        </div>
    </div>
{% endblock %}