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

103 lines
4.4 KiB
HTML
Raw Normal View History

<div class="history-mode-indicator" *ngIf="OSStatus.isInHistoryMode">
<span translate>You are using the history mode of OpenSlides. Changes will not be saved.</span>
<a (click)="timeTravel.resumeTime()" translate>Exit</a>
</div>
2018-11-07 08:43:48 +01:00
<mat-sidenav-container #siteContainer class="main-container" (backdropClick)="toggleSideNav()">
<mat-sidenav
#sideNav
[mode]="vp.isMobile ? 'push' : 'side'"
[opened]="!vp.isMobile"
disableClose="!vp.isMobile"
class="side-panel"
>
<mat-toolbar class="nav-toolbar">
<!-- logo -->
2018-11-07 08:43:48 +01:00
<mat-toolbar-row class="os-logo-container" routerLink="/" (click)="toggleSideNav()"></mat-toolbar-row>
</mat-toolbar>
2018-06-25 17:03:52 +02:00
<!-- User Menu -->
2018-11-07 08:43:48 +01:00
<mat-expansion-panel class="user-menu mat-elevation-z0">
<mat-expansion-panel-header>
<!-- Get the username from operator -->
2018-11-07 08:43:48 +01:00
{{ username }}
</mat-expansion-panel-header>
2018-08-03 11:05:21 +02:00
<mat-nav-list>
<a mat-list-item [matMenuTriggerFor]="languageMenu">
<mat-icon>language</mat-icon>
2018-11-07 08:43:48 +01:00
<span> {{ getLangName(this.translate.currentLang) }} </span>
</a>
2018-11-07 08:43:48 +01:00
<a *ngIf="isLoggedIn" (click)="editProfile()" mat-list-item>
<mat-icon>person</mat-icon>
<span translate>Edit profile</span>
2018-08-03 11:05:21 +02:00
</a>
2018-11-07 08:43:48 +01:00
<a *ngIf="isLoggedIn" (click)="changePassword()" mat-list-item>
<mat-icon>vpn_key</mat-icon>
<span translate>Change password</span>
2018-08-03 11:05:21 +02:00
</a>
<mat-divider></mat-divider>
2018-11-07 08:43:48 +01:00
<a *ngIf="isLoggedIn" (click)="logout()" mat-list-item>
<mat-icon>exit_to_app</mat-icon>
2018-08-03 11:05:21 +02:00
<span translate>Logout</span>
</a>
2018-11-07 08:43:48 +01:00
<a *ngIf="!isLoggedIn" routerLink="/login" mat-list-item>
<mat-icon>exit_to_app</mat-icon>
<span translate>Login</span>
</a>
2018-08-03 11:05:21 +02:00
</mat-nav-list>
</mat-expansion-panel>
2018-11-07 08:43:48 +01:00
<!-- TODO: Could use translate.getLangs() to fetch available languages -->
<mat-menu #languageMenu="matMenu">
2018-11-07 08:43:48 +01:00
<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('cs')" translate>Czech</button>
</mat-menu>
2018-06-25 17:03:52 +02:00
<!-- navigation -->
2018-11-07 08:43:48 +01:00
<mat-nav-list class="main-nav">
<form [formGroup]="searchform" (submit)="search()" *ngIf="showSearch">
<mat-form-field>
<input matInput formControlName="query" placeholder="{{ 'Search' | translate }}" />
<button mat-icon-button matSuffix><mat-icon>search</mat-icon></button>
</mat-form-field>
</form>
<span *ngFor="let entry of mainMenuService.entries">
2018-11-07 08:43:48 +01:00
<a
[@navItemAnim]
*osPerms="entry.permission"
mat-list-item
(click)="toggleSideNav()"
[routerLink]="entry.route"
routerLinkActive="active"
[routerLinkActiveOptions]="{ exact: entry.route === '/' }"
>
<mat-icon>{{ entry.icon }}</mat-icon>
2018-11-07 08:43:48 +01:00
<span>{{ entry.displayName | translate }}</span>
</a>
</span>
<mat-divider></mat-divider>
2018-11-07 08:43:48 +01:00
<a
[@navItemAnim]
*osPerms="'core.can_see_projector'"
mat-list-item
routerLink="/projector"
routerLinkActive="active"
(click)="toggleSideNav()"
>
<mat-icon>videocam</mat-icon>
<span translate>Projector</span>
</a>
</mat-nav-list>
</mat-sidenav>
<mat-sidenav-content>
<div (touchstart)="swipe($event, 'start')" (touchend)="swipe($event, 'end')" class="content">
<div class="relax">
<main [@pageTransition]="o.isActivated ? o.activatedRoute : ''">
<router-outlet #o="outlet"></router-outlet>
</main>
2018-11-07 08:43:48 +01:00
<footer><os-footer></os-footer></footer>
</div>
</div>
</mat-sidenav-content>
</mat-sidenav-container>