A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
disable instead of hide doc edit buttons
Michael Shamoon7a241950d42b
diff --git a/src-ui/src/app/components/document-detail/document-detail.component.html b/src-ui/src/app/components/document-detail/document-detail.component.htmlindex d2100b59c..ec9766d9f 100644--- a/src-ui/src/app/components/document-detail/document-detail.component.html+++ b/src-ui/src/app/components/document-detail/document-detail.component.html@@ -5,7 +5,7 @@<div class="input-group-text" i18n>of {{previewNumPages}}</div></div>- <button *ifOwner="document" type="button" class="btn btn-sm btn-outline-danger me-2 ms-auto" (click)="delete()">+ <button type="button" class="btn btn-sm btn-outline-danger me-2 ms-auto" (click)="delete()" [disabled]="!userIsOwner"><svg class="buttonicon" fill="currentColor"><use xlink:href="assets/bootstrap-icons.svg#trash" /></svg><span class="d-none d-lg-inline ps-1" i18n>Delete</span>@@ -20,7 +20,7 @@</a><div class="btn-group" ngbDropdown role="group" *ngIf="metadata?.has_archive_version">- <button class="btn btn-sm btn-outline-primary dropdown-toggle-split" ngbDropdownToggle></button>+ <button class="btn btn-sm btn-outline-primary dropdown-toggle" ngbDropdownToggle></button><div class="dropdown-menu shadow" ngbDropdownMenu><a ngbDropdownItem [href]="downloadOriginalUrl" i18n>Download original</a></div>@@ -199,10 +199,10 @@<div [ngbNavOutlet]="nav" class="mt-2"></div>- <ng-container *ifObjectPermissions="{ object: document, action: PermissionAction.Change }">- <button type="button" class="btn btn-outline-secondary" (click)="discard()" i18n [disabled]="networkActive || !(isDirty$ | async)">Discard</button> - <button type="button" class="btn btn-outline-primary" (click)="saveEditNext()" *ngIf="hasNext()" i18n [disabled]="networkActive || !(isDirty$ | async) || error">Save & next</button> - <button type="submit" class="btn btn-primary" *ifPermissions="{ action: PermissionAction.Change, type: PermissionType.Document }" i18n [disabled]="networkActive || !(isDirty$ | async) || error">Save</button> + <ng-container>+ <button type="button" class="btn btn-outline-secondary" (click)="discard()" i18n [disabled]="!userCanEdit || networkActive || !(isDirty$ | async)">Discard</button> + <button type="button" class="btn btn-outline-primary" (click)="saveEditNext()" *ngIf="hasNext()" i18n [disabled]="!userCanEdit || networkActive || !(isDirty$ | async) || error">Save & next</button> + <button type="submit" class="btn btn-primary" *ifPermissions="{ action: PermissionAction.Change, type: PermissionType.Document }" i18n [disabled]="!userCanEdit || networkActive || !(isDirty$ | async) || error">Save</button> </ng-container></form></div>diff --git a/src-ui/src/app/components/document-detail/document-detail.component.ts b/src-ui/src/app/components/document-detail/document-detail.component.tsindex 740ef46f9..2fe42bc25 100644--- a/src-ui/src/app/components/document-detail/document-detail.component.ts+++ b/src-ui/src/app/components/document-detail/document-detail.component.ts@@ -585,6 +585,13 @@ export class DocumentDetailComponent)}+ get userIsOwner(): boolean {+ return (+ !this.document ||+ this.permissionsService.currentUserOwnsObject(this.document)+ )+ }+get userCanEdit(): boolean {return (!this.document ||