Skip to content
Snippets Groups Projects
Commit beae288c authored by Louis Peter's avatar Louis Peter
Browse files

Merge branch 'fix-dozent-view' into 'master'

Fix dozent view

See merge request swtp-2019/arsnova-lite!22
parents d04541c7 af1adfe7
4 merge requests!171SWTP Comment Project,!170Fix linter in pipe,!169WebSocket Connector,!168Filter comment list
app-comment-list {
width: 100%;
max-width: 800px;
}
......@@ -25,12 +25,12 @@ export class SubmitCommentComponent implements OnInit {
private date = new Date(Date.now());
constructor(
private notification: NotificationService,
public dialogRef: MatDialogRef<CommentPageComponent>,
private translateService: TranslateService,
public dialog: MatDialog,
private translationService: TranslateService,
@Inject(MAT_DIALOG_DATA) public data: any) {
private notification: NotificationService,
public dialogRef: MatDialogRef<CommentPageComponent>,
private translateService: TranslateService,
public dialog: MatDialog,
private translationService: TranslateService,
@Inject(MAT_DIALOG_DATA) public data: any) {
}
ngOnInit() {
......@@ -58,6 +58,7 @@ export class SubmitCommentComponent implements OnInit {
comment.roomId = localStorage.getItem(`roomId`);
comment.body = body;
comment.userId = this.user.id;
comment.createdFromLecturer = this.user.role === 1;
this.dialogRef.close(comment);
}
}
......
mat-card {
margin-bottom: 10px;
background-color: #4db6ac;
border-radius: 8px;
width: 100%;
max-width: 800px;
}
app-comment {
......@@ -10,7 +13,7 @@ app-comment {
input {
box-sizing: border-box;
padding: 0 10px 0 20px;
padding: 0 10px 0 20px;
width: 100%;
background-color: #4db6ac;
border: none;
......
<mat-card class="card-container">
<div fxLayout="row" fxLayoutAlign="center center">
<div *ngIf="comment.createdFromLecturer !== false" mat-card-avatar class="proffesor-icon" matTooltip="created from lecturer"><mat-icon>record_voice_over</mat-icon></div>
<mat-card-content>
<p>{{comment.body}}</p>
</mat-card-content>
......
......@@ -4,7 +4,7 @@ mat-card {
cursor: pointer;
}
mat-card-content>:first-child {
mat-card-content > :first-child {
margin-top: 20px;
}
......@@ -29,3 +29,10 @@ mat-icon {
.favorite-icon {
color: #fdd835;
}
.proffesor-icon {
background-size: cover;
margin-right: 10px;
margin-top: 10px;
}
......@@ -8,6 +8,8 @@ export class Comment {
correct: boolean;
favorite: boolean;
creationTimestamp: Date;
score: number;
createdFromLecturer: boolean;
constructor(roomId: string = '',
userId: string = '',
......@@ -15,7 +17,9 @@ export class Comment {
read: boolean = false,
correct: boolean = false,
favorite: boolean = false,
creationTimestamp: Date = null) {
creationTimestamp: Date = null,
score: number = 0,
createdFromLecturer = false) {
this.id = '';
this.roomId = roomId;
this.userId = userId;
......@@ -25,5 +29,7 @@ export class Comment {
this.correct = correct;
this.favorite = favorite;
this.creationTimestamp = creationTimestamp;
this.score = score;
this.createdFromLecturer = createdFromLecturer;
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment