From e1d455d03be8162cb6e3430cb4fd47f30913b250 Mon Sep 17 00:00:00 2001 From: Heinrich Marks <heinrich.marks@mni.thm.de> Date: Sun, 11 Mar 2018 14:35:15 +0100 Subject: [PATCH] Adjust creator room view --- src/app/app-routing.module.ts | 2 +- src/app/content-list/content-list.component.ts | 4 ++-- src/app/content.ts | 2 +- src/app/creator-room/creator-room.component.html | 7 ++++--- src/app/in-memory-data.service.ts | 10 +++++----- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index d725407d1..1364c4b06 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -58,7 +58,7 @@ const routes: Routes = [ data: { roles: [UserRole.CREATOR] } }, { - path: 'creator/room/:roomId/content-list/:id', + path: 'creator/room/:roomId/:id', component: ContentDetailComponent, canActivate: [AuthenticationGuard], data: { roles: [UserRole.CREATOR] } diff --git a/src/app/content-list/content-list.component.ts b/src/app/content-list/content-list.component.ts index 65866388a..71828d595 100644 --- a/src/app/content-list/content-list.component.ts +++ b/src/app/content-list/content-list.component.ts @@ -10,14 +10,14 @@ import { Content } from '../content'; export class ContentListComponent implements OnInit { contents: Content[]; - constructor(private contentCreationService: ContentService) { } + constructor(private ContentService: ContentService) { } ngOnInit() { this.getContents(); } getContents(): void { - this.contentCreationService.getContents() + this.ContentService.getContents() .subscribe(contents => { this.contents = contents; }); diff --git a/src/app/content.ts b/src/app/content.ts index 80fcce7c9..8ed673db7 100644 --- a/src/app/content.ts +++ b/src/app/content.ts @@ -15,5 +15,5 @@ export class Content { body: string; round: number; format: Format; - // formatAttributes: Map<string, string>; + // formatAttributes: Map<string, string>; } diff --git a/src/app/creator-room/creator-room.component.html b/src/app/creator-room/creator-room.component.html index 5fb5684df..0cc2f6c50 100644 --- a/src/app/creator-room/creator-room.component.html +++ b/src/app/creator-room/creator-room.component.html @@ -17,14 +17,15 @@ {{ room.description }} </p> </mat-card-content> + <mat-divider></mat-divider> + + <app-content-list></app-content-list> + <mat-divider></mat-divider> <mat-card-actions> <button mat-button color="primary" matTooltip="Create new content" routerLink="/creator/room/{{room.id}}/content-creation"> Create content </button> - <button mat-button color="primary" matTooltip="See contents" routerLink="/creator/room/{{room.id}}/content-list"> - Contents - </button> <button mat-button color="primary" matTooltip="See room comments" routerLink="/creator/room/{{room.id}}/comments"> Comments diff --git a/src/app/in-memory-data.service.ts b/src/app/in-memory-data.service.ts index 45201f214..0666d391a 100644 --- a/src/app/in-memory-data.service.ts +++ b/src/app/in-memory-data.service.ts @@ -84,20 +84,20 @@ export class InMemoryDataService implements InMemoryDbService { const contents = [ { - id: '11', + id: '1', revision: '1', roomId: '1', - subject: 'bla', + subject: 'Textaufgabe 1', body: 'testcontent alpha beta', round: 1, format: Format.TEXT }, { - id: '12', + id: '2', revision: '2', roomId: '3', - subject: 'blub', - body: 'testcontenttttt', + subject: 'Textaufgabe 2', + body: 'Ein Mann kauft 20 Melonen. Eine Melone wiegt jeweils 5kg. <br> Berechnen Sie das Gesamtgewicht.', round: 5, format: Format.TEXT } -- GitLab