From 9c2eb7369fcf257d2e9d10cbb1bb370c6487134f Mon Sep 17 00:00:00 2001 From: Jamie Rees Date: Tue, 26 Mar 2019 14:14:03 +0000 Subject: [PATCH] more stuff --- src/Ombi/ClientApp/src/app/app.module.ts | 2 +- .../src/app/discover/discover.component.html | 13 ++++++---- .../components/tv/tv-details.component.html | 2 +- .../src/app/my-nav/my-nav.component.html | 5 ++-- .../src/app/my-nav/my-nav.component.scss | 6 +++++ .../src/app/my-nav/my-nav.component.ts | 24 ++++++++++++------- .../app/shared/functions/common-functions.ts | 16 ++++++++++++- src/Ombi/ClientApp/src/styles/buttons.scss | 5 ---- src/Ombi/ClientApp/src/styles/variables.scss | 4 ++-- 9 files changed, 53 insertions(+), 24 deletions(-) diff --git a/src/Ombi/ClientApp/src/app/app.module.ts b/src/Ombi/ClientApp/src/app/app.module.ts index c837431d9..c13f00de7 100644 --- a/src/Ombi/ClientApp/src/app/app.module.ts +++ b/src/Ombi/ClientApp/src/app/app.module.ts @@ -70,7 +70,7 @@ const routes: Routes = [ { loadChildren: "./wizard/wizard.module#WizardModule", path: "Wizard" }, { loadChildren: "./usermanagement/usermanagement.module#UserManagementModule", path: "usermanagement" }, { loadChildren: "./requests/requests.module#RequestsModule", path: "requestsOld" }, - { loadChildren: "./requests-list/requests-list.module#RequestsListModule", path: "requests" }, + { loadChildren: "./requests-list/requests-list.module#RequestsListModule", path: "requests-list" }, { loadChildren: "./search/search.module#SearchModule", path: "search" }, { loadChildren: "./recentlyAdded/recentlyAdded.module#RecentlyAddedModule", path: "recentlyadded" }, { loadChildren: "./vote/vote.module#VoteModule", path: "vote" }, diff --git a/src/Ombi/ClientApp/src/app/discover/discover.component.html b/src/Ombi/ClientApp/src/app/discover/discover.component.html index e7500d811..4499bdce5 100644 --- a/src/Ombi/ClientApp/src/app/discover/discover.component.html +++ b/src/Ombi/ClientApp/src/app/discover/discover.component.html @@ -2,11 +2,16 @@
- - + -
diff --git a/src/Ombi/ClientApp/src/app/media-details/components/tv/tv-details.component.html b/src/Ombi/ClientApp/src/app/media-details/components/tv/tv-details.component.html index 1a860fe65..be653411a 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/tv/tv-details.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/tv/tv-details.component.html @@ -70,7 +70,7 @@ -
+
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 75decb3de..56b363725 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 @@ -3,12 +3,13 @@ [mode]="(isHandset$ | async) ? 'over' : 'side'" [opened]="!(isHandset$ | async)"> {{applicationName}} - + {{nav.icon}} {{nav.name | translate}} - + exit_to_app {{ 'NavigationBar.Logout' | translate }} diff --git a/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.scss b/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.scss index 763acbfdb..af226e40a 100644 --- a/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.scss +++ b/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.scss @@ -44,6 +44,12 @@ .active-list-item { background: $accent !important; + color:white; +} + +.active-list-item-dark { + background: $accent-dark !important; + color:black; } .bottom-nav-link { 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 61db70589..d33b11843 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 @@ -1,4 +1,4 @@ -import { Component, Input, Output, EventEmitter, HostBinding } from '@angular/core'; +import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core'; import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; @@ -9,7 +9,7 @@ import { INavBar } from '../interfaces/ICommon'; templateUrl: './my-nav.component.html', styleUrls: ['./my-nav.component.scss'], }) -export class MyNavComponent { +export class MyNavComponent implements OnInit { isHandset$: Observable = this.breakpointObserver.observe(Breakpoints.Handset) .pipe( @@ -21,14 +21,18 @@ export class MyNavComponent { @Input() public username: string; @Output() public logoutClick = new EventEmitter(); @Output() public themeChange = new EventEmitter(); - + public theme: string; constructor(private breakpointObserver: BreakpointObserver) { } + public ngOnInit(): void { + this.theme = localStorage.getItem("theme"); + } + public navItems: INavBar[] = [ { name: "NavigationBar.Discover", icon: "find_replace", link: "/discover" }, - { name: "NavigationBar.Requests", icon: "list", link: "/requests" }, + { name: "NavigationBar.Requests", icon: "list", link: "/requests-list" }, { name: "NavigationBar.UserManagement", icon: "account_circle", link: "/usermanagement" }, { name: "NavigationBar.Settings", icon: "settings", link: "/Settings/About" }, ] @@ -38,19 +42,23 @@ export class MyNavComponent { } public switchTheme() { - const theme = localStorage.getItem("theme"); - - if (theme) { + if (this.theme) { localStorage.removeItem("theme"); let newTheme = ""; - if (theme === "dark") { + if (this.theme === "dark") { newTheme = "light"; } else { newTheme = "dark"; } localStorage.setItem("theme", newTheme) + this.theme = newTheme; this.themeChange.emit(newTheme); } } + public getTheme(){ + debugger; + return this.theme === 'dark' ? 'active-list-item-dark' : 'active-list-item'; + } + } diff --git a/src/Ombi/ClientApp/src/app/shared/functions/common-functions.ts b/src/Ombi/ClientApp/src/app/shared/functions/common-functions.ts index f7b722e67..3d3b094ed 100644 --- a/src/Ombi/ClientApp/src/app/shared/functions/common-functions.ts +++ b/src/Ombi/ClientApp/src/app/shared/functions/common-functions.ts @@ -2,5 +2,19 @@ export function getBaseLocation() { debugger; let paths: string[] = location.pathname.split('/').splice(1, 1); let basePath: string = (paths && paths[0] ? paths[0] : ""); + if(invalidProxies.indexOf(basePath) === -1){ + return '/'; + } return '/' + basePath; -} \ No newline at end of file +} + +const invalidProxies: string[] = [ + 'discover', + 'requests-list', + 'Settings', + 'issues', + 'usermanagement', + 'recentlyadded', + 'details', + 'vote' +] \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/styles/buttons.scss b/src/Ombi/ClientApp/src/styles/buttons.scss index 6343ce35b..048ad1cd0 100644 --- a/src/Ombi/ClientApp/src/styles/buttons.scss +++ b/src/Ombi/ClientApp/src/styles/buttons.scss @@ -13,8 +13,3 @@ .btn-orange { background-color: #F57C00; } - -.active-button { - background-color: #5dffbd !important; - color: white; -} \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/styles/variables.scss b/src/Ombi/ClientApp/src/styles/variables.scss index 8388ee4e7..5df0cebe5 100644 --- a/src/Ombi/ClientApp/src/styles/variables.scss +++ b/src/Ombi/ClientApp/src/styles/variables.scss @@ -4,8 +4,8 @@ // Define the palettes for your theme using the Material Design palettes available in palette.scss // (imported above). For each palette, you can optionally specify a default, lighter, and darker // hue. Available color palettes: https://material.io/design/color/ -$ombi-app-primary: mat-palette($ombi-primary, 500); -$ombi-app-accent : mat-palette($ombi-accent, A200, A100, A400); +$ombi-app-primary: mat-palette($ombi-primary); +$ombi-app-accent : mat-palette($ombi-accent, 400); // The warn palette is optional (defaults to red). $ombi-app-warn : mat-palette($mat-deep-orange);