mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Show number of comments on cards, tab
This commit is contained in:
@@ -172,9 +172,9 @@
|
||||
</li>
|
||||
|
||||
<li [ngbNavItem]="5" *ngIf="commentsEnabled">
|
||||
<a ngbNavLink i18n>Comments</a>
|
||||
<a ngbNavLink i18n>Comments <span *ngIf="document?.n_comments" class="badge text-bg-secondary ms-1">{{document.n_comments}}</span></a>
|
||||
<ng-template ngbNavContent>
|
||||
<app-document-comments [documentId]="documentId"></app-document-comments>
|
||||
<app-document-comments [documentId]="documentId" (updated)="commentsUpdated($event)"></app-document-comments>
|
||||
</ng-template>
|
||||
</li>
|
||||
|
||||
|
@@ -632,6 +632,11 @@ export class DocumentDetailComponent
|
||||
)
|
||||
}
|
||||
|
||||
commentsUpdated(n_comments: number) {
|
||||
this.document.n_comments = n_comments
|
||||
this.openDocumentService.refreshDocument(this.documentId)
|
||||
}
|
||||
|
||||
get userIsOwner(): boolean {
|
||||
let doc: PaperlessDocument = Object.assign({}, this.document)
|
||||
// dont disable while editing
|
||||
|
Reference in New Issue
Block a user