From 51d2a67251037777a6bb6a21e7c9775399b2dc4f Mon Sep 17 00:00:00 2001 From: Lukas Kimpel <lukas.kimpel@mni.thm.de> Date: Thu, 15 Mar 2018 19:09:18 +0100 Subject: [PATCH] Add component to view text content on participant side --- .../participant-text-content.component.html | 9 +++++++ .../participant-text-content.component.scss | 0 ...participant-text-content.component.spec.ts | 25 +++++++++++++++++ .../participant-text-content.component.ts | 27 +++++++++++++++++++ 4 files changed, 61 insertions(+) create mode 100644 src/app/participant-text-content/participant-text-content.component.html create mode 100644 src/app/participant-text-content/participant-text-content.component.scss create mode 100644 src/app/participant-text-content/participant-text-content.component.spec.ts create mode 100644 src/app/participant-text-content/participant-text-content.component.ts diff --git a/src/app/participant-text-content/participant-text-content.component.html b/src/app/participant-text-content/participant-text-content.component.html new file mode 100644 index 000000000..19899bf42 --- /dev/null +++ b/src/app/participant-text-content/participant-text-content.component.html @@ -0,0 +1,9 @@ +<form (ngSubmit)="submit(answer.value)"> + <h1 class="mat-headline">{{ content.subject }}</h1> + <p>{{ content.body }}</p> + <mat-divider></mat-divider> + <mat-form-field> + <textarea matInput #answer placeholder="Your answer"></textarea> + </mat-form-field> + <button mat-button type="submit">Submit</button> +</form> diff --git a/src/app/participant-text-content/participant-text-content.component.scss b/src/app/participant-text-content/participant-text-content.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/participant-text-content/participant-text-content.component.spec.ts b/src/app/participant-text-content/participant-text-content.component.spec.ts new file mode 100644 index 000000000..b1855b0d1 --- /dev/null +++ b/src/app/participant-text-content/participant-text-content.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ParticipantTextContentComponent } from './participant-text-content.component'; + +describe('ParticipantTextContentComponent', () => { + let component: ParticipantTextContentComponent; + let fixture: ComponentFixture<ParticipantTextContentComponent>; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ParticipantTextContentComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ParticipantTextContentComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/participant-text-content/participant-text-content.component.ts b/src/app/participant-text-content/participant-text-content.component.ts new file mode 100644 index 000000000..0cec24630 --- /dev/null +++ b/src/app/participant-text-content/participant-text-content.component.ts @@ -0,0 +1,27 @@ +import { Component, OnInit } from '@angular/core'; +import { TextContent } from '../text-content'; + +@Component({ + selector: 'app-participant-text-content', + templateUrl: './participant-text-content.component.html', + styleUrls: ['./participant-text-content.component.scss'] +}) +export class ParticipantTextContentComponent implements OnInit { + + content: TextContent = new TextContent('1', + '1', + '1', + 'Text Content 1', + 'This is the body of Text Content 1', + 1); + + constructor() { + } + + ngOnInit() { + } + + submit(answer: string) { + } + +} -- GitLab