190 lines
5.7 KiB
HTML
190 lines
5.7 KiB
HTML
<aside class="sidebar" [class.sidebar--collapsed]="collapsed()">
|
|
<div class="brand-row">
|
|
@if (!collapsed()) {
|
|
<a
|
|
class="brand"
|
|
routerLink="/dashboard"
|
|
aria-label="Smartguide Startseite">
|
|
<span class="brand-mark">
|
|
<span></span>
|
|
<span></span>
|
|
<span></span>
|
|
<span></span>
|
|
<span></span>
|
|
<span></span>
|
|
</span>
|
|
<span class="brand-text">
|
|
<strong>AIIS</strong>
|
|
<small>AI-based<br />Innovation Scouting</small>
|
|
</span>
|
|
</a>
|
|
}
|
|
|
|
@if (canCollapse()) {
|
|
<button
|
|
mat-icon-button
|
|
class="sidebar-collapse-button"
|
|
type="button"
|
|
(click)="toggleCollapsed.emit()"
|
|
[attr.aria-label]="collapsed() ? 'Menü erweitern' : 'Menü einklappen'"
|
|
[matTooltip]="collapsed() ? 'Menü erweitern' : 'Menü einklappen'"
|
|
matTooltipPosition="right">
|
|
<mat-icon>
|
|
{{
|
|
collapsed()
|
|
? 'keyboard_double_arrow_right'
|
|
: 'keyboard_double_arrow_left'
|
|
}}
|
|
</mat-icon>
|
|
</button>
|
|
}
|
|
</div>
|
|
|
|
<mat-nav-list class="nav-list">
|
|
@for (itemGroup of navItemGroups(); track $index) {
|
|
<div>
|
|
@if (
|
|
(!itemGroup.adminOnly ||
|
|
credentialService.isEffectiveSuperAdmin() ||
|
|
credentialService.isEffectiveAdmin()) &&
|
|
(!itemGroup.superAdminOnly ||
|
|
credentialService.isEffectiveSuperAdmin()) &&
|
|
(!itemGroup.managerOrAdminOnly ||
|
|
credentialService.isEffectiveSuperAdmin() ||
|
|
credentialService.isEffectiveAdmin() ||
|
|
credentialService.isEffectiveManager())
|
|
) {
|
|
<mat-divider></mat-divider>
|
|
@if (!collapsed()) {
|
|
<div class="nav-separator">
|
|
<span>{{ itemGroup.label }}</span>
|
|
</div>
|
|
}
|
|
@for (item of itemGroup.items; track item.label) {
|
|
@if (collapsed()) {
|
|
<a
|
|
mat-icon-button
|
|
class="nav-icon-button"
|
|
[routerLink]="item.disabled ? null : item.route"
|
|
[queryParams]="item.queryParams || null"
|
|
[class.active]="isItemActive(item)"
|
|
[class.disabled]="item.disabled"
|
|
[matTooltip]="item.label"
|
|
matTooltipPosition="right"
|
|
[attr.aria-label]="item.label">
|
|
<mat-icon>{{ item.icon }}</mat-icon>
|
|
</a>
|
|
} @else {
|
|
<a
|
|
mat-list-item
|
|
[routerLink]="item.disabled ? null : item.route"
|
|
[queryParams]="item.queryParams || null"
|
|
[class.active]="isItemActive(item)"
|
|
[class.disabled]="item.disabled">
|
|
<mat-icon matListItemIcon>{{ item.icon }}</mat-icon>
|
|
<span matListItemTitle>{{ item.label }}</span>
|
|
</a>
|
|
}
|
|
}
|
|
}
|
|
</div>
|
|
}
|
|
</mat-nav-list>
|
|
|
|
<div class="sidebar-spacer"></div>
|
|
|
|
<div class="loading-indicator">
|
|
@if (isNavigating()) {
|
|
@if (collapsed()) {
|
|
<mat-spinner [diameter]="32"></mat-spinner>
|
|
} @else {
|
|
<mat-progress-bar mode="indeterminate"></mat-progress-bar>
|
|
}
|
|
}
|
|
</div>
|
|
|
|
@if (collapsed()) {
|
|
<div
|
|
class="account-icon"
|
|
[matTooltip]="
|
|
(credentialService.login() || 'user') +
|
|
' · ' +
|
|
(credentialService.organizationName() || '')
|
|
"
|
|
matTooltipPosition="right">
|
|
<div class="avatar">
|
|
{{ (credentialService.login() || 'user').charAt(0) }}
|
|
</div>
|
|
</div>
|
|
} @else {
|
|
<div [routerLink]="['/account']">
|
|
<mat-card appearance="outlined" class="account-card-content">
|
|
<mat-card-content class="account-card">
|
|
<div class="avatar">
|
|
{{ (credentialService.login() || 'user').charAt(0) }}
|
|
</div>
|
|
<div>
|
|
<strong>{{ credentialService.login() || 'Max Mustermann' }}</strong>
|
|
<strong>{{ credentialService.organizationName() }}</strong>
|
|
</div>
|
|
</mat-card-content>
|
|
</mat-card>
|
|
</div>
|
|
}
|
|
|
|
<div class="sidebar-actions">
|
|
@if (collapsed()) {
|
|
<button
|
|
aria-label="Design ändern"
|
|
mat-icon-button
|
|
type="button"
|
|
class="utility-icon-button"
|
|
ariaLabel="Design ändern"
|
|
matTooltip="Design ändern"
|
|
matTooltipPosition="right"
|
|
[matMenuTriggerFor]="styleMenu">
|
|
<mat-icon>{{ themeService.currentModeIcon() }}</mat-icon>
|
|
</button>
|
|
|
|
<button
|
|
mat-icon-button
|
|
class="utility-icon-button"
|
|
type="button"
|
|
(click)="onLogout()"
|
|
matTooltip="Abmelden"
|
|
matTooltipPosition="right"
|
|
aria-label="Abmelden">
|
|
<mat-icon>logout</mat-icon>
|
|
</button>
|
|
} @else {
|
|
<button
|
|
aria-label="Design ändern"
|
|
class="utility-link"
|
|
type="button"
|
|
ariaLabel="Design ändern"
|
|
matTooltip="Design ändern"
|
|
matTooltipPosition="right"
|
|
[matMenuTriggerFor]="styleMenu">
|
|
<mat-icon>{{ themeService.currentModeIcon() }}</mat-icon>
|
|
<span>Design: {{ themeService.currentModeLabel() }}</span>
|
|
</button>
|
|
<button class="utility-link" type="button" (click)="onLogout()">
|
|
<mat-icon>logout</mat-icon>
|
|
<span>Abmelden</span>
|
|
</button>
|
|
}
|
|
</div>
|
|
</aside>
|
|
|
|
<mat-menu #styleMenu="matMenu">
|
|
@for (menuOption of themeService.menuOptions(); track $index) {
|
|
<button
|
|
[ariaLabel]="menuOption.label"
|
|
mat-menu-item
|
|
(click)="themeService.setTheme(menuOption.mode)">
|
|
<mat-icon>{{ menuOption.icon }}</mat-icon>
|
|
<span>{{ menuOption.label }}</span>
|
|
</button>
|
|
}
|
|
</mat-menu>
|