2022-08-07 12:41:30 -07:00
|
|
|
<div *ngIf="comments">
|
2022-12-17 20:09:29 -08:00
|
|
|
<form [formGroup]="commentForm" class="needs-validation mt-3" *appIfPermissions="{ action: PermissionAction.Add, type: PermissionType.Comment }" novalidate>
|
2022-08-23 15:15:34 -07:00
|
|
|
<div class="form-group">
|
|
|
|
|
<textarea class="form-control form-control-sm" [class.is-invalid]="newCommentError" rows="3" formControlName="newComment" placeholder="Enter comment" i18n-placeholder required></textarea>
|
|
|
|
|
<div class="invalid-feedback" i18n>
|
|
|
|
|
Please enter a comment.
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-09-12 08:35:13 -07:00
|
|
|
<div class="form-group mt-2 d-flex justify-content-end align-items-center">
|
|
|
|
|
<div *ngIf="networkActive" class="spinner-border spinner-border-sm fw-normal me-auto" role="status"></div>
|
2022-08-23 15:15:34 -07:00
|
|
|
<button type="button" class="btn btn-primary btn-sm" [disabled]="networkActive" (click)="addComment()" i18n>Add comment</button>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
<hr>
|
2022-08-07 21:44:28 -07:00
|
|
|
<div *ngFor="let comment of comments" class="card border mb-3">
|
|
|
|
|
<div class="card-body text-dark">
|
|
|
|
|
<p class="card-text">{{comment.comment}}</p>
|
2022-08-07 12:41:30 -07:00
|
|
|
</div>
|
2022-08-07 21:44:28 -07:00
|
|
|
<div class="d-flex card-footer small bg-light text-primary justify-content-between align-items-center">
|
2022-08-07 22:05:32 -07:00
|
|
|
<span>{{displayName(comment)}} - {{ comment.created | customDate}}</span>
|
2023-03-16 00:42:24 -07:00
|
|
|
<button type="button" class="btn btn-link btn-sm p-0 fade" title="Delete comment" i18n-title (click)="deleteComment(comment.id)" *appIfPermissions="{ action: PermissionAction.Delete, type: PermissionType.Comment }">
|
2022-08-07 22:05:32 -07:00
|
|
|
<svg width="13" height="13" fill="currentColor">
|
|
|
|
|
<use xlink:href="assets/bootstrap-icons.svg#trash" />
|
2022-08-07 21:44:28 -07:00
|
|
|
</svg>
|
2023-03-16 00:42:24 -07:00
|
|
|
<span class="visually-hidden" i18n>Delete comment</span>
|
2022-08-23 21:59:54 -07:00
|
|
|
</button>
|
2022-08-07 21:44:28 -07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-08-07 17:33:13 -07:00
|
|
|
</div>
|