<!--

    Copyright © 2016-2018 The Thingsboard Authors

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<section layout="row">
    <div hide-xs hide-sm hide-md ng-show="vm.displayUserInfo" class="tb-user-info" layout="row">
        <md-icon aria-label="{{ 'home.avatar' | translate }}" class="material-icons tb-mini-avatar">account_circle</md-icon>
        <div layout="column">
            <span class="tb-user-display-name">{{vm.userDisplayName()}}</span>
            <span class="tb-user-authority">{{vm.authorityName()}}</span>
        </div>
    </div>
    <md-menu md-position-mode="target-right target">
        <md-button class="md-icon-button"  aria-label="{{ 'home.open-user-menu' | translate }}" ng-click="$mdOpenMenu($event)">
            <md-icon md-menu-origin aria-label="{{ 'home.open-user-menu' | translate }}" class="material-icons">more_vert</md-icon>
        </md-button>
        <md-menu-content width="4">
            <md-menu-item>
                <md-button ng-click="vm.openProfile()">
                    <md-icon md-menu-align-target aria-label="{{ 'home.profile' | translate }}" class="material-icons">account_circle</md-icon>
                    <span translate>home.profile</span>
                </md-button>
            </md-menu-item>
            <md-menu-item>
                <md-button ng-click="vm.logout()">
                    <md-icon md-menu-align-target aria-label="{{ 'home.logout' | translate }}" class="material-icons">exit_to_app</md-icon>
                    <span translate>home.logout</span>
                </md-button>
            </md-menu-item>
        </md-menu-content>
    </md-menu>
</section>
