{% load static %}
{% load menu_tags %}
{% load wagtailcore_tags %}
{% load i18n %}


<div class="d-flex flex-column flex-shrink-0 p-3 mr-5">
    <img src="{{logo}}" class="img-fluid rounded mx-auto d-block mt-3" style="width: 10rem; height: 10 rem;" alt="Portal Logo"/>
    <hr>
    <ul class="nav navbar-nav">

    {% for item in menu_items %}
        
        {% if item.link_page %}
            <li class="{{ item.active_class }}">
                <a href="{% pageurl item.link_page.localized %}">{{ item.link_page.localized }}</a>
                {% if item.has_children_in_menu %}
                    <button class="btn btn-toggle" data-bs-target="#ddtoggle_{{ item.link_page.pk }}" data-bs-toggle="collapse"
                        aria-expanded={% if item.active_class %}"true" {% else %} "false" {% endif %}
                        aria-controls="#ddtoggle_{{ item.link_page.pk }}">
                        <img src = "{% static 'images/icons/caret-down.svg' %}" alt="&or;"/>                </button>
                    {% sub_menu item.link_page template="menu/custom_submenu.html" use_specific=3 %}
                {% endif %}
            </li>
        {% else %}
            <li class="{{ item.active_class }}">
                <a href="{{item.href}}">{{item.text}}</a>
                {% if item.has_children_in_menu %}
                    <button class="btn btn-toggle" data-bs-target="#ddtoggle_{{ item.link_page.pk }}" data-bs-toggle="collapse"
                        aria-expanded={% if item.active_class %}"true" {% else %} "false" {% endif %}
                        aria-controls="#ddtoggle_{{ item.link_page.pk }}">
                        <img src = "{% static 'images/icons/caret-down.svg' %}" alt="&or;"/>                </button>
                    {% sub_menu item.link_page template="menu/custom_submenu.html" use_specific=3 %}
                {% endif %}
            </li>
        {% endif %}


    {% endfor %}
    </ul>
</div>
<div class="d-flex flex-column flex-shrink-0 p-3 mr-5">
    <hr>
    {% if shop_enabled %}
        <a href={% url 'cart' %} alt="Koszyk" >{% trans "Cart" %}</a>
    {% endif %}
</div>
