<div class="list-group">
    {% if settings.side_menu_home %}
    <a href="{{ '/'|link }}" title="{{ 'Home'|trans }}" class="list-group-item list-group-item-action{% if request._url is null %} active{% endif %}">
        <i class="fa fa-home me-2"></i> {{ 'Home'|trans }}</a>
    {% endif %}
    {% if settings.side_menu_order %}
    <a href="{{ '/order'|link }}" title="{{ 'Order'|trans }}" class="list-group-item list-group-item-action{% if request._url starts with '/order/service' %}{% elseif request._url starts with '/order' %} active{% endif %}">
        <i class="fa fa-shopping-cart me-2"></i>{{ 'Order'|trans }}</a>
    {% endif %}

    {% if client %}
        {% if settings.side_menu_services %}
        <a href="{{ 'order/service'|link }}" title="{{ 'Services'|trans }}" class="list-group-item d-flex justify-content-between align-items-center{% if request._url starts with '/order/service' %} list-group-item-success{% endif %}">
            <span class="text-success"><i class="fa fa-cog me-2"></i>{{ 'Services'|trans }}</span>

            {% set suspendedServices = client.order_get_list({ 'status': 'suspended' }).total %}

            {% if suspendedServices > 0 %}
                <span class="badge bg-danger rounded-pill">{{ suspendedServices }}</span>
            {% endif %}
        </a>
        {% endif %}
        {% if settings.side_menu_invoices %}
        <a href="{{ 'invoice'|link }}" title="{{ 'Invoices'|trans }}" class="list-group-item d-flex justify-content-between align-items-center{% if request._url starts with '/invoice' %} list-group-item-danger{% endif %}">
            <span class="text-danger"><i class="fa fa-credit-card me-2"></i>{{ 'Invoices'|trans }}</span>
            {% if client.invoice_get_list({ 'status': 'unpaid' }).total > 0 %}
                <span class="badge bg-danger rounded-pill">{{ client.invoice_get_list({ 'status': 'unpaid' }).total }}</span>
            {% endif %}
        </a>
        {% endif %}
        {% if settings.side_menu_support %}
        <a href="{{ 'support'|link }}" title="{{ 'Tickets'|trans }}" class="list-group-item d-flex justify-content-between align-items-center{% if request._url == '/support' %} list-group-item-info{% endif %}">
            <span class="text-info"><i class="fa fa-life-ring me-2"></i>{{ 'Support'|trans }}</span>
            {% set openedTickets = client.support_ticket_get_list({ 'status': 'open' }).list|length %}

            {% if openedTickets > 0 %}
                <span class="badge bg-danger rounded-pill">{{ openedTickets }}</span>
            {% endif %}
        </a>
        {% endif %}
        <!--<a href="{{ '/client/balance'|link }}" title="{{ 'Payment history'|trans }}" class="list-group-item" ><i class="fa fa-archive"></i> {{ 'Payment history'|trans }}</a>-->
    {% endif %}

    {% if settings.side_menu_blog and guest.extension_is_on({ 'mod': 'news'}) %}
    <a href="{{ '/news'|link }}" title="{{ 'Blog'|trans }}" class="list-group-item list-group-item-action{% if request._url starts with '/news' %} active{% endif %}">
        <i class="fa fa-bullhorn me-2"></i>{{ 'Blog'|trans }}</a>
    {% endif %}
    {% if settings.side_menu_forum and guest.extension_is_on({ 'mod': 'forum' }) %}
    <a href="{{ '/forum'|link }}" class="list-group-item list-group-item-action{% if request._url starts with '/forum' %} active{% endif %}">
        <i class="fa fa-comments me-2"></i>{{ 'Forum'|trans }}</a>
    {% endif %}
    {% if settings.side_menu_kb and guest.extension_is_on({ 'mod': 'kb' }) %}
    <a href="{{ 'kb'|link }}" title="{{ 'Knowledge base'|trans }}" class="list-group-item{% if request._url starts with '/kb' %} active{% endif %}">
        <i class="fa fa-graduation-cap me-2"></i>{{ 'Knowledge base'|trans }}</a>
    {% endif %}
    {% if settings.side_menu_contact %}
    <a href="{{ '/support/contact-us'|link }}" class="list-group-item list-group-item-action{% if request._url starts with '/support/contact-us' %} active{% endif %}">
        <i class="fa fa-envelope me-2"></i>{{ 'Contact us'|trans }}</a>
    {% endif %}

    {% if not client and settings.side_menu_register %}
        <a class="list-group-item list-group-item-success" title="{{ 'Login'|trans }} / {{ 'Register'|trans }}" data-bs-toggle="modal" data-bs-target="#login">{{ 'Login'|trans }} / {{ 'Register'|trans }}</a>
    {% endif %}
</div>
