diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts
index 58c9bee..c391fcb 100644
--- a/src/app/app-routing.module.ts
+++ b/src/app/app-routing.module.ts
@@ -5,6 +5,7 @@ import { AwardeeListComponent } from "./awardee-list/awardee-list.component";
import { JudgeListComponent } from "./judge-list/judge-list.component";
import { AwardeeEditorComponent } from "./awardee-editor/awardee-editor.component";
import { JudgeEditorComponent } from "./judge-editor/judge-editor.component";
+import { JudgeService } from "./shared/judge.service";
const routes: Routes = [
{
@@ -17,7 +18,10 @@ const routes: Routes = [
// canActivate: [AuthGuardService, RoleGuardService],
}, {
path: 'judges',
- component: JudgeListComponent
+ component: JudgeListComponent,
+ resolve: {
+ judges: JudgeService,
+ }
// canActivate: [AuthGuardService, RoleGuardService],
}, {
path: 'judge/new',
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index e01b130..e8778a2 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -1,6 +1,8 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
+import { HttpClientModule } from '@angular/common/http';
+import { FormsModule } from '@angular/forms';
import { LayoutModule } from '@angular/cdk/layout';
import {
MatToolbarModule,
@@ -40,8 +42,10 @@ import { JudgeEditorComponent } from './judge-editor/judge-editor.component';
],
imports: [
BrowserModule,
- AppRoutingModule,
BrowserAnimationsModule,
+ FormsModule,
+ HttpClientModule,
+ AppRoutingModule,
LayoutModule,
MatToolbarModule,
MatButtonModule,
diff --git a/src/app/awardee-editor/awardee-editor.component.css b/src/app/awardee-editor/awardee-editor.component.css
index 72719b5..86d0c3f 100644
--- a/src/app/awardee-editor/awardee-editor.component.css
+++ b/src/app/awardee-editor/awardee-editor.component.css
@@ -5,7 +5,7 @@
.awardee-form {
min-width: 150px;
- max-width: 500px;
+ max-width: 800px;
width: 100%;
}
diff --git a/src/app/awardee-editor/awardee-editor.component.html b/src/app/awardee-editor/awardee-editor.component.html
index d8ea208..0625fd8 100644
--- a/src/app/awardee-editor/awardee-editor.component.html
+++ b/src/app/awardee-editor/awardee-editor.component.html
@@ -9,9 +9,7 @@
-
- {{ year }}
-
+ {{ year }}
diff --git a/src/app/awardee-editor/awardee-editor.component.ts b/src/app/awardee-editor/awardee-editor.component.ts
index d64574a..35de04a 100644
--- a/src/app/awardee-editor/awardee-editor.component.ts
+++ b/src/app/awardee-editor/awardee-editor.component.ts
@@ -1,4 +1,6 @@
import { Component, OnInit } from '@angular/core';
+import { YearService } from "../shared/year.service";
+import { Title } from "@angular/platform-browser";
@Component({
selector: 'app-awardee-editor',
@@ -7,18 +9,17 @@ import { Component, OnInit } from '@angular/core';
})
export class AwardeeEditorComponent implements OnInit {
- public years: Array = [
- 2018,
- 2017,
- 2016,
- 2015,
- 2014,
- 2013,
- ];
-
- constructor() { }
+ constructor(
+ private yearProvider: YearService,
+ private titleService: Title
+ ) {}
ngOnInit() {
+ this.titleService.setTitle('Edit awardee');
+ }
+
+ get years(): Array {
+ return this.yearProvider.years;
}
}
diff --git a/src/app/awardee-list/awardee-list.component.ts b/src/app/awardee-list/awardee-list.component.ts
index 565f892..9df6664 100644
--- a/src/app/awardee-list/awardee-list.component.ts
+++ b/src/app/awardee-list/awardee-list.component.ts
@@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core';
+import { Title } from "@angular/platform-browser";
@Component({
selector: 'app-awardee-list',
@@ -7,9 +8,12 @@ import { Component, OnInit } from '@angular/core';
})
export class AwardeeListComponent implements OnInit {
- constructor() { }
+ constructor(
+ private titleService: Title
+ ) { }
ngOnInit() {
+ this.titleService.setTitle('Awardee list');
}
}
diff --git a/src/app/judge-editor/judge-editor.component.css b/src/app/judge-editor/judge-editor.component.css
index 5effc2f..1cd63ef 100644
--- a/src/app/judge-editor/judge-editor.component.css
+++ b/src/app/judge-editor/judge-editor.component.css
@@ -5,7 +5,7 @@
.judge-form {
min-width: 150px;
- max-width: 500px;
+ max-width: 800px;
width: 100%;
}
@@ -13,17 +13,15 @@
width: 100%;
}
-.half-width {
- width: calc(50% - 10px);
- margin-right: 10px;
-}
-
-.half-width:last-of-type {
- width: calc(50%);
- margin-right: 0;
+.year-select {
+ margin-right: 20px;
}
button + mat-divider {
margin-top: 10px;
margin-bottom: 10px;
}
+
+.title-table {
+ margin-bottom: 20px;
+}
diff --git a/src/app/judge-editor/judge-editor.component.html b/src/app/judge-editor/judge-editor.component.html
index a0b5bf2..26f634d 100644
--- a/src/app/judge-editor/judge-editor.component.html
+++ b/src/app/judge-editor/judge-editor.component.html
@@ -1,6 +1,6 @@
-