diff --git a/src/Ombi/ClientApp/src/app/app.component.ts b/src/Ombi/ClientApp/src/app/app.component.ts
index 971fce50b..934a6151e 100644
--- a/src/Ombi/ClientApp/src/app/app.component.ts
+++ b/src/Ombi/ClientApp/src/app/app.component.ts
@@ -10,7 +10,7 @@ import { JobService, SettingsService } from "./services";
import { ICustomizationSettings, ICustomPage } from "./interfaces";
@Component({
- selector: "ombi",
+ selector: "app-ombi",
templateUrl: "./app.component.html",
styleUrls: ["./app.component.scss"],
})
diff --git a/src/Ombi/ClientApp/src/app/app.module.ts b/src/Ombi/ClientApp/src/app/app.module.ts
index 6917cc85b..4620a8017 100644
--- a/src/Ombi/ClientApp/src/app/app.module.ts
+++ b/src/Ombi/ClientApp/src/app/app.module.ts
@@ -3,7 +3,6 @@ import { HttpClient, HttpClientModule } from "@angular/common/http";
import { NgModule } from "@angular/core";
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
import { HttpModule } from "@angular/http";
-import { MatButtonModule, MatCardModule, MatInputModule, MatTabsModule } from "@angular/material";
import { BrowserModule } from "@angular/platform-browser";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { RouterModule, Routes } from "@angular/router";
@@ -19,6 +18,12 @@ import { GrowlModule } from "primeng/components/growl/growl";
import { ButtonModule, CaptchaModule, ConfirmationService, ConfirmDialogModule, DataTableModule, DialogModule, OverlayPanelModule, SharedModule, SidebarModule,
TooltipModule } from "primeng/primeng";
+ import {
+ MatButtonModule, MatNativeDateModule, MatIconModule, MatSidenavModule, MatListModule, MatToolbarModule} from '@angular/material';
+ import { MatCardModule, MatInputModule, MatTabsModule } from "@angular/material";
+
+import { MDBBootstrapModule, CardsFreeModule, NavbarModule } from "angular-bootstrap-md";
+
// Components
import { AppComponent } from "./app.component";
@@ -34,16 +39,16 @@ import { TokenResetPasswordComponent } from "./login/tokenresetpassword.componen
// Services
import { AuthGuard } from "./auth/auth.guard";
import { AuthService } from "./auth/auth.service";
-import { IdentityService } from "./services";
import { ImageService } from "./services";
import { LandingPageService } from "./services";
import { NotificationService } from "./services";
import { SettingsService } from "./services";
-import { IssuesService, JobService, PlexTvService, StatusService } from "./services";
+import { IssuesService, JobService, PlexTvService, StatusService, SearchService, IdentityService } from "./services";
+import { NavComponent } from "./nav/nav.component";
const routes: Routes = [
{ path: "*", component: PageNotFoundComponent },
- { path: "", redirectTo: "/search", pathMatch: "full" },
+ { path: "", redirectTo: "/home", pathMatch: "full" },
{ path: "login", component: LoginComponent },
{ path: "Login/OAuth/:pin", component: LoginOAuthComponent },
{ path: "Custom", component: CustomPageComponent },
@@ -52,6 +57,7 @@ const routes: Routes = [
{ path: "token", component: TokenResetPasswordComponent },
{ path: "landingpage", component: LandingPageComponent },
{ path: "auth/cookie", component: CookieComponent },
+ { loadChildren: "./home/home.module#HomeModule", path: "home" },
{ loadChildren: "./issues/issues.module#IssuesModule", path: "issues" },
{ loadChildren: "./settings/settings.module#SettingsModule", path: "Settings" },
{ loadChildren: "./wizard/wizard.module#WizardModule", path: "Wizard" },
@@ -95,6 +101,7 @@ export function JwtTokenGetter() {
NgxEditorModule,
DialogModule,
MatButtonModule,
+ NavbarModule,
NgbModule.forRoot(),
MatCardModule,
MatInputModule,
@@ -105,6 +112,8 @@ export function JwtTokenGetter() {
ConfirmDialogModule,
OverlayPanelModule,
CommonModule,
+ CardsFreeModule,
+ MDBBootstrapModule.forRoot(),
JwtModule.forRoot({
config: {
tokenGetter: JwtTokenGetter,
@@ -118,6 +127,7 @@ export function JwtTokenGetter() {
},
}),
SidebarModule,
+ MatNativeDateModule, MatIconModule, MatSidenavModule, MatListModule, MatToolbarModule,
],
declarations: [
AppComponent,
@@ -129,6 +139,7 @@ export function JwtTokenGetter() {
CustomPageComponent,
CookieComponent,
LoginOAuthComponent,
+ NavComponent,
],
providers: [
NotificationService,
@@ -144,6 +155,7 @@ export function JwtTokenGetter() {
JobService,
IssuesService,
PlexTvService,
+ SearchService,
],
bootstrap: [AppComponent],
})
diff --git a/src/Ombi/ClientApp/src/app/home/home.component.html b/src/Ombi/ClientApp/src/app/home/home.component.html
new file mode 100644
index 000000000..c055c8cb5
--- /dev/null
+++ b/src/Ombi/ClientApp/src/app/home/home.component.html
@@ -0,0 +1,6 @@
+
Movies
+
+
+
TV Shows
+
+
\ No newline at end of file
diff --git a/src/Ombi/ClientApp/src/app/home/home.component.ts b/src/Ombi/ClientApp/src/app/home/home.component.ts
new file mode 100644
index 000000000..0e9dee3f7
--- /dev/null
+++ b/src/Ombi/ClientApp/src/app/home/home.component.ts
@@ -0,0 +1,23 @@
+import { Component, OnInit } from "@angular/core";
+import { SearchService } from "../services";
+import { ISearchMovieResult, ISearchTvResult } from "../interfaces";
+
+@Component({
+ templateUrl: "./home.component.html",
+})
+export class HomeComponent implements OnInit {
+
+ public movies: ISearchMovieResult[];
+ public tvShows: ISearchTvResult[];
+
+ public defaultTvPoster: string;
+
+ constructor(private searchService: SearchService) {
+
+ }
+ public ngOnInit() {
+ this.defaultTvPoster = "../../../images/default_tv_poster.png";
+ this.searchService.popularMovies().subscribe(x => this.movies = x);
+ this.searchService.popularTv().subscribe(x => this.tvShows = x);
+ }
+}
diff --git a/src/Ombi/ClientApp/src/app/home/home.module.ts b/src/Ombi/ClientApp/src/app/home/home.module.ts
new file mode 100644
index 000000000..cd66988cb
--- /dev/null
+++ b/src/Ombi/ClientApp/src/app/home/home.module.ts
@@ -0,0 +1,34 @@
+import { NgModule } from "@angular/core";
+import { RouterModule, Routes } from "@angular/router";
+
+import { SearchService } from "../services";
+
+import { AuthGuard } from "../auth/auth.guard";
+
+import { SharedModule } from "../shared/shared.module";
+import { HomeComponent } from "./home.component";
+import { PopularMoviesComponent } from "./movies/popular-movies.component";
+import { PopularTvComponent } from "./tv/popular-tv.component";
+
+const routes: Routes = [
+ { path: "", component: HomeComponent, canActivate: [AuthGuard] },
+];
+@NgModule({
+ imports: [
+ RouterModule.forChild(routes),
+ SharedModule,
+ ],
+ declarations: [
+ HomeComponent,
+ PopularMoviesComponent,
+ PopularTvComponent,
+ ],
+ exports: [
+ RouterModule,
+ ],
+ providers: [
+ SearchService
+ ],
+
+})
+export class HomeModule { }
diff --git a/src/Ombi/ClientApp/src/app/home/movies/popular-movies.component.html b/src/Ombi/ClientApp/src/app/home/movies/popular-movies.component.html
new file mode 100644
index 000000000..2e98006cd
--- /dev/null
+++ b/src/Ombi/ClientApp/src/app/home/movies/popular-movies.component.html
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+ {{movie.title}}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Ombi/ClientApp/src/app/home/movies/popular-movies.component.ts b/src/Ombi/ClientApp/src/app/home/movies/popular-movies.component.ts
new file mode 100644
index 000000000..0c31a4acc
--- /dev/null
+++ b/src/Ombi/ClientApp/src/app/home/movies/popular-movies.component.ts
@@ -0,0 +1,19 @@
+import { Component, OnInit } from "@angular/core";
+import { SearchService } from "../../services";
+import { ISearchMovieResult, ISearchTvResult } from "../../interfaces";
+
+@Component({
+ selector:"popular-movies",
+ templateUrl: "./popular-movies.component.html",
+})
+export class PopularMoviesComponent implements OnInit {
+
+ public movies: ISearchMovieResult[];
+
+ constructor(private searchService: SearchService) {
+
+ }
+ public ngOnInit() {
+ this.searchService.popularMovies().subscribe(x => this.movies = x);
+ }
+}
diff --git a/src/Ombi/ClientApp/src/app/home/tv/popular-tv.component.html b/src/Ombi/ClientApp/src/app/home/tv/popular-tv.component.html
new file mode 100644
index 000000000..99eadbd90
--- /dev/null
+++ b/src/Ombi/ClientApp/src/app/home/tv/popular-tv.component.html
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+ {{tv.title}}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Ombi/ClientApp/src/app/home/tv/popular-tv.component.ts b/src/Ombi/ClientApp/src/app/home/tv/popular-tv.component.ts
new file mode 100644
index 000000000..dadda24a9
--- /dev/null
+++ b/src/Ombi/ClientApp/src/app/home/tv/popular-tv.component.ts
@@ -0,0 +1,66 @@
+import { Component, OnInit } from "@angular/core";
+import { SearchService } from "../../services";
+import { ISearchTvResult } from "../../interfaces";
+
+@Component({
+ selector: "popular-tv",
+ templateUrl: "./popular-tv.component.html",
+})
+export class PopularTvComponent implements OnInit {
+
+ public tvShows: ISearchTvResult[];
+
+ public defaultPoster: string;
+
+ constructor(private searchService: SearchService) {
+
+ }
+
+ public ngOnInit() {
+ this.defaultPoster = "../../../images/default_tv_poster.png";
+ this.searchService.popularTv().subscribe(x => {this.tvShows = x; this.getExtraInfo();});
+ }
+
+ public getExtraInfo() {
+ this.tvShows.forEach((val, index) => {
+ this.searchService.getShowInformation(val.id)
+ .subscribe(x => {
+ if (x) {
+ this.setDefaults(x);
+ this.updateItem(val, x);
+ } else {
+ const index = this.tvShows.indexOf(val, 0);
+ if (index > -1) {
+ this.tvShows.splice(index, 1);
+ }
+ }
+ });
+ });
+ }
+
+ private setDefaults(x: ISearchTvResult) {
+ if (x.banner === null) {
+ x.banner = this.defaultPoster;
+ }
+
+ if (x.imdbId === null) {
+ x.imdbId = "https://www.tvmaze.com/shows/" + x.seriesId;
+ } else {
+ x.imdbId = "http://www.imdb.com/title/" + x.imdbId + "/";
+ }
+ }
+
+ private updateItem(key: ISearchTvResult, updated: ISearchTvResult) {
+ const index = this.tvShows.indexOf(key, 0);
+ if (index > -1) {
+ // Update certain properties, otherwise we will loose some data
+ this.tvShows[index].title = updated.title;
+ this.tvShows[index].banner = updated.banner;
+ this.tvShows[index].imdbId = updated.imdbId;
+ this.tvShows[index].seasonRequests = updated.seasonRequests;
+ this.tvShows[index].seriesId = updated.seriesId;
+ this.tvShows[index].fullyAvailable = updated.fullyAvailable;
+ this.tvShows[index].background = updated.banner;
+ }
+ }
+}
diff --git a/src/Ombi/ClientApp/src/app/nav/nav.component.html b/src/Ombi/ClientApp/src/app/nav/nav.component.html
new file mode 100644
index 000000000..b39a3e2bc
--- /dev/null
+++ b/src/Ombi/ClientApp/src/app/nav/nav.component.html
@@ -0,0 +1,22 @@
+
+
+ Ombi
+
+ Home
+ Search
+ Settings
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Ombi/ClientApp/src/app/nav/nav.component.scss b/src/Ombi/ClientApp/src/app/nav/nav.component.scss
new file mode 100644
index 000000000..727f7191f
--- /dev/null
+++ b/src/Ombi/ClientApp/src/app/nav/nav.component.scss
@@ -0,0 +1,17 @@
+.sidenav-container {
+ height: 100%;
+ }
+
+ .sidenav {
+ width: 200px;
+ box-shadow: 3px 0 6px rgba(0,0,0,.24);
+ }
+ .example-fill-remaining-space {
+ /* This fills the remaining space, by using flexbox.
+ Every toolbar row uses a flexbox row layout. */
+ flex: 1 1 auto;
+ }
+
+ .right-spacing {
+ margin-right:2%;
+ }
\ No newline at end of file
diff --git a/src/Ombi/ClientApp/src/app/nav/nav.component.ts b/src/Ombi/ClientApp/src/app/nav/nav.component.ts
new file mode 100644
index 000000000..2b0f79ca1
--- /dev/null
+++ b/src/Ombi/ClientApp/src/app/nav/nav.component.ts
@@ -0,0 +1,21 @@
+import { BreakpointObserver, Breakpoints, BreakpointState } from "@angular/cdk/layout";
+import { Component } from "@angular/core";
+import { Observable } from "rxjs";
+
+@Component({
+ selector: "app-nav",
+ templateUrl: "./nav.component.html",
+ styleUrls: ["./nav.component.scss"],
+})
+export class NavComponent {
+ public isHandset: Observable
= this.breakpointObserver.observe(Breakpoints.HandsetPortrait);
+
+ constructor(private breakpointObserver: BreakpointObserver) {
+ // this.checkLogin();
+ // this.authService.userLoggedIn.subscribe(x => {
+ // this.checkLogin();
+ // });
+ }
+
+
+}
\ No newline at end of file
diff --git a/src/Ombi/ClientApp/src/app/search/moviesearch.component.html b/src/Ombi/ClientApp/src/app/search/moviesearch.component.html
index 7d8a4653a..c66cd6383 100644
--- a/src/Ombi/ClientApp/src/app/search/moviesearch.component.html
+++ b/src/Ombi/ClientApp/src/app/search/moviesearch.component.html
@@ -1,4 +1,24 @@
-
+
+
+
+
+
+
+
+
+ Card Title
+
+
+
+ Some quick example text to build on the card title and make up the bulk of the card's
+ content.
+
+
+ Button
+
+
+
+
+