{#
  OTS Signage Theme override
  Based on Xibo CMS default authed-user-menu.twig (master branch)
  Minimal change: add ots-user-menu class for easy verification
#}
{% if compact is defined and compact %}
<div class="dropdown nav-item item ots-user-menu-compact">
    <a href="#" class="nav-link" data-toggle="dropdown" id="navbarUserMenu">
        <img class="nav-avatar" src="{{ theme.uri("img/avatar.jpg") }}" />
    </a>
    <div class="dropdown-menu dropdown-menu-right ots-user-menu" aria-labelledby="navbarUserMenu">
{% else %}
<li class="dropdown nav-item item">
    <a href="#" class="nav-link" data-toggle="dropdown" id="navbarUserMenu">
        <img class="nav-avatar" src="{{ theme.uri("img/avatar.jpg") }}" />
    </a>
    <div class="dropdown-menu dropdown-menu-right ots-user-menu" aria-labelledby="navbarUserMenu">
{% endif %}
        <h6 class="dropdown-header">{{ currentUser.userName }}<br/>
            <div id="XiboClock">{{ clock }}</div>
        </h6>
        <div class="dropdown-divider"></div>
        <a class="dropdown-item XiboFormButton" href="{{ url_for("user.preferences.form") }}" title="{% trans "Preferences" %}">{% trans "Preferences" %}</a>

        {% if currentUser.featureEnabled("user.profile") %}
            <a class="dropdown-item XiboFormButton" href="{{ url_for("user.edit.profile.form") }}" title="{% trans "Edit Profile" %}">{% trans "Edit Profile" %}</a>
        {% endif %}

        <a class="dropdown-item XiboFormButton" href="{{ url_for("user.applications") }}" title="{% trans "View my authenticated applications" %}">{% trans "My Applications" %}</a>

        <div class="dropdown-divider"></div>
        <a class="dropdown-item" id="ots-theme-toggle" href="#" title="Toggle light/dark mode">
            <i class="fa fa-moon-o" id="ots-theme-icon" aria-hidden="true"></i>
            <span id="ots-theme-label">Dark Mode</span>
        </a>

        <a class="dropdown-item" href="https://portal.oribi-tech.com" target="_blank" rel="noopener noreferrer" title="{% trans "Client Portal" %}">{% trans "Client Portal" %}</a>

        <a class="dropdown-item XiboFormButton" href="{{ url_for("about") }}" title="{% trans "About the CMS" %}">{% trans "About" %}</a>

        {% if not hideLogout %}
            <div class="dropdown-divider"></div>
            <a class="dropdown-item" title="{% trans "Logout" %}" href="{{ logoutUrl }}">{% trans "Logout" %}</a>
        {% endif %}
    </div>
{% if compact is defined and compact %}
    </div>
{% else %}
    </div>
</li>
{% endif %}
