From 909a16b8b21da2fcd9146434c759eced12107b50 Mon Sep 17 00:00:00 2001
From: Heinrich Marks <heinrich.marks@mni.thm.de>
Date: Mon, 12 Mar 2018 20:16:24 +0100
Subject: [PATCH] Improve content creation html % logic

---
 .../content-creation.component.html            | 18 +++++-------------
 .../content-creation.component.ts              |  4 ++--
 2 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/src/app/content-creation/content-creation.component.html b/src/app/content-creation/content-creation.component.html
index fbcd98a34..2e435d223 100644
--- a/src/app/content-creation/content-creation.component.html
+++ b/src/app/content-creation/content-creation.component.html
@@ -1,20 +1,12 @@
-<form (ngSubmit)="addContent(subjectTitle.value, bodyText.value, contentRound.value)">
+<form (ngSubmit)="addContent(subjectTitle.value, bodyText.value)">
   <div fxLayout="column" fxLayoutAlign="center" fxLayoutGap="10px">
     <mat-form-field>
-      <input class="input-block" #subjectTitle matInput (keypress)="resetEmptyInputs()" placeholder="Subject" [(ngModel)]="subject"
-        name="Title">
-      <button mat-button *ngIf="subject" type="text" matSuffix mat-icon-button aria-label="Clear" (click)="subject=''">
-        <mat-icon>close</mat-icon>
-      </button>
+      <input class="input-block" #subjectTitle matInput (keypress)="resetEmptyInputs()" placeholder="Subject" [(ngModel)]="subject">
     </mat-form-field>
     <mat-form-field>
-    <input class="input-block" #contentRound matInput (keypress)="resetEmptyInputs()" placeholder="Round" [(ngModel)]="round"
-    name="Round">
-  </mat-form-field>
-    <mat-form-field>
-      <textarea #bodyText matInput matTextareaAutosize matAutosizeMinRows="3" matAutosizeMaxRows="8" (keypress)="resetEmptyInputs()"
-        placeholder="Body" [(ngModel)]="body" name="Text"></textarea>
-      <button mat-button *ngIf="body" type="text" matSuffix mat-icon-button aria-label="Clear" (click)="body=''">
+      <input class="input-block" #bodyText matInput matTextareaAutosize matAutosizeMinRows="3" matAutosizeMaxRows="8" (keypress)="resetEmptyInputs()"
+        placeholder="Body" [(ngModel)]="body">
+      <button mat-button matSuffix mat-icon-button aria-label="Clear" (click)="subject=''; body=''">
         <mat-icon>close</mat-icon>
       </button>
     </mat-form-field>
diff --git a/src/app/content-creation/content-creation.component.ts b/src/app/content-creation/content-creation.component.ts
index 6ec523824..98aa071df 100644
--- a/src/app/content-creation/content-creation.component.ts
+++ b/src/app/content-creation/content-creation.component.ts
@@ -14,8 +14,8 @@ import { RoomComponent } from '../room/room.component';
 export class ContentCreationComponent implements OnInit {
   subject: string;
   body: string;
-  roomId: string;
   emptyInputs = false;
+  
   constructor(
     private contentService: ContentService,
     private router: Router,
@@ -42,7 +42,7 @@ export class ContentCreationComponent implements OnInit {
       this.emptyInputs = true;
       return;
     }
-    this.contentService.addContent({ subject: subject, body: body, this.roomId } as Content)
+    this.contentService.addContent({ subject: subject, body: body } as Content)
       .subscribe(content => {
         this.notification.show(`Content '${content.subject}' successfully created.`);
         this.router.navigate([`/creator/room/${content.roomId}/${content.id}`]);
-- 
GitLab