users subcomments

This commit is contained in:
_Bastler 2021-10-06 13:30:17 +02:00
parent a464042482
commit 86d9f15679
5 changed files with 6 additions and 2 deletions

View File

@ -6,7 +6,7 @@
<p>{{'user.commentsBy' | i18n}}<a routerLink="/u/{{username}}">{{username}}</a></p>
<ng-container *ngFor="let comment of comments.content; let i = index">
<mat-divider class="divider" *ngIf="i > 0"></mat-divider>
<ui-comment [comment]="comment" [ignore]="ignore"></ui-comment>
<ui-comment [comment]="comment" [ignore]="ignore" [parentLink]="true"></ui-comment>
</ng-container>
<mat-list *ngIf="comments.totalElements == 0">

View File

@ -20,6 +20,8 @@
| datef}}</a>
<span *ngIf="comment.metadata && comment.metadata.author"> {{'comment.author' | i18n}}<a
routerLink="/u/{{comment.author}}">{{comment.author}}</a></span>
<span *ngIf="parentLink && comment.parent"> {{'comment.to' | i18n}} <a
routerLink="/c/{{comment.parent}}">{{'comment' | i18n}}</a></span>
<span *ngIf="comment.metadata && comment.metadata.entry"> {{'comment.on' | i18n}} <a class="entry"
routerLink="/e/{{comment.target}}">{{comment.metadata.entry || 'entry'}}</a></span>
<span *ngIf="comment.metadata && comment.metadata.unvote"> | </span>

View File

@ -20,6 +20,7 @@ export class UiComment implements OnInit {
@Input() change: Function;
@Input() ignore: string[] = [];
@Input() subcomments: boolean = false;
@Input() parentLink: boolean = false;
@ViewChild('subcomments') comments: UiComments;
constructor(private authService: AuthService, private commentService: CommentService, private voteService: VoteService,

View File

@ -3,7 +3,7 @@
<div *ngIf="comments && comments.content" fxLayout="column" fxFlexFill class="comments">
<ng-container *ngFor="let comment of comments.content; let i = index">
<mat-divider class="divider" *ngIf="i > 0"></mat-divider>
<ui-comment class="comment" [comment]="comment" [change]="boundRefresh" [subcomments]="subcomments" [ignore]="ignore"></ui-comment>
<ui-comment class="comment" [comment]="comment" [change]="boundRefresh" [subcomments]="subcomments" [ignore]="ignore" [parentLink]="parentLink"></ui-comment>
</ng-container>
<mat-list *ngIf="comments.totalElements == 0 && !parent">

View File

@ -15,6 +15,7 @@ export class UiComments implements OnInit {
@Input() parent: number;
@Input() ignore: string[] = [];
@Input() subcomments: boolean = false;
@Input() parentLink: boolean = false;
boundRefresh: Function;
constructor(private commentService: CommentService) { }