From 642aeff17c98ac0bdc0418f5a522fe13a66e1f0a Mon Sep 17 00:00:00 2001 From: davivcu Date: Tue, 9 Jul 2024 22:43:24 +0200 Subject: [PATCH] Hide verse and lb numbers if plain text is selected as text flow mode --- src/app/app.config.ts | 2 +- src/app/components/lb/lb.component.html | 2 +- src/app/components/lb/lb.component.ts | 4 ++++ .../verse-prose-select/verse-prose-select.component.html | 6 +++--- .../verse-prose-select/verse-prose-select.component.ts | 4 ++-- src/app/components/verse/verse.component.html | 2 +- src/app/components/verse/verse.component.ts | 4 ++++ src/assets/i18n/en.json | 4 +++- src/assets/i18n/it.json | 4 +++- 9 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/app/app.config.ts b/src/app/app.config.ts index a85c6bb6f..fb0800330 100644 --- a/src/app/app.config.ts +++ b/src/app/app.config.ts @@ -236,4 +236,4 @@ export interface CustomEditorialConvention { }; } -export type TextFlow = 'prose' | 'proseWithVerseNumbers' | 'verses'; +export type TextFlow = 'prose' | 'prose_strict' | 'verses'; diff --git a/src/app/components/lb/lb.component.html b/src/app/components/lb/lb.component.html index 1f1ceabfb..e4c15bf31 100644 --- a/src/app/components/lb/lb.component.html +++ b/src/app/components/lb/lb.component.html @@ -3,7 +3,7 @@ [attr.id]="data.id" [attr.data-rend]="data.rend || ''" [attr.data-facs]="data.facs || ''">
- {{data.n}} + {{data.n}}
  diff --git a/src/app/components/lb/lb.component.ts b/src/app/components/lb/lb.component.ts index 6dd67a27c..afdb4f6cd 100644 --- a/src/app/components/lb/lb.component.ts +++ b/src/app/components/lb/lb.component.ts @@ -40,6 +40,10 @@ export class LbComponent { ); } + get plainTextFlow() { + return this.textFlow === 'prose_strict'; + } + get displayInline$() { return this.displayBlock$.pipe( map((displayBlock) => !displayBlock), diff --git a/src/app/components/verse-prose-select/verse-prose-select.component.html b/src/app/components/verse-prose-select/verse-prose-select.component.html index c43d85cca..e7b91e27d 100644 --- a/src/app/components/verse-prose-select/verse-prose-select.component.html +++ b/src/app/components/verse-prose-select/verse-prose-select.component.html @@ -3,20 +3,20 @@ [multiple]="false" [closeOnSelect]="true" [searchable]="false" - [placeholder]="'selectItems' | translate" + [placeholder]="'Text Flow' | translate" [(ngModel)]="selectedType" [disabled]="textFlowTypes.length === 0" [clearable]="false" (change)="updateSelectedType($event)"> - {{item | translate}} + {{'option_' + item | translate}} - {{item | translate}} + {{'option_' + item | translate}} diff --git a/src/app/components/verse-prose-select/verse-prose-select.component.ts b/src/app/components/verse-prose-select/verse-prose-select.component.ts index 204650562..46d3eff62 100644 --- a/src/app/components/verse-prose-select/verse-prose-select.component.ts +++ b/src/app/components/verse-prose-select/verse-prose-select.component.ts @@ -12,9 +12,9 @@ export class VerseProseSelectComponent { @Output() textModeSelectionChange: EventEmitter = new EventEmitter(); - public textFlowTypes: TextFlow[] = ['prose', 'proseWithVerseNumbers', 'verses']; + public textFlowTypes: TextFlow[] = ['prose', 'prose_strict', 'verses']; - public selectedType: TextFlow = null; + public selectedType: TextFlow = 'prose'; getProseVersesTogglerIcon(textFlowMode: TextFlow): EvtIconInfo { return { icon: textFlowMode === 'verses' ? 'align-justify' : 'align-left', iconSet: 'fas' }; diff --git a/src/app/components/verse/verse.component.html b/src/app/components/verse/verse.component.html index 24212b46d..f7ca56cf1 100644 --- a/src/app/components/verse/verse.component.html +++ b/src/app/components/verse/verse.component.html @@ -1,6 +1,6 @@ - {{data.n}} + {{data.n}} diff --git a/src/app/components/verse/verse.component.ts b/src/app/components/verse/verse.component.ts index bd0a1902b..1228e790e 100644 --- a/src/app/components/verse/verse.component.ts +++ b/src/app/components/verse/verse.component.ts @@ -45,6 +45,10 @@ export class VerseComponent { return !isNaN(num) && num % this.verseNumberPrinter !== 0; } + get plainTextFlow() { + return this.textFlow === 'prose_strict'; + } + constructor( private evtModelService: EVTModelService, ) { diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 149bbefd9..6de87a7d9 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -50,8 +50,10 @@ "missingP": "missing", "omitted": "omitted", "prose": "Prose", - "proseWithVerseNumbers": "Prose with verse numbers", "verses": "Verses", + "option_prose": "Prose with verse numbers", + "option_verses": "Verses", + "option_prose_strict": "Plain text", "page": "Page {{value}}", "front": "Front", "mainText": "Main text", diff --git a/src/assets/i18n/it.json b/src/assets/i18n/it.json index ba891d95e..8a8be62af 100644 --- a/src/assets/i18n/it.json +++ b/src/assets/i18n/it.json @@ -49,8 +49,10 @@ "missingP": "mancanti", "omitted": "omissione", "prose": "Prosa", - "proseWithVerseNumbers": "Prosa con numeri dei versi", "verses": "Versi", + "option_prose": "Prose with verse numbers", + "option_verses": "Verses", + "option_prose_strict": "Plain text", "page": "Pagina {{value}}", "front": "Front", "mainText": "Testo principale",