comment period
This commit is contained in:
@@ -16,29 +16,58 @@
|
||||
<mat-icon *ngIf="comment.metadata && comment.metadata.downvoted" inline="true">thumb_down</mat-icon>
|
||||
<span> </span>
|
||||
</span>
|
||||
<a routerLink="/c/{{comment.id}}" matTooltip="{{comment.created | datef:'LLLL'}}">{{comment.created
|
||||
<a routerLink="/c/{{comment.id}}" matTooltip="{{comment.created | datef:'LLLL'}}">{{ (comment.modified ||
|
||||
comment.created)
|
||||
| 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>
|
||||
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>
|
||||
<a *ngIf="comment.metadata.unvote" href="javascript:" (click)="unvote()">{{'comment.unvote' | i18n}}</a>
|
||||
</small>
|
||||
</div>
|
||||
<div mat-line class="text"
|
||||
[style.opacity]="comment.metadata && comment.metadata.points && comment.metadata.points < 0 ? 1 + (comment.metadata.points / 10) : '1.0'"
|
||||
[innerHTML]="comment.text | urltext"></div>
|
||||
<div mat-line>
|
||||
<small>
|
||||
<a href="javascript:" (click)="comment.metadata.reply=!comment.metadata.reply">{{(comment.metadata.reply ?
|
||||
'comment.replyHide' : 'comment.reply') | i18n}}</a>
|
||||
<span *ngIf="moderator"> | </span>
|
||||
<a *ngIf="moderator" href="javascript:" (click)="deleteComment(comment)">{{'comment.delete' | i18n}}</a>
|
||||
</small>
|
||||
</div>
|
||||
<ng-container *ngIf="!comment.metadata || !comment.metadata.edit">
|
||||
<div mat-line class="text"
|
||||
[style.opacity]="comment.metadata && comment.metadata.points && comment.metadata.points < 0 ? 1 + (comment.metadata.points / 10) : '1.0'"
|
||||
[innerHTML]="comment.text | urltext"></div>
|
||||
<div mat-line>
|
||||
<small>
|
||||
<a href="javascript:" (click)="comment.metadata.reply=!comment.metadata.reply">{{(comment.metadata.reply ?
|
||||
'comment.replyHide' : 'comment.reply') | i18n}}</a>
|
||||
<span *ngIf="canEdit()"> | </span>
|
||||
<a *ngIf="canEdit()" href="javascript:" (click)="edit()">{{'comment.edit' | i18n}}</a>
|
||||
<span *ngIf="moderator"> | </span>
|
||||
<a *ngIf="moderator" href="javascript:" (click)="modDeleteComment(comment)">{{'moderation.comment.delete' | i18n}}</a>
|
||||
</small>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="comment.metadata && comment.metadata.edit">
|
||||
<form [formGroup]="form" (ngSubmit)="update()" #formDirective="ngForm">
|
||||
<mat-form-field>
|
||||
<textarea [mat-autosize] [matAutosizeMinRows]="3" matInput formControlName="text"
|
||||
placeholder="{{'comment.text' | i18n}}" required></textarea>
|
||||
<mat-error *ngIf="hasError('text')">
|
||||
{{'comment.text.error' | i18n}}
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
<button *ngIf="!working" mat-raised-button color="primary" [disabled]="form.invalid">
|
||||
{{'comment.save' | i18n}}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div mat-line>
|
||||
<small>
|
||||
<a href="javascript:" (click)="comment.metadata.edit = false">{{'cancel' | i18n}}</a>
|
||||
<span> | </span>
|
||||
<a href="javascript:" (click)="deleteComment(comment)">{{'comment.delete' | i18n}}</a>
|
||||
</small>
|
||||
</div>
|
||||
|
||||
</ng-container>
|
||||
|
||||
<div mat-line>
|
||||
<ui-commentform *ngIf="comment.metadata.reply" [target]="comment.target" [parent]="comment.id"
|
||||
|
||||
Reference in New Issue
Block a user