{% load i18n %}

{% load appearance_tags %}
{% load navigation_tags %}

{% appearance_get_icon 'mayan.apps.appearance.icons.icon_menu_actions' extra_context__html_data__style='pointer-events: none;' extra_context__icon_css_classes_extra='appearance-icon-padding-none' as icon_menu_actions %}

{% if setting_common_collapse_list_menu_object %}
    {% navigation_resolved_menus_is_single_link resolved_menus=object_menus_link_results as resolved_menus_is_single_link %}
    {% if resolved_menus_is_single_link %}
        <div class="text-center">
            {% with object_menus_link_results.0.link_groups.0.links as object_navigation_links %}
                {% include 'navigation/generic_navigation.html' %}
            {% endwith %}
        </div>
    {% else %}
        {% with object_menus_link_results as action_menus_link_results %}
            <div class="btn-group">
                <div class="dropdown">
{#                    {% with 'dropdown-menu-right appearance-dropdown-menu-slim' as navigation_action_dropdown_menu_css_classes_extra %}#}
                    {% with 'appearance-dropdown-menu-slim' as navigation_action_dropdown_menu_css_classes_extra %}
                    {% with 'btn btn-default btn-xs btn-invisible' as action_dropdown_classes %}
                    {% with 'true' as action_menu_disable_labels %}
                    {% with icon_menu_actions as action_dropdown_icon %}
                        {% include 'navigation/actions_dropdown.html' %}
                    {% endwith %}
                    {% endwith %}
                    {% endwith %}
                    {% endwith %}
                </div>
            </div>
        {% endwith %}
    {% endif %}
{% else %}
    {% if list_as_items %}
        {% with object_menus_link_results as action_menus_link_results %}
            <div class="btn-group">
                <div class="dropdown">
                    {% with 'true' as action_menu_disable_labels %}
                    {% with 'appearance-dropdown-menu-slim' as navigation_action_dropdown_menu_css_classes_extra %}
                        {% include 'navigation/actions_dropdown.html' %}
                    {% endwith %}
                    {% endwith %}
                </div>
            </div>
        {% endwith %}
    {% else %}
        {% for object_menu_results in object_menus_link_results %}
            {% for link_group in object_menu_results.link_groups %}
                {% with link_group.links as object_navigation_links %}
                    {% include 'navigation/generic_navigation.html' %}
                {% endwith %}
            {% endfor %}
        {% endfor %}
    {% endif %}
{% endif %}
