mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-09-22 00:52:42 -05:00
Random cleanup
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
@if (document?.versions?.length > 0) {
|
@if (document?.versions?.length > 0) {
|
||||||
<div class="btn-group" ngbDropdown role="group">
|
<div class="btn-group" ngbDropdown role="group">
|
||||||
<div class="btn-group" ngbDropdown role="group">
|
<div class="btn-group" ngbDropdown role="group">
|
||||||
<button class="btn btn-sm btn-outline-secondary dropdown-toggle" ngbDropdownToggle>
|
<button class="btn btn-sm btn-outline-secondary dropdown-toggle" ngbDropdownToggle [disabled]="!hasVersions">
|
||||||
<i-bs name="layers"></i-bs>
|
<i-bs name="layers"></i-bs>
|
||||||
<span class="d-none d-lg-inline ps-1" i18n>Version</span>
|
<span class="d-none d-lg-inline ps-1" i18n>Version</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input #versionFileInput type="file" class="visually-hidden" (change)="onVersionFileSelected($event)" />
|
<input #versionFileInput type="file" class="visually-hidden" (change)="onVersionFileSelected($event)" />
|
||||||
<button class="btn btn-sm btn-outline-secondary" title="Upload new version" i18n-title (click)="triggerUploadVersion()" [disabled]="!userIsOwner || !userCanEdit">
|
<button class="btn btn-sm btn-outline-secondary" title="Upload new version" i18n-title (click)="versionFileInput.click()" [disabled]="!userIsOwner || !userCanEdit">
|
||||||
<i-bs name="file-earmark-plus"></i-bs><span class="visually-hidden" i18n>Upload new version</span>
|
<i-bs name="file-earmark-plus"></i-bs><span class="visually-hidden" i18n>Upload new version</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -712,6 +712,10 @@ export class DocumentDetailComponent
|
|||||||
this.prepareForm(doc)
|
this.prepareForm(doc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get hasVersions(): boolean {
|
||||||
|
return this.document?.versions?.length > 1
|
||||||
|
}
|
||||||
|
|
||||||
// Update file preview and download target to a specific version (by document id)
|
// Update file preview and download target to a specific version (by document id)
|
||||||
selectVersion(versionId: number) {
|
selectVersion(versionId: number) {
|
||||||
this.selectedVersionId = versionId
|
this.selectedVersionId = versionId
|
||||||
@@ -1085,11 +1089,6 @@ export class DocumentDetailComponent
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Upload a new file version for this document
|
|
||||||
triggerUploadVersion() {
|
|
||||||
this.versionFileInput?.nativeElement?.click()
|
|
||||||
}
|
|
||||||
|
|
||||||
onVersionFileSelected(event: Event) {
|
onVersionFileSelected(event: Event) {
|
||||||
const input = event.target as HTMLInputElement
|
const input = event.target as HTMLInputElement
|
||||||
if (!input?.files || input.files.length === 0) return
|
if (!input?.files || input.files.length === 0) return
|
||||||
|
@@ -95,6 +95,7 @@ import {
|
|||||||
house,
|
house,
|
||||||
infoCircle,
|
infoCircle,
|
||||||
journals,
|
journals,
|
||||||
|
layers,
|
||||||
link,
|
link,
|
||||||
listNested,
|
listNested,
|
||||||
listTask,
|
listTask,
|
||||||
@@ -308,6 +309,7 @@ const icons = {
|
|||||||
house,
|
house,
|
||||||
infoCircle,
|
infoCircle,
|
||||||
journals,
|
journals,
|
||||||
|
layers,
|
||||||
link,
|
link,
|
||||||
listNested,
|
listNested,
|
||||||
listTask,
|
listTask,
|
||||||
|
Reference in New Issue
Block a user