UI
This commit is contained in:
parent
872fc206b4
commit
e58c2d4bbf
@ -6,6 +6,9 @@ info="Manage trashed items."
|
|||||||
<button class="btn btn-sm btn-outline-secondary" (click)="clearSelection()" [hidden]="selectedDocuments.size === 0">
|
<button class="btn btn-sm btn-outline-secondary" (click)="clearSelection()" [hidden]="selectedDocuments.size === 0">
|
||||||
<i-bs name="x"></i-bs> <ng-container i18n>Clear selection</ng-container>
|
<i-bs name="x"></i-bs> <ng-container i18n>Clear selection</ng-container>
|
||||||
</button>
|
</button>
|
||||||
|
<button type="button" class="btn btn-sm btn-outline-primary" (click)="restoreAll(selectedDocuments)" [disabled]="selectedDocuments.size === 0">
|
||||||
|
<i-bs name="arrow-counterclockwise"></i-bs> <ng-container i18n>Restore selected</ng-container>
|
||||||
|
</button>
|
||||||
<button type="button" class="btn btn-sm btn-outline-danger" (click)="emptyTrash(selectedDocuments)" [disabled]="selectedDocuments.size === 0">
|
<button type="button" class="btn btn-sm btn-outline-danger" (click)="emptyTrash(selectedDocuments)" [disabled]="selectedDocuments.size === 0">
|
||||||
<i-bs name="trash"></i-bs> <ng-container i18n>Delete selected</ng-container>
|
<i-bs name="trash"></i-bs> <ng-container i18n>Delete selected</ng-container>
|
||||||
</button>
|
</button>
|
||||||
@ -24,7 +27,7 @@ info="Manage trashed items."
|
|||||||
<tr>
|
<tr>
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
<div class="form-check m-0 ms-2 me-n2">
|
<div class="form-check m-0 ms-2 me-n2">
|
||||||
<input type="checkbox" class="form-check-input" id="all-objects" [(ngModel)]="togggleAll" [disabled]="documentsInTrash.length === 0" (click)="toggleAll($event); $event.stopPropagation();">
|
<input type="checkbox" class="form-check-input" id="all-objects" [(ngModel)]="allToggled" [disabled]="documentsInTrash.length === 0" (click)="toggleAll($event); $event.stopPropagation();">
|
||||||
<label class="form-check-label" for="all-objects"></label>
|
<label class="form-check-label" for="all-objects"></label>
|
||||||
</div>
|
</div>
|
||||||
</th>
|
</th>
|
||||||
@ -66,7 +69,7 @@ info="Manage trashed items."
|
|||||||
</div>
|
</div>
|
||||||
<div class="btn-group d-none d-sm-block">
|
<div class="btn-group d-none d-sm-block">
|
||||||
<button class="btn btn-sm btn-outline-secondary" (click)="restore(document); $event.stopPropagation();">
|
<button class="btn btn-sm btn-outline-secondary" (click)="restore(document); $event.stopPropagation();">
|
||||||
<i-bs width="1em" height="1em" name="restore"></i-bs> <ng-container i18n>Restore</ng-container>
|
<i-bs width="1em" height="1em" name="arrow-counterclockwise"></i-bs> <ng-container i18n>Restore</ng-container>
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-sm btn-outline-danger" (click)="delete(document); $event.stopPropagation();">
|
<button class="btn btn-sm btn-outline-danger" (click)="delete(document); $event.stopPropagation();">
|
||||||
<i-bs width="1em" height="1em" name="trash"></i-bs> <ng-container i18n>Delete</ng-container>
|
<i-bs width="1em" height="1em" name="trash"></i-bs> <ng-container i18n>Delete</ng-container>
|
||||||
|
@ -14,7 +14,7 @@ import { Subject, takeUntil } from 'rxjs'
|
|||||||
export class TrashComponent implements OnDestroy {
|
export class TrashComponent implements OnDestroy {
|
||||||
public documentsInTrash: Document[] = []
|
public documentsInTrash: Document[] = []
|
||||||
public selectedDocuments: Set<number> = new Set()
|
public selectedDocuments: Set<number> = new Set()
|
||||||
public togggleAll: boolean = false
|
public allToggled: boolean = false
|
||||||
public page: number = 1
|
public page: number = 1
|
||||||
public isLoading: boolean = false
|
public isLoading: boolean = false
|
||||||
unsubscribeNotifier: Subject<void> = new Subject()
|
unsubscribeNotifier: Subject<void> = new Subject()
|
||||||
@ -37,7 +37,7 @@ export class TrashComponent implements OnDestroy {
|
|||||||
this.trashService.getTrash().subscribe((documentsInTrash) => {
|
this.trashService.getTrash().subscribe((documentsInTrash) => {
|
||||||
this.documentsInTrash = documentsInTrash
|
this.documentsInTrash = documentsInTrash
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
console.log('Trash:', documentsInTrash)
|
this.selectedDocuments.clear()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,6 +79,7 @@ export class TrashComponent implements OnDestroy {
|
|||||||
.emptyTrash(documents ? Array.from(documents) : [])
|
.emptyTrash(documents ? Array.from(documents) : [])
|
||||||
.subscribe(() => {
|
.subscribe(() => {
|
||||||
this.toastService.showInfo($localize`Document(s) deleted`)
|
this.toastService.showInfo($localize`Document(s) deleted`)
|
||||||
|
this.allToggled = false
|
||||||
this.reload()
|
this.reload()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -86,7 +87,7 @@ export class TrashComponent implements OnDestroy {
|
|||||||
|
|
||||||
restore(document: Document) {
|
restore(document: Document) {
|
||||||
this.trashService.restoreDocuments([document.id]).subscribe(() => {
|
this.trashService.restoreDocuments([document.id]).subscribe(() => {
|
||||||
this.toastService.showInfo($localize`Object restored`)
|
this.toastService.showInfo($localize`Document restored`)
|
||||||
this.reload()
|
this.reload()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -95,7 +96,8 @@ export class TrashComponent implements OnDestroy {
|
|||||||
this.trashService
|
this.trashService
|
||||||
.restoreDocuments(objects ? Array.from(this.selectedDocuments) : [])
|
.restoreDocuments(objects ? Array.from(this.selectedDocuments) : [])
|
||||||
.subscribe(() => {
|
.subscribe(() => {
|
||||||
this.toastService.showInfo($localize`Object(s) restored`)
|
this.toastService.showInfo($localize`Document(s) restored`)
|
||||||
|
this.allToggled = false
|
||||||
this.reload()
|
this.reload()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -115,7 +117,7 @@ export class TrashComponent implements OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
clearSelection() {
|
clearSelection() {
|
||||||
this.togggleAll = false
|
this.allToggled = false
|
||||||
this.selectedDocuments.clear()
|
this.selectedDocuments.clear()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -267,15 +267,13 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
}
|
}
|
||||||
<!-- @if (permissionsService.isAdmin()) { -->
|
<li class="nav-item app-link" *pngxIfPermissions="{ action: PermissionAction.Delete, type: PermissionType.Document }">
|
||||||
<li class="nav-item app-link">
|
|
||||||
<a class="nav-link" routerLink="trash" routerLinkActive="active" (click)="closeMenu()" ngbPopover="Trash"
|
<a class="nav-link" routerLink="trash" routerLinkActive="active" (click)="closeMenu()" ngbPopover="Trash"
|
||||||
i18n-ngbPopover [disablePopover]="!slimSidebarEnabled" placement="end" container="body"
|
i18n-ngbPopover [disablePopover]="!slimSidebarEnabled" placement="end" container="body"
|
||||||
triggers="mouseenter:mouseleave" popoverClass="popover-slim">
|
triggers="mouseenter:mouseleave" popoverClass="popover-slim">
|
||||||
<i-bs class="me-1" name="trash"></i-bs><span> <ng-container i18n>Trash</ng-container></span>
|
<i-bs class="me-1" name="trash"></i-bs><span> <ng-container i18n>Trash</ng-container></span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<!-- } -->
|
|
||||||
<li class="nav-item mt-2" tourAnchor="tour.outro">
|
<li class="nav-item mt-2" tourAnchor="tour.outro">
|
||||||
<a class="px-3 py-2 text-muted small d-flex align-items-center flex-wrap text-decoration-none"
|
<a class="px-3 py-2 text-muted small d-flex align-items-center flex-wrap text-decoration-none"
|
||||||
target="_blank" rel="noopener noreferrer" href="https://docs.paperless-ngx.com" ngbPopover="Documentation"
|
target="_blank" rel="noopener noreferrer" href="https://docs.paperless-ngx.com" ngbPopover="Documentation"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user