From 7685b6acb1f8f6c02e26307ea3a9f6afe31a1a6d Mon Sep 17 00:00:00 2001 From: Jamie Rees Date: Thu, 7 Mar 2019 09:42:03 +0000 Subject: [PATCH] Updated the navigation bar --- src/Ombi/ClientApp/package.json | 2 +- src/Ombi/ClientApp/src/app/app.component.html | 2 +- src/Ombi/ClientApp/src/app/app.component.ts | 6 ++++++ .../ClientApp/src/app/interfaces/ICommon.ts | 6 ++++++ .../src/app/my-nav/my-nav.component.html | 19 +++++-------------- .../src/app/my-nav/my-nav.component.ts | 9 +++++++++ src/Ombi/wwwroot/translations/en.json | 1 + 7 files changed, 29 insertions(+), 16 deletions(-) diff --git a/src/Ombi/ClientApp/package.json b/src/Ombi/ClientApp/package.json index 8b5847148..a59b7779c 100644 --- a/src/Ombi/ClientApp/package.json +++ b/src/Ombi/ClientApp/package.json @@ -79,4 +79,4 @@ "ts-node": "~5.0.1", "tslint": "^5.12.0" } -} \ No newline at end of file +} diff --git a/src/Ombi/ClientApp/src/app/app.component.html b/src/Ombi/ClientApp/src/app/app.component.html index 64a2beffe..f265c4320 100644 --- a/src/Ombi/ClientApp/src/app/app.component.html +++ b/src/Ombi/ClientApp/src/app/app.component.html @@ -168,7 +168,7 @@
- +
\ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/app.component.ts b/src/Ombi/ClientApp/src/app/app.component.ts index 49db73a2c..55d8d81bb 100644 --- a/src/Ombi/ClientApp/src/app/app.component.ts +++ b/src/Ombi/ClientApp/src/app/app.component.ts @@ -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; diff --git a/src/Ombi/ClientApp/src/app/interfaces/ICommon.ts b/src/Ombi/ClientApp/src/app/interfaces/ICommon.ts index c2e1e7e1d..a117565fd 100644 --- a/src/Ombi/ClientApp/src/app/interfaces/ICommon.ts +++ b/src/Ombi/ClientApp/src/app/interfaces/ICommon.ts @@ -26,3 +26,9 @@ export interface IUsersModel { id: string; username: string; } + +export interface INavBar { + icon: string; + name: string; + link: string; +} \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.html b/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.html index 04cf472bb..e1bca5542 100644 --- a/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.html +++ b/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.html @@ -1,21 +1,12 @@ - Ombi + {{applicationName}} - - find_replace - Discover - - - search Search - - - list Requests - - - settings Settings - + + {{nav.icon}} + {{nav.name | translate}} + exit_to_app diff --git a/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.ts b/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.ts index 17454bb9f..da7aabab6 100644 --- a/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.ts +++ b/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.ts @@ -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(); } diff --git a/src/Ombi/wwwroot/translations/en.json b/src/Ombi/wwwroot/translations/en.json index 2f9c065c7..6cc391d25 100644 --- a/src/Ombi/wwwroot/translations/en.json +++ b/src/Ombi/wwwroot/translations/en.json @@ -47,6 +47,7 @@ "CheckPageForUpdates": "Check this page for continuous site updates." }, "NavigationBar": { + "Discover":"Discover", "Search": "Search", "Requests": "Requests", "UserManagement": "User Management",