<div class="multisiteSwitchWrapper">
    <div class="multisiteSwitchContent">
        
        
        {% if (multisite_manager.isEntityInSingleSiteMode()) %}

            {% if allow_mode_switching %}
                <p>
                    Switch to <a href="{{ multisite_manager.getToggleModeUrl() }}" style="text-decoration: underline" onclick="return confirm('Are you sure you want to change the mode to {{ multi_site_mode_label | upper }}?')">{{ multi_site_mode_label }} mode</a> (one item per site).
                </p>
            {% endif %}

            <div style="float: left; margin-bottom: 2em; width: 100%">
                <span class="btn btn-black actionButton" target="_blank">All sites</span>
            </div>

        {% else %}

            {% if allow_mode_switching %}
                <p>
                    Switch to <a href="{{ multisite_manager.getToggleModeUrl() }}" style="text-decoration: underline" onclick="return confirm('Are you sure you want to change the mode to {{ single_site_mode_label | upper }}?')">{{ single_site_mode_label }} mode</a> (one item shared by all sites).
                </p>
            {% endif %}


            <div style="float: left; margin-bottom: 2em; width: 100%">
                {% set temp_custom_entities = multisite_manager.getBaseEntity().custom_entities %}
                {% for custom_entity in temp_custom_entities %}
                    {% set selected_site_id = multisite_manager.getSelectedSite().id %}
                    {% set is_selected = (custom_entity.site.id == selected_site_id) %}
                    <a
                        href="{{ custom_entity.getConcreteEntity().getAdminUrl(false) }}"
                        class="btn {{ is_selected ? 'btn-black' : 'btn-grey' }} actionButton"
                    >
                        {{ custom_entity.site.name }}
                    </a>
                {% endfor %}
            </div>


        {% endif %}

    </div>
</div>
