OpenSlides/client/src/app/site/site.component.html

91 lines
4.0 KiB
HTML
Raw Normal View History

<mat-sidenav-container autosize class='main-container'>
<mat-sidenav #sideNav [mode]="vp.isMobile ? 'push' : 'side'" [opened]='!vp.isMobile' disableClose='!vp.isMobile' class="side-panel">
<mat-toolbar class='nav-toolbar'>
<!-- logo -->
<mat-toolbar-row class='os-logo-container'>
</mat-toolbar-row>
</mat-toolbar>
2018-06-25 17:03:52 +02:00
<!-- User Menu -->
<mat-expansion-panel class='user-menu mat-elevation-z0'>
<mat-expansion-panel-header>
<!-- Get the username from operator -->
{{username}}
</mat-expansion-panel-header>
2018-08-03 11:05:21 +02:00
<mat-nav-list>
<a mat-list-item [matMenuTriggerFor]="languageMenu">
<fa-icon icon='globe-americas'></fa-icon>
<span> {{getLangName(this.translate.currentLang)}} </span>
</a>
<a *ngIf="isLoggedIn" (click)='editProfile()' mat-list-item>
2018-08-03 11:05:21 +02:00
<fa-icon icon='user-cog'></fa-icon>
<span translate>Edit Profile</span>
</a>
<a *ngIf="isLoggedIn" (click)='changePassword()' mat-list-item>
2018-08-03 11:05:21 +02:00
<fa-icon icon='key'></fa-icon>
<span translate>Change Password</span>
</a>
<mat-divider></mat-divider>
<a *ngIf="isLoggedIn" (click)='logout()' mat-list-item>
2018-08-03 11:05:21 +02:00
<fa-icon icon='sign-out-alt'></fa-icon>
<span translate>Logout</span>
</a>
<a *ngIf="!isLoggedIn" routerLink='/login' mat-list-item>
<fa-icon icon='sign-out-alt'></fa-icon>
<span translate>Login</span>
</a>
2018-08-03 11:05:21 +02:00
</mat-nav-list>
</mat-expansion-panel>
<!-- TODO: Could use translate.getLangs() to fetch available languages-->
<mat-menu #languageMenu="matMenu">
<button mat-menu-item (click)='selectLang("en")' translate>English</button>
<button mat-menu-item (click)='selectLang("de")' translate>German</button>
<button mat-menu-item (click)='selectLang("fr")' translate>French</button>
</mat-menu>
2018-06-25 17:03:52 +02:00
<!-- navigation -->
<mat-nav-list class='main-nav'>
<span *ngFor="let entry of mainMenuService.entries">
<a [@navItemAnim] *osPerms="entry.permission" mat-list-item (click)='toggleSideNav()'
[routerLink]='entry.route' routerLinkActive='active' [routerLinkActiveOptions]="{exact: true}">
<fa-icon [icon]='entry.icon'></fa-icon>
{{ entry.displayName | translate}}
</a>
</span>
<mat-divider></mat-divider>
<a [@navItemAnim] *osPerms="'core.can_see_projector'" mat-list-item routerLink='/projector' routerLinkActive='active' (click)='toggleSideNav()'>
<fa-icon icon='video'></fa-icon>
<span translate>Projector</span>
</a>
</mat-nav-list>
</mat-sidenav>
<div class="content">
<header>
<!-- the first toolbar row is (still) a global element
the second one shall be handled by the apps -->
<mat-toolbar color='primary'>
2018-06-25 17:03:52 +02:00
<!-- show/hide menu button -->
<button mat-icon-button *ngIf="vp.isMobile" (click)='sideNav.toggle()'>
<fa-icon icon='bars'></fa-icon>
</button>
2018-06-25 17:03:52 +02:00
<!-- glob search and generic menu on the right -->
<span class='spacer'></span>
<button mat-icon-button (click)='sideNav.toggle()'>
<fa-icon icon='search'></fa-icon>
</button>
</mat-toolbar>
</header>
<div class="relax">
<main [@pageTransition]="o.isActivated ? o.activatedRoute : ''">
<router-outlet #o="outlet"></router-outlet>
</main>
<footer>
<os-footer></os-footer>
</footer>
</div>
</div>
</mat-sidenav-container>