diff --git a/src/app/components/creator/comment-creator-page/comment-creator-page.component.scss b/src/app/components/creator/comment-creator-page/comment-creator-page.component.scss index 501394eb496b8c96db882589073de268cfcb434a..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/src/app/components/creator/comment-creator-page/comment-creator-page.component.scss +++ b/src/app/components/creator/comment-creator-page/comment-creator-page.component.scss @@ -1,4 +0,0 @@ -app-comment-list { - width: 100%; - max-width: 800px; -} diff --git a/src/app/components/shared/_dialogs/submit-comment/submit-comment.component.ts b/src/app/components/shared/_dialogs/submit-comment/submit-comment.component.ts index caca1c72a4921ef3610a4c1289d2b28784be762a..eaa0a5f2a15d2766deb6f0044ff512ed35987255 100644 --- a/src/app/components/shared/_dialogs/submit-comment/submit-comment.component.ts +++ b/src/app/components/shared/_dialogs/submit-comment/submit-comment.component.ts @@ -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); } } diff --git a/src/app/components/shared/comment-list/comment-list.component.scss b/src/app/components/shared/comment-list/comment-list.component.scss index c7889db8d7c223204daadb94ece9c5314ff681f6..05f9132c8fd215795eda5b6137d6a841a4d526da 100644 --- a/src/app/components/shared/comment-list/comment-list.component.scss +++ b/src/app/components/shared/comment-list/comment-list.component.scss @@ -1,6 +1,9 @@ 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; diff --git a/src/app/components/shared/comment/comment.component.html b/src/app/components/shared/comment/comment.component.html index c140489039bf65956bafefa09a79aa9bcb5332a4..e5f7b77cff496a9cd6d8b4cc204f0f3e28419cff 100644 --- a/src/app/components/shared/comment/comment.component.html +++ b/src/app/components/shared/comment/comment.component.html @@ -1,5 +1,6 @@ <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> diff --git a/src/app/components/shared/comment/comment.component.scss b/src/app/components/shared/comment/comment.component.scss index 5b2b2e943000acee64474d83954a59110c35fb67..ac4d7beca3ae20f39af8512885a3528aedb6834c 100644 --- a/src/app/components/shared/comment/comment.component.scss +++ b/src/app/components/shared/comment/comment.component.scss @@ -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; +} + diff --git a/src/app/models/comment.ts b/src/app/models/comment.ts index 81142f8df808d0eb3ff7c80a59e6a8b92e90ab49..2fb2ad760db8e8cb2c39c6b389fb34f52f1fe474 100644 --- a/src/app/models/comment.ts +++ b/src/app/models/comment.ts @@ -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; } }