<html xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers" data-namespace-typo3-fluid="true">

<p class="dropdown-headline"><f:translate key="LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:toolbarItems.workspace" /></p>
<p class="dropdown-item-text">
    <f:translate key="LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:toolbarItems.workspace.intro.text" />
    <f:if condition="{showLinkToModule}">
        <f:translate key="LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:toolbarItems.workspace.intro.link.description" />
        <a href="#" data-moduleroute-identifier="workspaces_admin">
            <f:translate key="LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:toolbarItems.workspace.intro.link" />
        </a>
    </f:if>
</p>

<f:if condition="{topItem} || {additionalItems}">
    <f:then>
        <ul class="dropdown-list">
            <f:if condition="{topItem}">
                <f:render section="workspaceItem" arguments="{item: topItem}" />
            </f:if>
            <f:if condition="{additionalItems}">
                <f:for each="{additionalItems}" as="item">
                    <f:render section="workspaceItem" arguments="{item: item}" />
                </f:for>
            </f:if>
        </ul>
    </f:then>
    <f:else>
        <f:comment><!-- No workspace to work in --></f:comment>
        <hr class="dropdown-divider" aria-hidden="true">
        <div class="dropdown-row">
            <div>
                <span class="text-danger">
                    <core:icon identifier="actions-exclamation-circle-alt" />
                </span>
            </div>
            <div>
                <f:translate key="LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:toolbarItems.workspace.noWorkspaceFound" />
            </div>
        </div>
    </f:else>
</f:if>

<f:section name="workspaceItem">
    <li class="t3js-workspace-item">
        <a href="{item.link}" data-workspaceid="{item.workspaceId}" class="dropdown-item t3js-workspaces-switchlink {item.isActive ? 'active' : ''}">
            <span class="dropdown-item-columns">
                <span class="dropdown-item-column dropdown-item-column-icon">
                    <core:icon identifier="mimetypes-x-sys_workspace" size="small" />
                </span>
                <span class="dropdown-item-column dropdown-item-column-title">
                    {item.label -> f:format.htmlspecialchars()}
                </span>
            </span>
        </a>
    </li>
</f:section>

</html>
