Updated the navigation bar

pull/3895/head
Jamie Rees 6 years ago
parent 121b242159
commit 7685b6acb1

@ -79,4 +79,4 @@
"ts-node": "~5.0.1",
"tslint": "^5.12.0"
}
}
}

@ -168,7 +168,7 @@
<div [ngClass]="user.name && roleClass()">
<app-my-nav [showNav]="showNav" [username]="user.name" (logoutClick)="logOut();"></app-my-nav>
<app-my-nav [showNav]="showNav" [applicationName]="applicationName" [username]="user.name" (logoutClick)="logOut();"></app-my-nav>
</div>

@ -26,6 +26,7 @@ export class AppComponent implements OnInit {
public currentUrl: string;
public userAccessToken: string;
public voteEnabled = false;
public applicationName: string = "Ombi"
private checkedForUpdate: boolean;
@ -63,6 +64,11 @@ export class AppComponent implements OnInit {
this.settingsService.getCustomization().subscribe(x => {
this.customizationSettings = x;
if (this.customizationSettings && this.customizationSettings.applicationName) {
this.applicationName = this.customizationSettings.applicationName;
}
if (this.customizationSettings.useCustomPage) {
this.customPageService.getCustomPage().subscribe(c => {
this.customPageSettings = c;

@ -26,3 +26,9 @@ export interface IUsersModel {
id: string;
username: string;
}
export interface INavBar {
icon: string;
name: string;
link: string;
}

@ -1,21 +1,12 @@
<mat-sidenav-container *ngIf="showNav" class="sidenav-container">
<mat-sidenav #drawer class="sidenav" fixedInViewport="true" [attr.role]="(isHandset$ | async) ? 'dialog' : 'navigation'"
[mode]="(isHandset$ | async) ? 'over' : 'side'" [opened]="!(isHandset$ | async)">
<mat-toolbar>Ombi</mat-toolbar>
<mat-toolbar>{{applicationName}}</mat-toolbar>
<mat-nav-list>
<a mat-list-item routerLink="/discover" [routerLinkActive]="['active-list-item']" >
<mat-icon aria-label="Side nav toggle icon">find_replace</mat-icon>
Discover
</a>
<a mat-list-item [routerLinkActive]="['active-list-item']" routerLink="/search">
<mat-icon aria-label="Side nav toggle icon">search</mat-icon> Search
</a>
<a mat-list-item [routerLinkActive]="['active-list-item']" routerLink="/requests">
<mat-icon aria-label="Side nav toggle icon">list</mat-icon> Requests
</a>
<a mat-list-item [routerLinkActive]="['active-list-item']" routerLink="/Settings/About">
<mat-icon aria-label="Side nav toggle icon">settings</mat-icon> Settings
</a>
<a *ngFor="let nav of navItems" mat-list-item [routerLink]="nav.link" [routerLinkActive]="['active-list-item']" >
<mat-icon aria-label="Side nav toggle icon">{{nav.icon}}</mat-icon>
{{nav.name | translate}}
</a>
<a mat-list-item [routerLinkActive]="['active-list-item']" aria-label="Toggle sidenav" (click)="logOut();">
<mat-icon aria-label="Side nav toggle icon">exit_to_app</mat-icon>

@ -2,6 +2,7 @@ import { Component, Input, Output, EventEmitter } from '@angular/core';
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { INavBar } from '../interfaces/ICommon';
@Component({
selector: 'app-my-nav',
@ -16,12 +17,20 @@ export class MyNavComponent {
);
@Input() public showNav: boolean;
@Input() public applicationName: string;
@Input() public username: string;
@Output() public logoutClick = new EventEmitter();
constructor(private breakpointObserver: BreakpointObserver) {
}
public navItems: INavBar[] = [
{name: "NavigationBar.Discover", icon: "find_replace", link: "/discover"},
{name: "NavigationBar.Search", icon: "search", link: "/search"},
{name: "NavigationBar.Requests", icon: "list", link: "/requests"},
{name: "NavigationBar.Settings", icon: "settings", link: "/Settings/About"},
]
public logOut() {
this.logoutClick.emit();
}

@ -47,6 +47,7 @@
"CheckPageForUpdates": "Check this page for continuous site updates."
},
"NavigationBar": {
"Discover":"Discover",
"Search": "Search",
"Requests": "Requests",
"UserManagement": "User Management",

Loading…
Cancel
Save