diff --git a/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.html b/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.html index cdad89b4eaded7a41352b0b95156f4e5b1070d5f..7b25a7741a5df7b063ae53a24381789eefce385e 100644 --- a/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.html +++ b/src/app/components/shared/_dialogs/topic-cloud-administration/topic-cloud-administration.component.html @@ -36,6 +36,7 @@ <mat-divider></mat-divider> <app-topic-dialog-comment [question]="question" + [keyword] ="keyword.keyword" [maxShowedCharachters] = "140" [isCollapsed] = "!panelOpenState" ></app-topic-dialog-comment> diff --git a/src/app/components/shared/dialog/topic-dialog-comment/topic-dialog-comment.component.html b/src/app/components/shared/dialog/topic-dialog-comment/topic-dialog-comment.component.html index a188307dbb87778b6922d1e455281fa340bb30be..ea037559dcecfd287503aa63bd5dbf8e47dc09f2 100644 --- a/src/app/components/shared/dialog/topic-dialog-comment/topic-dialog-comment.component.html +++ b/src/app/components/shared/dialog/topic-dialog-comment/topic-dialog-comment.component.html @@ -1,9 +1,13 @@ <div> <p> {{(isCollapsed) ? question : question | slice:0:maxShowedCharachters}}{{question.length > maxShowedCharachters && !isCollapsed? "..." : ""}} - <button *ngIf = "question.length > maxShowedCharachters" + <span *ngFor="let part Of partsOfQuestion; let i = index"> + {{part}} + <span *ngIf="i < partsOfQuestion.length -1"><mark id="myMark">{{keyword}}</mark></span> + </span> + <button *ngIf = "question.length > maxShowedCharachters" (click)="isCollapsed = !isCollapsed"> {{ "dialog-comment.read-" + (!isCollapsed ? 'more': 'less') | translate }} </button> </p> -</div> \ No newline at end of file +</div> diff --git a/src/app/components/shared/dialog/topic-dialog-comment/topic-dialog-comment.component.ts b/src/app/components/shared/dialog/topic-dialog-comment/topic-dialog-comment.component.ts index 6c74197dce8bd598f3839f4b93b454a9ee486fdf..6ad9d09724da4cb40eb7f7ea1a88a68102584a8a 100644 --- a/src/app/components/shared/dialog/topic-dialog-comment/topic-dialog-comment.component.ts +++ b/src/app/components/shared/dialog/topic-dialog-comment/topic-dialog-comment.component.ts @@ -8,10 +8,17 @@ import { Component, Input, OnInit } from '@angular/core'; export class TopicDialogCommentComponent implements OnInit { @Input() question: string; + @Input() keyword: string ; @Input() maxShowedCharachters: number; @Input() isCollapsed: boolean = false; constructor() { } + get partsOfQuestion(){ + + return this.question.slice(0,this.isCollapsed? this.question.length: this.maxShowedCharachters).split(this.keyword) ; + + } + ngOnInit(): void { } }