Use correct direction for RTL content

This commit is contained in:
Michael Shamoon
2023-01-01 08:59:43 -08:00
committed by Trenton H
parent 0fd51e35e1
commit da38efebdf
5 changed files with 22 additions and 1 deletions

View File

@@ -91,7 +91,7 @@
<a ngbNavLink i18n>Content</a>
<ng-template ngbNavContent>
<div class="mb-3">
<textarea class="form-control" id="content" rows="20" formControlName='content'></textarea>
<textarea class="form-control" id="content" rows="20" formControlName='content' [class.rtl]="isRTL"></textarea>
</div>
</ng-template>
</li>

View File

@@ -28,3 +28,7 @@
left: 30%;
right: 30%;
}
textarea.rtl {
direction: rtl;
}

View File

@@ -135,6 +135,13 @@ export class DocumentDetailComponent
: this.metadata?.original_mime_type
}
get isRTL() {
if (!this.metadata || !this.metadata.lang) return false
else {
return ['ar', 'he', 'fe'].includes(this.metadata.lang)
}
}
ngOnInit(): void {
this.documentForm.valueChanges
.pipe(takeUntil(this.unsubscribeNotifier))

View File

@@ -10,4 +10,6 @@ export interface PaperlessDocumentMetadata {
original_filename?: string
has_archive_version?: boolean
lang?: string
}