From 5c7f126a6c16dede360da58847638cf378f350b1 Mon Sep 17 00:00:00 2001 From: davivcu Date: Thu, 8 Jun 2023 19:21:16 +0200 Subject: [PATCH 01/61] new component with basic style --- src/app/app.module.ts | 2 + .../apparatus-entry-detail.component.scss | 1 + .../apparatus-entry-readings.component.html | 4 +- .../apparatus-entry-readings.component.scss | 6 +++ .../critical-apparatus.component.html | 6 +++ .../critical-apparatus.component.scss | 0 .../critical-apparatus.component.spec.ts | 25 +++++++++++ .../critical-apparatus.component.ts | 45 +++++++++++++++++++ .../reading-text/reading-text.component.html | 5 ++- .../reading-text/reading-text.component.scss | 12 +++++ src/assets/i18n/en.json | 5 ++- src/assets/i18n/it.json | 5 ++- 12 files changed, 111 insertions(+), 5 deletions(-) create mode 100644 src/app/components/critical-apparatus/critical-apparatus.component.html create mode 100644 src/app/components/critical-apparatus/critical-apparatus.component.scss create mode 100644 src/app/components/critical-apparatus/critical-apparatus.component.spec.ts create mode 100644 src/app/components/critical-apparatus/critical-apparatus.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index a131051b3..da0a0e75a 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -120,6 +120,7 @@ import { TextSourcesComponent } from './view-modes/text-sources/text-sources.com import { TextTextComponent } from './view-modes/text-text/text-text.component'; import { TextVersionsComponent } from './view-modes/text-versions/text-versions.component'; import { HandleImgErrorDirective } from './directives/handle-img-error.directive'; +import { CriticalApparatusComponent } from './components/critical-apparatus/critical-apparatus.component'; const routes: Routes = [ ]; @@ -228,6 +229,7 @@ const DynamicComponents = [ WitnessPanelComponent, XmlBeautifyPipe, ...DynamicComponents, + CriticalApparatusComponent, ], imports: [ AppRoutingModule, diff --git a/src/app/components/apparatus-entry/apparatus-entry-detail/apparatus-entry-detail.component.scss b/src/app/components/apparatus-entry/apparatus-entry-detail/apparatus-entry-detail.component.scss index fa1d82dcf..660c4d769 100644 --- a/src/app/components/apparatus-entry/apparatus-entry-detail/apparatus-entry-detail.component.scss +++ b/src/app/components/apparatus-entry/apparatus-entry-detail/apparatus-entry-detail.component.scss @@ -4,6 +4,7 @@ top: -0.063rem; z-index: 0; border-radius: 0; + margin-bottom:0.5em; cursor: auto; @include themify($themes) { background-color: themed("appEntryBoxBackground"); diff --git a/src/app/components/apparatus-entry/apparatus-entry-readings/apparatus-entry-readings.component.html b/src/app/components/apparatus-entry/apparatus-entry-readings/apparatus-entry-readings.component.html index ae80f0966..6ec6cab4d 100644 --- a/src/app/components/apparatus-entry/apparatus-entry-readings/apparatus-entry-readings.component.html +++ b/src/app/components/apparatus-entry/apparatus-entry-readings/apparatus-entry-readings.component.html @@ -10,7 +10,7 @@ - {{ witID }} + {{ witID }} ] @@ -20,6 +20,6 @@ omit. - {{ wit }} + {{ wit }} \ No newline at end of file diff --git a/src/app/components/apparatus-entry/apparatus-entry-readings/apparatus-entry-readings.component.scss b/src/app/components/apparatus-entry/apparatus-entry-readings/apparatus-entry-readings.component.scss index 2b42b591a..de797ca71 100644 --- a/src/app/components/apparatus-entry/apparatus-entry-readings/apparatus-entry-readings.component.scss +++ b/src/app/components/apparatus-entry/apparatus-entry-readings/apparatus-entry-readings.component.scss @@ -2,4 +2,10 @@ display: inline-block; padding-right: 0.5rem; line-height: 1; +} + +.appa-witn { + font-size: 90%; + font-weight: 600; + font-family: serif; } \ No newline at end of file diff --git a/src/app/components/critical-apparatus/critical-apparatus.component.html b/src/app/components/critical-apparatus/critical-apparatus.component.html new file mode 100644 index 000000000..a03bd741a --- /dev/null +++ b/src/app/components/critical-apparatus/critical-apparatus.component.html @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/app/components/critical-apparatus/critical-apparatus.component.scss b/src/app/components/critical-apparatus/critical-apparatus.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/components/critical-apparatus/critical-apparatus.component.spec.ts b/src/app/components/critical-apparatus/critical-apparatus.component.spec.ts new file mode 100644 index 000000000..8ec02738e --- /dev/null +++ b/src/app/components/critical-apparatus/critical-apparatus.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CriticalApparatusComponent } from './critical-apparatus.component'; + +describe('CriticalApparatusComponent', () => { + let component: CriticalApparatusComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ CriticalApparatusComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(CriticalApparatusComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/critical-apparatus/critical-apparatus.component.ts b/src/app/components/critical-apparatus/critical-apparatus.component.ts new file mode 100644 index 000000000..45289c4f0 --- /dev/null +++ b/src/app/components/critical-apparatus/critical-apparatus.component.ts @@ -0,0 +1,45 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +import { Component, Input, OnInit } from '@angular/core'; +import { EVTModelService } from '../../services/evt-model.service'; +import { EVTStatusService } from '../../services/evt-status.service'; +import { map } from 'rxjs/operators'; + +@Component({ + selector: 'evt-critical-apparatus', + templateUrl: './critical-apparatus.component.html', + styleUrls: ['./critical-apparatus.component.scss'], +}) +export class CriticalApparatusComponent implements OnInit { + + @Input() pageID : string; + + public entries; + private appClasses = ['app']; + + public currentPage = this.evtStatusService.currentStatus$.pipe( + map(({ page }) => page.parsedContent), + map(x => x.map(y => y['content']).filter(y => y))); + + public apparatusInCurrentPage = this.currentPage.pipe( + map(x => x.map(y => y.map(z => this.appClasses.includes(z['class']) ? z : null).filter(z => z))), + map((x) => x.filter(x => { if (x.length !== 0) { return x } })), + ); + + public getEntries(data) { + this.entries = data.flat(); + } + + constructor( + public evtModelService: EVTModelService, + public evtStatusService: EVTStatusService, + ) {} + + ngOnInit() { + this.apparatusInCurrentPage.subscribe({ next: (data:any) => { this.getEntries(data) } }); + } + + stopPropagation(e: MouseEvent) { + e.stopPropagation(); + } + +} diff --git a/src/app/view-modes/reading-text/reading-text.component.html b/src/app/view-modes/reading-text/reading-text.component.html index 693762a31..d99a0102c 100644 --- a/src/app/view-modes/reading-text/reading-text.component.html +++ b/src/app/view-modes/reading-text/reading-text.component.html @@ -17,7 +17,10 @@
  • {{'CriticalApparatus' | translate}} -
    {{'CriticalApparatus' | translate}}
    + +
  • diff --git a/src/app/view-modes/reading-text/reading-text.component.scss b/src/app/view-modes/reading-text/reading-text.component.scss index 2eeaa2ce0..71aea374d 100644 --- a/src/app/view-modes/reading-text/reading-text.component.scss +++ b/src/app/view-modes/reading-text/reading-text.component.scss @@ -17,5 +17,17 @@ .tab-pane { padding: 1rem; } + + .nav { + font-family: serif; + --bs-nav-link-color: white; + --bs-nav-link-hover-color: white; + } + + .nav-tabs { + color: #ECEFF1; + background-color: #263238; + } + } } \ No newline at end of file diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 686e2c0f8..8b74610dc 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -172,5 +172,8 @@ "moreInfoAboutApp": "More info about the apparatus entry", "omit": "omit.", "wit": "Wit:", - "xml": "XML" + "xml": "XML", + "CriticalApparatus":"Critical Aparatus", + "Sources": "Sources", + "Analogues": "Analogues" } \ No newline at end of file diff --git a/src/assets/i18n/it.json b/src/assets/i18n/it.json index c599b88e2..c456994c7 100644 --- a/src/assets/i18n/it.json +++ b/src/assets/i18n/it.json @@ -171,5 +171,8 @@ "moreInfoAboutApp": "Maggiori informazioni per l'entrata d'apparato", "omit": "omit.", "wit": "Wit:", - "xml": "XML" + "xml": "XML", + "CriticalApparatus":"Apparato Critico", + "Sources": "Fonti", + "Analogues": "Passi Paralleli" } \ No newline at end of file From b8932690eafd7bb46da8211cffc038f021ba10c0 Mon Sep 17 00:00:00 2001 From: davivcu Date: Sat, 17 Jun 2023 18:00:33 +0200 Subject: [PATCH 02/61] optimazing code --- .../critical-apparatus/critical-apparatus.component.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/components/critical-apparatus/critical-apparatus.component.ts b/src/app/components/critical-apparatus/critical-apparatus.component.ts index 45289c4f0..0a54b840e 100644 --- a/src/app/components/critical-apparatus/critical-apparatus.component.ts +++ b/src/app/components/critical-apparatus/critical-apparatus.component.ts @@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { EVTModelService } from '../../services/evt-model.service'; import { EVTStatusService } from '../../services/evt-status.service'; -import { map } from 'rxjs/operators'; +import { filter, map } from 'rxjs/operators'; @Component({ selector: 'evt-critical-apparatus', @@ -18,14 +18,14 @@ export class CriticalApparatusComponent implements OnInit { public currentPage = this.evtStatusService.currentStatus$.pipe( map(({ page }) => page.parsedContent), - map(x => x.map(y => y['content']).filter(y => y))); + map((x) => x.map((y) => y['content']).filter((y) => y))); public apparatusInCurrentPage = this.currentPage.pipe( - map(x => x.map(y => y.map(z => this.appClasses.includes(z['class']) ? z : null).filter(z => z))), - map((x) => x.filter(x => { if (x.length !== 0) { return x } })), + map((x) => x.map((y) => y.map((z) => this.appClasses.includes(z.class) ? z : null).filter((z) => z))), + filter((x) => x.length !== 0), ); - public getEntries(data) { + public getEntries(data: any) { this.entries = data.flat(); } From 3e2ad13c169c00d8857adced856d7a31b86328d2 Mon Sep 17 00:00:00 2001 From: davivcu Date: Tue, 25 Jul 2023 14:40:36 +0200 Subject: [PATCH 03/61] quote parsing with listbibl, bibl and ref support --- src/app/models/evt-models.ts | 38 +++++++++- src/app/services/evt-model.service.ts | 9 ++- src/app/services/evt-status.service.ts | 14 ++++ src/app/services/xml-parsers/basic-parsers.ts | 64 +++++++++++++++- src/app/services/xml-parsers/index.ts | 4 + .../quote-entries-parser.service.ts | 18 +++++ src/app/services/xml-parsers/quotes-parser.ts | 74 +++++++++++++++++++ src/app/services/xml-parsers/xml-parsers.ts | 2 + 8 files changed, 217 insertions(+), 6 deletions(-) create mode 100644 src/app/services/xml-parsers/quote-entries-parser.service.ts create mode 100644 src/app/services/xml-parsers/quotes-parser.ts diff --git a/src/app/models/evt-models.ts b/src/app/models/evt-models.ts index 09dedca9a..e1ed772d7 100644 --- a/src/app/models/evt-models.ts +++ b/src/app/models/evt-models.ts @@ -170,6 +170,38 @@ export class ApparatusEntry extends GenericElement { nestedAppsIDs: string[]; } +export class QuoteEntry extends GenericElement { + id: string; + text: string; + //content: BibliographicEntry[] | BibliographicList; + ref: ParallelPassage[]; + originalEncoding: string; + //rend: string; +} + +export class BibliographicList extends GenericElement { + id: string; + head: string[]; + content: BibliographicEntry[]; +} + +export class BibliographicEntry extends GenericElement { + id: string; + author: string[]; + editor: string[]; + title: string[]; + date: string[]; + publisher: string[]; + pubPlace: string[]; + citedRange: string[]; +} + +export class ParallelPassage extends GenericElement { + id: string; + text: string; + content: BibliographicEntry[]; +} + export class Reading extends GenericElement { id: string; witIDs: string[]; @@ -450,13 +482,13 @@ export class MsItemStruct extends GenericElement { titles: Array>; // TODO: Add specific type when title is handled rubric: Rubric; incipit: Incipit; - quote: Array>; // TODO: Add specific type when quote is handled + quote: Array>; // TODO: Add specific type when quote is handled explicit: Explicit; finalRubric: FinalRubric; colophons: Array>; // TODO: Add specific type when colophon is handled decoNote: DecoNote; - listBibl: Array>; // TODO: Add specific type when listBibl is handled - bibl: Array>; // TODO: Add specific type when bibl is handled + listBibl: Array>; // TODO: Add specific type when listBibl is handled + bibl: Array>; // TODO: Add specific type when bibl is handled filiation: Filiation[]; noteEl: Note[]; textLangs: Array>; // TODO: Add specific type when textLang is handled diff --git a/src/app/services/evt-model.service.ts b/src/app/services/evt-model.service.ts index 8401a9fb8..2d86492fb 100644 --- a/src/app/services/evt-model.service.ts +++ b/src/app/services/evt-model.service.ts @@ -13,6 +13,7 @@ import { NamedEntitiesParserService } from './xml-parsers/named-entities-parser. import { PrefatoryMatterParserService } from './xml-parsers/prefatory-matter-parser.service'; import { StructureXmlParserService } from './xml-parsers/structure-xml-parser.service'; import { WitnessesParserService } from './xml-parsers/witnesses-parser.service'; +import { QuoteEntriesParserService } from './xml-parsers/quote-entries-parser.service'; @Injectable({ providedIn: 'root', @@ -143,6 +144,11 @@ export class EVTModelService { shareReplay(1), ); + public readonly quoteEntries$ = this.editionSource$.pipe( + map((source) => this.quoteParser.parseQuoteEntries(source)), + shareReplay(1), + ); + // FACSIMILE public readonly surfaces$ = this.editionSource$.pipe( map((source) => this.facsimileParser.parseSurfaces(source)), @@ -180,7 +186,7 @@ export class EVTModelService { public readonly msDesc$ = this.editionSource$.pipe( map((source) => this.msDescParser.parseMsDesc(source)), shareReplay(1), -); + ); constructor( private editionDataService: EditionDataService, @@ -193,6 +199,7 @@ export class EVTModelService { private characterDeclarationsParser: CharacterDeclarationsParserService, private linesVersesParser: LinesVersesParserService, private msDescParser: MsDescParserService, + private quoteParser: QuoteEntriesParserService, ) { } diff --git a/src/app/services/evt-status.service.ts b/src/app/services/evt-status.service.ts index 8409fc25f..ef96a4d10 100644 --- a/src/app/services/evt-status.service.ts +++ b/src/app/services/evt-status.service.ts @@ -131,6 +131,8 @@ export class EVTStatusService { public currentNamedEntityId$: BehaviorSubject = new BehaviorSubject(undefined); + public currentQuotedId$: BehaviorSubject = new BehaviorSubject(undefined); + constructor( private evtModelService: EVTModelService, private router: Router, @@ -179,6 +181,18 @@ export class EVTStatusService { params, }; } + + getPageElementsByClassList(classList) { + const pageContent = this.currentStatus$.pipe( + map(({ page }) => page.parsedContent), + map((x) => x.map((y) => y['content']).filter((y) => y))); + + return pageContent.pipe( + map((x) => x.map((y) => y.map((z) => classList.includes(z.class) ? z : null).filter((z) => z))), + filter((x) => x.length !== 0), + ); + } + } export interface AppStatus { diff --git a/src/app/services/xml-parsers/basic-parsers.ts b/src/app/services/xml-parsers/basic-parsers.ts index d21332ce2..2900a42ea 100644 --- a/src/app/services/xml-parsers/basic-parsers.ts +++ b/src/app/services/xml-parsers/basic-parsers.ts @@ -1,8 +1,8 @@ import { AttributesMap } from 'ng-dynamic-component'; import { ParserRegister, xmlParser } from '.'; import { - Addition, Attributes, Damage, Deletion, Gap, GenericElement, Lb, Note, NoteLayout, - Paragraph, PlacementType, Ptr, Supplied, Term, Text, Verse, VersesGroup, Word, XMLElement, + Addition, Attributes, BibliographicEntry, BibliographicList, Damage, Deletion, Gap, GenericElement, Lb, Note, NoteLayout, + Paragraph, ParallelPassage, PlacementType, Ptr, Supplied, Term, Text, Verse, VersesGroup, Word, XMLElement, } from '../../models/evt-models'; import { isNestedInElem, xpath } from '../../utils/dom-utils'; import { replaceMultispaces } from '../../utils/xml-utils'; @@ -329,3 +329,63 @@ export class TermParser extends GenericElemParser implements Parser }; } } + +export class BiblParser extends GenericElemParser { + protected getTrimmedText = function(s) { + return s.textContent.replace(/[\n\r]+|[\s]{2,}/g, ' ').trim(); + } + protected getChildrenByName = function(xml : XMLElement, name : string) { + return Array.from(xml.querySelectorAll(name)).map((x) => this.getTrimmedText(x)); + } +} + +export class ListBiblParser extends GenericElemParser { + protected biblParser = createParser(BibliographyParser, this.genericParse); +} + +@xmlParser('bibl', BibliographyParser) +export class BibliographyParser extends BiblParser implements Parser { + parse(xml: XMLElement): BibliographicEntry { + return { + type: BibliographicEntry, + id: getID(xml), + attributes: this.attributeParser.parse(xml), + title: this.getChildrenByName(xml,'title'), + author: this.getChildrenByName(xml,'author'), + editor: this.getChildrenByName(xml,'editor'), + date: this.getChildrenByName(xml,'date'), + publisher: this.getChildrenByName(xml,'publisher'), + pubPlace: this.getChildrenByName(xml,'pubBlace'), + citedRange: this.getChildrenByName(xml,'citedRange'), + content: [], + //content: parseChildren(xml, this.genericParse), + }; + } +} + +@xmlParser('listBibl', BibliographyListParser) +export class BibliographyListParser extends ListBiblParser implements Parser { + parse(xml: XMLElement): BibliographicList { + return { + type: BibliographicList, + id: getID(xml), + attributes: this.attributeParser.parse(xml), + head: Array.from(xml.querySelectorAll('head')).map((x) => x.textContent), + content: Array.from(xml.querySelectorAll('bibl')).map((x) => this.biblParser.parse(x)), + }; + } +} + + +@xmlParser('ref', ParallelPassageParser) +export class ParallelPassageParser extends ListBiblParser implements Parser { + parse(xml: XMLElement): ParallelPassage { + return { + type: ParallelPassage, + id: getID(xml), + attributes: this.attributeParser.parse(xml), + text: (xml.firstChild) ? xml.firstChild.nodeValue : '', + content: Array.from(xml.querySelectorAll('bibl')).map((x) => this.biblParser.parse(x)), + }; + } +} \ No newline at end of file diff --git a/src/app/services/xml-parsers/index.ts b/src/app/services/xml-parsers/index.ts index 058dd84f8..e6c72e4c1 100644 --- a/src/app/services/xml-parsers/index.ts +++ b/src/app/services/xml-parsers/index.ts @@ -31,6 +31,10 @@ export class ParserRegister { if (crit.includes(tagName)) { return 'evt-apparatus-entry-parser'; } + const quote = ['quote']; //todo: config? + if (quote.includes(tagName)) { + return 'evt-quote-entry-parser'; + } if (!Object.keys(ParserRegister.PARSER_MAP).includes(tagName)) { return 'evt-generic-elem-parser'; diff --git a/src/app/services/xml-parsers/quote-entries-parser.service.ts b/src/app/services/xml-parsers/quote-entries-parser.service.ts new file mode 100644 index 000000000..b5bb0c88c --- /dev/null +++ b/src/app/services/xml-parsers/quote-entries-parser.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import { ParserRegister } from '.'; +import { QuoteEntry, XMLElement } from '../../models/evt-models'; + +@Injectable({ + providedIn: 'root', +}) +export class QuoteEntriesParserService { + private quoteEntryTagName = 'quote'; + + public parseQuoteEntries(document: XMLElement) { + const quoteParser = ParserRegister.get('evt-quote-entry-parser'); + + return Array.from(document.querySelectorAll(this.quoteEntryTagName)) + .map((quoteEntry) => quoteParser.parse(quoteEntry) as QuoteEntry); + } + +} diff --git a/src/app/services/xml-parsers/quotes-parser.ts b/src/app/services/xml-parsers/quotes-parser.ts new file mode 100644 index 000000000..0512d5f39 --- /dev/null +++ b/src/app/services/xml-parsers/quotes-parser.ts @@ -0,0 +1,74 @@ +import { xmlParser } from '.'; +import { ParallelPassage, QuoteEntry, XMLElement } from '../../models/evt-models'; +import { AttributeParser, BibliographyListParser, BibliographyParser, EmptyParser, ParallelPassageParser } from './basic-parsers'; +import { createParser, getID, Parser } from './parser-models'; +import { getOuterHTML } from 'src/app/utils/dom-utils'; + +@xmlParser('evt-quote-entry-parser', QuoteParser) +export class QuoteParser extends EmptyParser implements Parser { + + attributeParser = createParser(AttributeParser, this.genericParse); + biblParser = createParser(BibliographyParser, this.genericParse); + listBiblParser = createParser(BibliographyListParser, this.genericParse); + parallelPassageParser = createParser(ParallelPassageParser, this.genericParse); + + public parse(quoteEntry: XMLElement): QuoteEntry { + return { + type: QuoteEntry, + id: getID(quoteEntry), + attributes: this.attributeParser.parse(quoteEntry), + text: this.getFirstChildText(quoteEntry), + content: this.getSources(quoteEntry), + ref: this.getParallelPassages(quoteEntry), + class: quoteEntry.tagName.toLowerCase(), + originalEncoding: getOuterHTML(quoteEntry), + }; + } + + /** + * Significant text can be split inside two or more text evt-element, especially if contains new line characters. + * This function returns a string with all the text element chained + * @param n XMLElement + * @returns string + */ + private getFirstChildText(n: XMLElement): string { + const evtTextElement = '#text'; + let out = ''; + n.childNodes.forEach((x) => (x.nodeName === evtTextElement) ? out += x.nodeValue : '') + + return out; + } + + /** + * Retrieve and send to parsing all Bibliography elements inside this quote element + * @param quote XMLElement + * @returns array of Bibliography Element or a single Bibliography List element + */ + private getSources(quote: XMLElement): any { + const bibl = ['bibl']; + const biblList = ['listBibl']; + + return Array.from(quote.children) + .map((x: XMLElement) => bibl.includes(x['tagName']) ? this.biblParser.parse(x) : + (biblList.includes(x['tagName']) ? this.listBiblParser.parse(x) : null )) + .filter((x) => x); + } + + + /** + * Retrieve all with a specific type attribute inside this quote element + * @param quote XMLElement + * @returns array of parallel passage elements + */ + private getParallelPassages(quote: XMLElement): ParallelPassage[] { + const classList = ['ref']; // tutti i ref con type = 'parallelPassage' + const parallelPassageType = 'parallelPassage'; + + return Array.from(quote.children) + .map((x: XMLElement) => ((classList.includes(x['tagName'])) && + (x['attributes'].getNamedItem('type').nodeValue === parallelPassageType)) ? this.parallelPassageParser.parse(x) : null) + .filter((x) => x); + } + + +} diff --git a/src/app/services/xml-parsers/xml-parsers.ts b/src/app/services/xml-parsers/xml-parsers.ts index d00b1bddf..5f5e154ce 100644 --- a/src/app/services/xml-parsers/xml-parsers.ts +++ b/src/app/services/xml-parsers/xml-parsers.ts @@ -38,6 +38,7 @@ import { NamedEntitiesListParser, NamedEntityRefParser, OrganizationParser, PersonGroupParser, PersonParser, PlaceParser, RelationParser, } from './named-entity-parsers'; +import { QuoteParser } from './quotes-parser'; // eslint-disable-next-line @typescript-eslint/no-explicit-any export function ParsersDecl(declarations: Array>) { @@ -165,6 +166,7 @@ export function ParsersDecl(declarations: Array>) { PublicationStmtParser, PunctuationParser, PurposeParser, + QuoteParser, QuotationParser, RdgParser, RecordHistParser, From ba1d0006eec8f4eb089d4377e891aa98b1254b60 Mon Sep 17 00:00:00 2001 From: davivcu Date: Tue, 25 Jul 2023 17:17:05 +0200 Subject: [PATCH 04/61] added sources attribute for quote, listBibl and parallelPassage --- src/app/models/evt-models.ts | 6 +++--- src/app/services/xml-parsers/basic-parsers.ts | 6 ++++-- src/app/services/xml-parsers/quotes-parser.ts | 5 +++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/app/models/evt-models.ts b/src/app/models/evt-models.ts index e1ed772d7..f5482256b 100644 --- a/src/app/models/evt-models.ts +++ b/src/app/models/evt-models.ts @@ -173,7 +173,7 @@ export class ApparatusEntry extends GenericElement { export class QuoteEntry extends GenericElement { id: string; text: string; - //content: BibliographicEntry[] | BibliographicList; + sources: BibliographicEntry[]|BibliographicList; ref: ParallelPassage[]; originalEncoding: string; //rend: string; @@ -182,7 +182,7 @@ export class QuoteEntry extends GenericElement { export class BibliographicList extends GenericElement { id: string; head: string[]; - content: BibliographicEntry[]; + sources: BibliographicEntry[]; } export class BibliographicEntry extends GenericElement { @@ -199,7 +199,7 @@ export class BibliographicEntry extends GenericElement { export class ParallelPassage extends GenericElement { id: string; text: string; - content: BibliographicEntry[]; + sources: BibliographicEntry[]; } export class Reading extends GenericElement { diff --git a/src/app/services/xml-parsers/basic-parsers.ts b/src/app/services/xml-parsers/basic-parsers.ts index 2900a42ea..03e81ee6c 100644 --- a/src/app/services/xml-parsers/basic-parsers.ts +++ b/src/app/services/xml-parsers/basic-parsers.ts @@ -371,7 +371,8 @@ export class BibliographyListParser extends ListBiblParser implements Parser('head')).map((x) => x.textContent), - content: Array.from(xml.querySelectorAll('bibl')).map((x) => this.biblParser.parse(x)), + content: parseChildren(xml, this.genericParse), + sources: Array.from(xml.querySelectorAll('bibl')).map((x) => this.biblParser.parse(x)), }; } } @@ -385,7 +386,8 @@ export class ParallelPassageParser extends ListBiblParser implements Parser('bibl')).map((x) => this.biblParser.parse(x)), + content: parseChildren(xml, this.genericParse), + sources: Array.from(xml.querySelectorAll('bibl')).map((x) => this.biblParser.parse(x)), }; } } \ No newline at end of file diff --git a/src/app/services/xml-parsers/quotes-parser.ts b/src/app/services/xml-parsers/quotes-parser.ts index 0512d5f39..85bd6675c 100644 --- a/src/app/services/xml-parsers/quotes-parser.ts +++ b/src/app/services/xml-parsers/quotes-parser.ts @@ -1,7 +1,7 @@ import { xmlParser } from '.'; import { ParallelPassage, QuoteEntry, XMLElement } from '../../models/evt-models'; import { AttributeParser, BibliographyListParser, BibliographyParser, EmptyParser, ParallelPassageParser } from './basic-parsers'; -import { createParser, getID, Parser } from './parser-models'; +import { createParser, getID, parseChildren, Parser } from './parser-models'; import { getOuterHTML } from 'src/app/utils/dom-utils'; @xmlParser('evt-quote-entry-parser', QuoteParser) @@ -18,7 +18,8 @@ export class QuoteParser extends EmptyParser implements Parser { id: getID(quoteEntry), attributes: this.attributeParser.parse(quoteEntry), text: this.getFirstChildText(quoteEntry), - content: this.getSources(quoteEntry), + content: parseChildren(quoteEntry, this.genericParse), + sources: this.getSources(quoteEntry), ref: this.getParallelPassages(quoteEntry), class: quoteEntry.tagName.toLowerCase(), originalEncoding: getOuterHTML(quoteEntry), From 40f3e703dfd2abeed42b69ab53366e3cb7425777 Mon Sep 17 00:00:00 2001 From: davivcu Date: Wed, 26 Jul 2023 06:56:21 +0200 Subject: [PATCH 05/61] optimazing code in critical apparatus component --- .../critical-apparatus.component.ts | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/app/components/critical-apparatus/critical-apparatus.component.ts b/src/app/components/critical-apparatus/critical-apparatus.component.ts index 0a54b840e..07a032ae0 100644 --- a/src/app/components/critical-apparatus/critical-apparatus.component.ts +++ b/src/app/components/critical-apparatus/critical-apparatus.component.ts @@ -1,8 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { Component, Input, OnInit } from '@angular/core'; -import { EVTModelService } from '../../services/evt-model.service'; import { EVTStatusService } from '../../services/evt-status.service'; -import { filter, map } from 'rxjs/operators'; @Component({ selector: 'evt-critical-apparatus', @@ -16,21 +14,13 @@ export class CriticalApparatusComponent implements OnInit { public entries; private appClasses = ['app']; - public currentPage = this.evtStatusService.currentStatus$.pipe( - map(({ page }) => page.parsedContent), - map((x) => x.map((y) => y['content']).filter((y) => y))); - - public apparatusInCurrentPage = this.currentPage.pipe( - map((x) => x.map((y) => y.map((z) => this.appClasses.includes(z.class) ? z : null).filter((z) => z))), - filter((x) => x.length !== 0), - ); + public apparatusInCurrentPage = this.evtStatusService.getPageElementsByClassList(this.appClasses) public getEntries(data: any) { this.entries = data.flat(); } constructor( - public evtModelService: EVTModelService, public evtStatusService: EVTStatusService, ) {} From 5060fcb2dfead1a28300af1b566607f2e92631f4 Mon Sep 17 00:00:00 2001 From: davivcu Date: Wed, 26 Jul 2023 06:57:44 +0200 Subject: [PATCH 06/61] style fixes --- .../apparatus-entry-detail.component.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/components/apparatus-entry/apparatus-entry-detail/apparatus-entry-detail.component.scss b/src/app/components/apparatus-entry/apparatus-entry-detail/apparatus-entry-detail.component.scss index 660c4d769..af15be21a 100644 --- a/src/app/components/apparatus-entry/apparatus-entry-detail/apparatus-entry-detail.component.scss +++ b/src/app/components/apparatus-entry/apparatus-entry-detail/apparatus-entry-detail.component.scss @@ -15,12 +15,14 @@ .app-detail-tabs { background-color: transparent; font-size: 1.063rem; + font-family: Junicode, Times, serif; } .app-detail-content { display: flex; justify-content: space-between; padding: 0.313rem; + background-color: #2042512e; } .app-detail-readings { From 482284da92a0d12cfb912970eaa25383a4759d28 Mon Sep 17 00:00:00 2001 From: davivcu Date: Wed, 26 Jul 2023 10:13:33 +0200 Subject: [PATCH 07/61] quote-entry-component with sources and biblio sub-components, translations --- src/app/app.module.ts | 4 + .../components/biblio/biblio.component.html | 9 ++ .../components/biblio/biblio.component.scss | 0 .../biblio/biblio.component.spec.ts | 25 ++++ src/app/components/biblio/biblio.component.ts | 22 +++ .../quote-entry/quote-entry.component.html | 7 + .../quote-entry/quote-entry.component.scss | 18 +++ .../quote-entry/quote-entry.component.spec.ts | 25 ++++ .../quote-entry/quote-entry.component.ts | 39 +++++ .../components/sources/sources.component.html | 62 ++++++++ .../components/sources/sources.component.scss | 134 ++++++++++++++++++ .../sources/sources.component.spec.ts | 25 ++++ .../components/sources/sources.component.ts | 31 ++++ src/app/models/evt-models.ts | 1 + src/app/services/xml-parsers/basic-parsers.ts | 6 +- src/app/services/xml-parsers/quotes-parser.ts | 13 +- .../reading-text/reading-text.component.html | 18 ++- src/assets/i18n/en.json | 6 +- src/assets/i18n/it.json | 6 +- 19 files changed, 440 insertions(+), 11 deletions(-) create mode 100644 src/app/components/biblio/biblio.component.html create mode 100644 src/app/components/biblio/biblio.component.scss create mode 100644 src/app/components/biblio/biblio.component.spec.ts create mode 100644 src/app/components/biblio/biblio.component.ts create mode 100644 src/app/components/quote-entry/quote-entry.component.html create mode 100644 src/app/components/quote-entry/quote-entry.component.scss create mode 100644 src/app/components/quote-entry/quote-entry.component.spec.ts create mode 100644 src/app/components/quote-entry/quote-entry.component.ts create mode 100644 src/app/components/sources/sources.component.html create mode 100644 src/app/components/sources/sources.component.scss create mode 100644 src/app/components/sources/sources.component.spec.ts create mode 100644 src/app/components/sources/sources.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index da0a0e75a..adf62a32e 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -121,6 +121,8 @@ import { TextTextComponent } from './view-modes/text-text/text-text.component'; import { TextVersionsComponent } from './view-modes/text-versions/text-versions.component'; import { HandleImgErrorDirective } from './directives/handle-img-error.directive'; import { CriticalApparatusComponent } from './components/critical-apparatus/critical-apparatus.component'; +import { SourcesComponent } from './components/sources/sources.component'; +import { QuoteEntryComponent } from './components/quote-entry/quote-entry.component'; const routes: Routes = [ ]; @@ -230,6 +232,8 @@ const DynamicComponents = [ XmlBeautifyPipe, ...DynamicComponents, CriticalApparatusComponent, + SourcesComponent, + QuoteEntryComponent, ], imports: [ AppRoutingModule, diff --git a/src/app/components/biblio/biblio.component.html b/src/app/components/biblio/biblio.component.html new file mode 100644 index 000000000..9bfbbe3ad --- /dev/null +++ b/src/app/components/biblio/biblio.component.html @@ -0,0 +1,9 @@ + + + + {{element.value}}: + {{data[element.value]}} +
    +
    +
    +
    \ No newline at end of file diff --git a/src/app/components/biblio/biblio.component.scss b/src/app/components/biblio/biblio.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/components/biblio/biblio.component.spec.ts b/src/app/components/biblio/biblio.component.spec.ts new file mode 100644 index 000000000..b645f0667 --- /dev/null +++ b/src/app/components/biblio/biblio.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BiblioEntryComponent } from './biblio.component'; + +describe('BiblioComponent', () => { + let component: BiblioEntryComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ BiblioEntryComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(BiblioEntryComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/biblio/biblio.component.ts b/src/app/components/biblio/biblio.component.ts new file mode 100644 index 000000000..abf26e9bc --- /dev/null +++ b/src/app/components/biblio/biblio.component.ts @@ -0,0 +1,22 @@ +import { Component, Input, OnInit } from '@angular/core'; + +@Component({ + selector: 'evt-biblio-entry', + templateUrl: './biblio.component.html', + styleUrls: ['./biblio.component.scss'], +}) +export class BiblioEntryComponent implements OnInit { + + @Input() data; + + public showList = ['author','title','date','editor','publisher','pubPlace', 'citedRange']; + public showAttrNames = false; + public showEmptyValues = false; + public inline = true; + + ngOnInit() { + console.log(this.data); + } + +} + diff --git a/src/app/components/quote-entry/quote-entry.component.html b/src/app/components/quote-entry/quote-entry.component.html new file mode 100644 index 000000000..c9636757e --- /dev/null +++ b/src/app/components/quote-entry/quote-entry.component.html @@ -0,0 +1,7 @@ + + {{data.text}} + \ No newline at end of file diff --git a/src/app/components/quote-entry/quote-entry.component.scss b/src/app/components/quote-entry/quote-entry.component.scss new file mode 100644 index 000000000..b047ad06e --- /dev/null +++ b/src/app/components/quote-entry/quote-entry.component.scss @@ -0,0 +1,18 @@ +@import "../../../assets/scss/colors"; +@import "../../../assets/scss/themes"; +@import "../../../assets/scss/mixins"; + +.quote { + font-style: italic; + font-size: 104%; + padding:0; +} + +.quote.opened { + color: #004ec3; +} + +.quote:hover { + background-color:#2632383b; + cursor: pointer; +} \ No newline at end of file diff --git a/src/app/components/quote-entry/quote-entry.component.spec.ts b/src/app/components/quote-entry/quote-entry.component.spec.ts new file mode 100644 index 000000000..0c3058bf3 --- /dev/null +++ b/src/app/components/quote-entry/quote-entry.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; + +import { QuoteEntryComponent } from './quote-entry.component'; + +describe('QuoteEntryComponent', () => { + let component: QuoteEntryComponent; + let fixture: ComponentFixture; + + beforeEach(waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [ QuoteEntryComponent ], + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(QuoteEntryComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/quote-entry/quote-entry.component.ts b/src/app/components/quote-entry/quote-entry.component.ts new file mode 100644 index 000000000..54e3a3812 --- /dev/null +++ b/src/app/components/quote-entry/quote-entry.component.ts @@ -0,0 +1,39 @@ +import { Component, Input } from '@angular/core'; +import { combineLatest, Subject } from 'rxjs'; +import { map, scan, startWith } from 'rxjs/operators'; + +import { QuoteEntry } from '../../models/evt-models'; +import { register } from '../../services/component-register.service'; +import { EVTStatusService } from '../../services/evt-status.service'; +import { EditionlevelSusceptible, Highlightable, TextFlowSusceptible } from '../components-mixins'; + +export interface QuoteEntryComponent extends EditionlevelSusceptible, Highlightable, TextFlowSusceptible { } + +@Component({ + selector: 'evt-quote-entry', + templateUrl: './quote-entry.component.html', + styleUrls: ['./quote-entry.component.scss'], +}) +@register(QuoteEntry) +export class QuoteEntryComponent { + @Input() data: QuoteEntry; + + toggleOpened$ = new Subject(); + opened$ = this.toggleOpened$.pipe( + scan((currentState: boolean, val: boolean | undefined) => val === undefined ? !currentState : val, false), + startWith(false), + ); + + quoteHighlight$ = combineLatest([ + this.opened$, + this.evtStatusService.currentQuotedId$, + ]).pipe( + map(([opened, currentId]) => currentId === this.data.id && !opened), + ); + + constructor( + public evtStatusService: EVTStatusService, + ) { + } + +} diff --git a/src/app/components/sources/sources.component.html b/src/app/components/sources/sources.component.html new file mode 100644 index 000000000..68bab3694 --- /dev/null +++ b/src/app/components/sources/sources.component.html @@ -0,0 +1,62 @@ + + +
    + +
    + + + {{source.text}} +
    + + + +
    + +
    + diff --git a/src/app/components/sources/sources.component.scss b/src/app/components/sources/sources.component.scss new file mode 100644 index 000000000..1165c8f6b --- /dev/null +++ b/src/app/components/sources/sources.component.scss @@ -0,0 +1,134 @@ +@import "../../../assets/scss/themes"; + +.source-container { + border: 1px solid #8080804f; + padding: 0.3em; + margin: 0.5em 0.5em 1em 0.5em; + font-family: serif; + font-style: italic; + font-size: 100%; + box-shadow: 1px 1px 1px rgba(0,0,0,0.1); + background-color:#2042512e; + border-radius:2px; +} + +.source-detail-content { + display: block !important; + padding: 0 !important; + background-color: unset !important; +} + +.source-quote-button { + float:right; + margin-right:0.5em; +} + +.source-quote-symbol { + font-size: 1em; + color: #263238; + margin: 0; + padding: 0 0.3em 0 0; + display: inline; + font-family: 'evt-icons' !important; + speak: none; + font-style: normal; + font-feature-settings: normal; + font-variant: normal; + text-transform: none; + line-height: 0; + -webkit-font-smoothing: antialiased; + vertical-align: super; +} + +.sources-cat { + font-variant: small-caps; + font-size: 95%; + position: relative; + font-style: normal; +} + +.source-detail-btn { + background-color: transparent; + color: #000000; + line-height: 1; + padding: 0.25rem 0.375rem; + cursor: pointer; + border-radius: 0; + font-style:normal; +} + +.app-detail-content, +.app-detail-tabs { + background-color: transparent; + font-size: 1rem; +} + +.app-detail-content { + display: flex; + justify-content: space-between; + padding: 0.313rem; + background-color: #8080802e; +} + + +.app-detail-tabs { + font-size: 1rem; + margin: 0 0.313rem 0 0.313rem; + padding: 0.313rem 0 0 0; + .nav-link { + background-color: transparent; + color: #000000; + line-height: 1; + padding: 0.25rem 0.375rem; + cursor: pointer; + border-radius: 0; + &.active { + color: #000000; + } + } + .nav-pills, + .tab-content { + margin-right: -0.313rem; + margin-left: -0.313rem; + } + .nav-link.active, + .tab-content { + @include themify($themes) { + background-color: themed("appEntryBoxActiveTabBg"); + } + } + .tab-content { + max-height: 12.5rem; + overflow: auto; + .info-lemma-wrapper { + @include themify($themes) { + border-bottom: 1px solid themed("baseBorder"); + } + padding-bottom: 0.438rem; + margin-bottom: 0.625rem; + } + .info-rdg { + font-style: italic; + font-weight: 600; + font-size: 1.063rem; + } + .info-label { + font-size: 0.813rem; + text-transform: uppercase; + font-weight: 600; + } + .more-info-label { + display: block; + font-size: 0.813rem; + font-weight: 600; + text-transform: uppercase; + margin-bottom: 0.25rem; + } + pre { + white-space: pre-wrap; + font-size: 75%; + margin-bottom: 0; + margin-top: -1rem; + } + } +} diff --git a/src/app/components/sources/sources.component.spec.ts b/src/app/components/sources/sources.component.spec.ts new file mode 100644 index 000000000..56ba944e3 --- /dev/null +++ b/src/app/components/sources/sources.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SourcesComponent } from './sources.component'; + +describe('SourcesComponent', () => { + let component: SourcesComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ SourcesComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(SourcesComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/sources/sources.component.ts b/src/app/components/sources/sources.component.ts new file mode 100644 index 000000000..9849b0584 --- /dev/null +++ b/src/app/components/sources/sources.component.ts @@ -0,0 +1,31 @@ +import { Component, Input, OnInit } from '@angular/core'; +import { EVTStatusService } from 'src/app/services/evt-status.service'; + +@Component({ + selector: 'evt-sources', + templateUrl: './sources.component.html', + styleUrls: ['./sources.component.scss'], +}) +export class SourcesComponent implements OnInit { + + @Input() pageID : string; + + public entries; + private appClasses = ['quote']; //todo: config? + + public quotesInCurrentPage = this.evtStatusService.getPageElementsByClassList(this.appClasses) + + public getEntries(data) { + this.entries = data.flat(); + console.log(this.entries); + } + + constructor( + public evtStatusService: EVTStatusService, + ) {} + + ngOnInit() { + this.quotesInCurrentPage.subscribe({ next: (data) => { this.getEntries(data) } }); + } + +} diff --git a/src/app/models/evt-models.ts b/src/app/models/evt-models.ts index f5482256b..cfa04cced 100644 --- a/src/app/models/evt-models.ts +++ b/src/app/models/evt-models.ts @@ -200,6 +200,7 @@ export class ParallelPassage extends GenericElement { id: string; text: string; sources: BibliographicEntry[]; + originalEncoding: string; } export class Reading extends GenericElement { diff --git a/src/app/services/xml-parsers/basic-parsers.ts b/src/app/services/xml-parsers/basic-parsers.ts index 03e81ee6c..0b1edb967 100644 --- a/src/app/services/xml-parsers/basic-parsers.ts +++ b/src/app/services/xml-parsers/basic-parsers.ts @@ -4,7 +4,7 @@ import { Addition, Attributes, BibliographicEntry, BibliographicList, Damage, Deletion, Gap, GenericElement, Lb, Note, NoteLayout, Paragraph, ParallelPassage, PlacementType, Ptr, Supplied, Term, Text, Verse, VersesGroup, Word, XMLElement, } from '../../models/evt-models'; -import { isNestedInElem, xpath } from '../../utils/dom-utils'; +import { getOuterHTML, isNestedInElem, xpath } from '../../utils/dom-utils'; import { replaceMultispaces } from '../../utils/xml-utils'; import { createParser, getClass, getDefaultN, getID, parseChildren, ParseFn, Parser } from './parser-models'; @@ -337,6 +337,9 @@ export class BiblParser extends GenericElemParser { protected getChildrenByName = function(xml : XMLElement, name : string) { return Array.from(xml.querySelectorAll(name)).map((x) => this.getTrimmedText(x)); } + protected getChildrenByNameOnFirstLevelOnly = function(xml : XMLElement, name : string) { + return Array.from(xml.querySelectorAll(':scope > '+name)).map((x) => this.getTrimmedText(x)); + } } export class ListBiblParser extends GenericElemParser { @@ -388,6 +391,7 @@ export class ParallelPassageParser extends ListBiblParser implements Parser('bibl')).map((x) => this.biblParser.parse(x)), + originalEncoding: getOuterHTML(xml), }; } } \ No newline at end of file diff --git a/src/app/services/xml-parsers/quotes-parser.ts b/src/app/services/xml-parsers/quotes-parser.ts index 85bd6675c..10996adb4 100644 --- a/src/app/services/xml-parsers/quotes-parser.ts +++ b/src/app/services/xml-parsers/quotes-parser.ts @@ -17,7 +17,7 @@ export class QuoteParser extends EmptyParser implements Parser { type: QuoteEntry, id: getID(quoteEntry), attributes: this.attributeParser.parse(quoteEntry), - text: this.getFirstChildText(quoteEntry), + text: this.chainFirstChildTexts(quoteEntry), content: parseChildren(quoteEntry, this.genericParse), sources: this.getSources(quoteEntry), ref: this.getParallelPassages(quoteEntry), @@ -32,7 +32,7 @@ export class QuoteParser extends EmptyParser implements Parser { * @param n XMLElement * @returns string */ - private getFirstChildText(n: XMLElement): string { + private chainFirstChildTexts(n: XMLElement): string { const evtTextElement = '#text'; let out = ''; n.childNodes.forEach((x) => (x.nodeName === evtTextElement) ? out += x.nodeValue : '') @@ -50,8 +50,8 @@ export class QuoteParser extends EmptyParser implements Parser { const biblList = ['listBibl']; return Array.from(quote.children) - .map((x: XMLElement) => bibl.includes(x['tagName']) ? this.biblParser.parse(x) : - (biblList.includes(x['tagName']) ? this.listBiblParser.parse(x) : null )) + .map((x: XMLElement) => bibl.includes(x['tagName']) ? this.biblParser.parse(x) : ( + biblList.includes(x['tagName']) ? this.listBiblParser.parse(x) : null)) .filter((x) => x); } @@ -66,8 +66,9 @@ export class QuoteParser extends EmptyParser implements Parser { const parallelPassageType = 'parallelPassage'; return Array.from(quote.children) - .map((x: XMLElement) => ((classList.includes(x['tagName'])) && - (x['attributes'].getNamedItem('type').nodeValue === parallelPassageType)) ? this.parallelPassageParser.parse(x) : null) + .map((x: XMLElement) => ( + (classList.includes(x['tagName'])) && (x['attributes'].getNamedItem('type').nodeValue === parallelPassageType) + ) ? this.parallelPassageParser.parse(x) : null) .filter((x) => x); } diff --git a/src/app/view-modes/reading-text/reading-text.component.html b/src/app/view-modes/reading-text/reading-text.component.html index d99a0102c..3945eff80 100644 --- a/src/app/view-modes/reading-text/reading-text.component.html +++ b/src/app/view-modes/reading-text/reading-text.component.html @@ -26,13 +26,27 @@
  • {{ 'Sources' | translate }} -
    {{ 'Sources' | translate }}
    + +
  • {{ 'Analogues' | translate }} -
    {{ 'Analogues' | translate }}
    + +
    +
  • +
  • + {{ 'Notes' | translate }} + +
  • diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 8b74610dc..abac21bc2 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -175,5 +175,9 @@ "xml": "XML", "CriticalApparatus":"Critical Aparatus", "Sources": "Sources", - "Analogues": "Analogues" + "Analogues": "Analogues", + "Notes":"Notes", + "refBibl": "Bibliographic references", + "QuotedSources": "Quoted sources", + "References": "References" } \ No newline at end of file diff --git a/src/assets/i18n/it.json b/src/assets/i18n/it.json index c456994c7..bf5ccc26d 100644 --- a/src/assets/i18n/it.json +++ b/src/assets/i18n/it.json @@ -174,5 +174,9 @@ "xml": "XML", "CriticalApparatus":"Apparato Critico", "Sources": "Fonti", - "Analogues": "Passi Paralleli" + "Analogues": "Passi Paralleli", + "Notes":"Note Critiche", + "refBibl": "Riferimenti Bibliografici", + "QuotedSources": "Fonti citate", + "References": "Riferimenti" } \ No newline at end of file From 978d29299e42729ff6ac8fd18b8de7a2f03c9e51 Mon Sep 17 00:00:00 2001 From: davivcu Date: Wed, 26 Jul 2023 10:15:23 +0200 Subject: [PATCH 08/61] including biblio component --- src/app/app.module.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/app.module.ts b/src/app/app.module.ts index adf62a32e..3a6f9a2aa 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -123,6 +123,7 @@ import { HandleImgErrorDirective } from './directives/handle-img-error.directive import { CriticalApparatusComponent } from './components/critical-apparatus/critical-apparatus.component'; import { SourcesComponent } from './components/sources/sources.component'; import { QuoteEntryComponent } from './components/quote-entry/quote-entry.component'; +import { BiblioEntryComponent } from './components/biblio/biblio.component'; const routes: Routes = [ ]; @@ -234,6 +235,7 @@ const DynamicComponents = [ CriticalApparatusComponent, SourcesComponent, QuoteEntryComponent, + BiblioEntryComponent, ], imports: [ AppRoutingModule, From 05dcebc87bffd29184de443c3bd7dbcc6b0b056f Mon Sep 17 00:00:00 2001 From: davivcu Date: Wed, 26 Jul 2023 10:31:51 +0200 Subject: [PATCH 09/61] fix tab borders --- src/app/components/sources/sources.component.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/components/sources/sources.component.scss b/src/app/components/sources/sources.component.scss index 1165c8f6b..5cb98ec11 100644 --- a/src/app/components/sources/sources.component.scss +++ b/src/app/components/sources/sources.component.scss @@ -88,8 +88,8 @@ } .nav-pills, .tab-content { - margin-right: -0.313rem; - margin-left: -0.313rem; + margin-right: 0rem; + margin-left: 0rem; } .nav-link.active, .tab-content { From 68bc78361b6ff750919f2ced0f5d22f988a8808a Mon Sep 17 00:00:00 2001 From: davivcu Date: Wed, 26 Jul 2023 11:02:27 +0200 Subject: [PATCH 10/61] adjusting sources style --- src/app/components/sources/sources.component.scss | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/components/sources/sources.component.scss b/src/app/components/sources/sources.component.scss index 5cb98ec11..d40286102 100644 --- a/src/app/components/sources/sources.component.scss +++ b/src/app/components/sources/sources.component.scss @@ -2,7 +2,7 @@ .source-container { border: 1px solid #8080804f; - padding: 0.3em; + padding: 0em; margin: 0.5em 0.5em 1em 0.5em; font-family: serif; font-style: italic; @@ -14,7 +14,7 @@ .source-detail-content { display: block !important; - padding: 0 !important; + padding: 0.4em 0.2em 0.4em 0.5em !important; background-color: unset !important; } @@ -59,7 +59,7 @@ .app-detail-content, .app-detail-tabs { - background-color: transparent; + background-color: #f1f4f5; font-size: 1rem; } @@ -73,7 +73,7 @@ .app-detail-tabs { font-size: 1rem; - margin: 0 0.313rem 0 0.313rem; + margin: 0; padding: 0.313rem 0 0 0; .nav-link { background-color: transparent; From e69bd15f98720f0009fe470b5ead948afb3b31d0 Mon Sep 17 00:00:00 2001 From: davivcu Date: Thu, 27 Jul 2023 23:43:37 +0200 Subject: [PATCH 11/61] adjusting sources style --- src/app/components/sources/sources.component.scss | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/app/components/sources/sources.component.scss b/src/app/components/sources/sources.component.scss index d40286102..b1466510b 100644 --- a/src/app/components/sources/sources.component.scss +++ b/src/app/components/sources/sources.component.scss @@ -6,21 +6,25 @@ margin: 0.5em 0.5em 1em 0.5em; font-family: serif; font-style: italic; - font-size: 100%; box-shadow: 1px 1px 1px rgba(0,0,0,0.1); background-color:#2042512e; - border-radius:2px; } .source-detail-content { display: block !important; - padding: 0.4em 0.2em 0.4em 0.5em !important; background-color: unset !important; + padding-bottom: 0.6em !important; } .source-quote-button { float:right; - margin-right:0.5em; + margin-right: 0.3em; + font-size: 1.5em; + margin-top: -0.5em; + color: #00000073; + height: 2em; + display: none; + pointer-events: none; } .source-quote-symbol { From 617d53ba4301048627a62293051d37c971c9b5c7 Mon Sep 17 00:00:00 2001 From: davivcu Date: Wed, 9 Aug 2023 13:12:07 +0200 Subject: [PATCH 12/61] analogues parsing --- .../components/sources/sources.component.scss | 2 +- src/app/models/evt-models.ts | 4 ++ src/app/services/evt-model.service.ts | 9 +++ .../services/xml-parsers/analogue-parser.ts | 64 +++++++++++++++++++ .../analogues-entries-parser.service.ts | 31 +++++++++ src/app/services/xml-parsers/basic-parsers.ts | 20 +----- src/app/services/xml-parsers/index.ts | 4 ++ src/app/services/xml-parsers/quotes-parser.ts | 5 +- src/app/services/xml-parsers/xml-parsers.ts | 2 + 9 files changed, 120 insertions(+), 21 deletions(-) create mode 100644 src/app/services/xml-parsers/analogue-parser.ts create mode 100644 src/app/services/xml-parsers/analogues-entries-parser.service.ts diff --git a/src/app/components/sources/sources.component.scss b/src/app/components/sources/sources.component.scss index b1466510b..9c9abe0b7 100644 --- a/src/app/components/sources/sources.component.scss +++ b/src/app/components/sources/sources.component.scss @@ -1,7 +1,7 @@ @import "../../../assets/scss/themes"; .source-container { - border: 1px solid #8080804f; + border: 1px solid #80808026; padding: 0em; margin: 0.5em 0.5em 1em 0.5em; font-family: serif; diff --git a/src/app/models/evt-models.ts b/src/app/models/evt-models.ts index cfa04cced..d8c00c6c2 100644 --- a/src/app/models/evt-models.ts +++ b/src/app/models/evt-models.ts @@ -177,12 +177,14 @@ export class QuoteEntry extends GenericElement { ref: ParallelPassage[]; originalEncoding: string; //rend: string; + //TODO: biblStruct } export class BibliographicList extends GenericElement { id: string; head: string[]; sources: BibliographicEntry[]; + //TODO: biblStruct } export class BibliographicEntry extends GenericElement { @@ -199,6 +201,8 @@ export class BibliographicEntry extends GenericElement { export class ParallelPassage extends GenericElement { id: string; text: string; + attrSource: string; + attrTarget: string; sources: BibliographicEntry[]; originalEncoding: string; } diff --git a/src/app/services/evt-model.service.ts b/src/app/services/evt-model.service.ts index 2d86492fb..09b32c63d 100644 --- a/src/app/services/evt-model.service.ts +++ b/src/app/services/evt-model.service.ts @@ -14,6 +14,7 @@ import { PrefatoryMatterParserService } from './xml-parsers/prefatory-matter-par import { StructureXmlParserService } from './xml-parsers/structure-xml-parser.service'; import { WitnessesParserService } from './xml-parsers/witnesses-parser.service'; import { QuoteEntriesParserService } from './xml-parsers/quote-entries-parser.service'; +import { AnalogueEntriesParserService } from './xml-parsers/analogues-entries-parser.service'; @Injectable({ providedIn: 'root', @@ -144,11 +145,18 @@ export class EVTModelService { shareReplay(1), ); + //QUOTED SOURCES public readonly quoteEntries$ = this.editionSource$.pipe( map((source) => this.quoteParser.parseQuoteEntries(source)), shareReplay(1), ); + // PARALLEL PASSAGES + public readonly analogueEntries$ = this.editionSource$.pipe( + map((source) => this.analogueParser.parseAnaloguesEntries(source)), + shareReplay(1), + ) + // FACSIMILE public readonly surfaces$ = this.editionSource$.pipe( map((source) => this.facsimileParser.parseSurfaces(source)), @@ -200,6 +208,7 @@ export class EVTModelService { private linesVersesParser: LinesVersesParserService, private msDescParser: MsDescParserService, private quoteParser: QuoteEntriesParserService, + private analogueParser: AnalogueEntriesParserService, ) { } diff --git a/src/app/services/xml-parsers/analogue-parser.ts b/src/app/services/xml-parsers/analogue-parser.ts new file mode 100644 index 000000000..03a7987bf --- /dev/null +++ b/src/app/services/xml-parsers/analogue-parser.ts @@ -0,0 +1,64 @@ +import { xmlParser } from '.'; +import { ParallelPassage, XMLElement } from '../../models/evt-models'; +import { getOuterHTML } from '../../utils/dom-utils'; +import { AttributeParser, BibliographyListParser, BibliographyParser, EmptyParser } from './basic-parsers'; +import { createParser, getID, parseChildren, Parser } from './parser-models'; + +@xmlParser('evt-analogue-entry-parser', AnalogueParser) +export class AnalogueParser extends EmptyParser implements Parser { + + attributeParser = createParser(AttributeParser, this.genericParse); + biblParser = createParser(BibliographyParser, this.genericParse); + listBiblParser = createParser(BibliographyListParser, this.genericParse); + + public parse(quoteEntry: XMLElement): ParallelPassage { + return { + type: ParallelPassage, + id: getID(quoteEntry), + attributes: this.attributeParser.parse(quoteEntry), + text: this.chainFirstChildTexts(quoteEntry), + content: parseChildren(quoteEntry, this.genericParse), + attrTarget: quoteEntry.getAttribute('target'), + attrSource: quoteEntry.getAttribute('source'), + sources: this.getSources(quoteEntry), + class: quoteEntry.tagName.toLowerCase(), + originalEncoding: getOuterHTML(quoteEntry), + }; + } + + /** + * Significant text can be split inside two or more text evt-element, especially if contains new line characters. + * This function returns a string with all the text element chained + * @param n XMLElement + * @returns string + */ + private chainFirstChildTexts(n: XMLElement): string { + const evtTextElement = '#text'; + let out = ''; + n.childNodes.forEach((x) => (x.nodeName === evtTextElement) ? out += x.nodeValue : '') + + return out; + } + + /** + * Retrieve and send to parsing all Bibliography elements inside this quote element + * @param quote XMLElement + * @returns array of Bibliography Element or a single Bibliography List element + */ + private getSources(quote: XMLElement): any { + const bibl = ['bibl']; + const biblList = ['listBibl']; + //get "corresp" e "source" attr + + return Array.from(quote.children) + .map((x: XMLElement) => bibl.includes(x['tagName']) ? this.biblParser.parse(x) : ( + biblList.includes(x['tagName']) ? this.listBiblParser.parse(x) : null)) + .filter((x) => x); + } + + //get SEC + + //get REF + //attr 'target' with referral in external bibliography with corresp xml:id attrb + +} diff --git a/src/app/services/xml-parsers/analogues-entries-parser.service.ts b/src/app/services/xml-parsers/analogues-entries-parser.service.ts new file mode 100644 index 000000000..0cd33031a --- /dev/null +++ b/src/app/services/xml-parsers/analogues-entries-parser.service.ts @@ -0,0 +1,31 @@ +import { Injectable } from '@angular/core'; +import { ParserRegister } from '.'; +import { ParallelPassage, XMLElement } from '../../models/evt-models'; + +@Injectable({ + providedIn: 'root', +}) +export class AnalogueEntriesParserService { + + private refTagName = 'ref'; + private segTagName = 'seg'; + + public parseAnaloguesEntries(document: XMLElement) { + return this.parseRefEntries(document).concat(this.parseSegEntries(document)); + } + + public parseRefEntries(document: XMLElement) { + const refParser = ParserRegister.get(this.refTagName); + + return Array.from(document.querySelectorAll(this.refTagName)) + .map((refEntry) => refParser.parse(refEntry) as ParallelPassage); + } + + public parseSegEntries(document: XMLElement) { + const segParser = ParserRegister.get(this.segTagName); + + return Array.from(document.querySelectorAll(this.segTagName)) + .map((segEntry) => segParser.parse(segEntry) as ParallelPassage); + } + +} diff --git a/src/app/services/xml-parsers/basic-parsers.ts b/src/app/services/xml-parsers/basic-parsers.ts index 0b1edb967..da5e7e0ed 100644 --- a/src/app/services/xml-parsers/basic-parsers.ts +++ b/src/app/services/xml-parsers/basic-parsers.ts @@ -2,9 +2,9 @@ import { AttributesMap } from 'ng-dynamic-component'; import { ParserRegister, xmlParser } from '.'; import { Addition, Attributes, BibliographicEntry, BibliographicList, Damage, Deletion, Gap, GenericElement, Lb, Note, NoteLayout, - Paragraph, ParallelPassage, PlacementType, Ptr, Supplied, Term, Text, Verse, VersesGroup, Word, XMLElement, + Paragraph, PlacementType, Ptr, Supplied, Term, Text, Verse, VersesGroup, Word, XMLElement, } from '../../models/evt-models'; -import { getOuterHTML, isNestedInElem, xpath } from '../../utils/dom-utils'; +import { isNestedInElem, xpath } from '../../utils/dom-utils'; import { replaceMultispaces } from '../../utils/xml-utils'; import { createParser, getClass, getDefaultN, getID, parseChildren, ParseFn, Parser } from './parser-models'; @@ -379,19 +379,3 @@ export class BibliographyListParser extends ListBiblParser implements Parser { - parse(xml: XMLElement): ParallelPassage { - return { - type: ParallelPassage, - id: getID(xml), - attributes: this.attributeParser.parse(xml), - text: (xml.firstChild) ? xml.firstChild.nodeValue : '', - content: parseChildren(xml, this.genericParse), - sources: Array.from(xml.querySelectorAll('bibl')).map((x) => this.biblParser.parse(x)), - originalEncoding: getOuterHTML(xml), - }; - } -} \ No newline at end of file diff --git a/src/app/services/xml-parsers/index.ts b/src/app/services/xml-parsers/index.ts index e6c72e4c1..9c2a6282c 100644 --- a/src/app/services/xml-parsers/index.ts +++ b/src/app/services/xml-parsers/index.ts @@ -35,6 +35,10 @@ export class ParserRegister { if (quote.includes(tagName)) { return 'evt-quote-entry-parser'; } + const ref = ['ref','seg']; + if (ref.includes(tagName)) { + return 'evt-analogue-entry-parser'; + } if (!Object.keys(ParserRegister.PARSER_MAP).includes(tagName)) { return 'evt-generic-elem-parser'; diff --git a/src/app/services/xml-parsers/quotes-parser.ts b/src/app/services/xml-parsers/quotes-parser.ts index 10996adb4..44b81943f 100644 --- a/src/app/services/xml-parsers/quotes-parser.ts +++ b/src/app/services/xml-parsers/quotes-parser.ts @@ -1,6 +1,7 @@ import { xmlParser } from '.'; import { ParallelPassage, QuoteEntry, XMLElement } from '../../models/evt-models'; -import { AttributeParser, BibliographyListParser, BibliographyParser, EmptyParser, ParallelPassageParser } from './basic-parsers'; +import { AnalogueParser } from './analogue-parser'; +import { AttributeParser, BibliographyListParser, BibliographyParser, EmptyParser } from './basic-parsers'; import { createParser, getID, parseChildren, Parser } from './parser-models'; import { getOuterHTML } from 'src/app/utils/dom-utils'; @@ -10,7 +11,7 @@ export class QuoteParser extends EmptyParser implements Parser { attributeParser = createParser(AttributeParser, this.genericParse); biblParser = createParser(BibliographyParser, this.genericParse); listBiblParser = createParser(BibliographyListParser, this.genericParse); - parallelPassageParser = createParser(ParallelPassageParser, this.genericParse); + parallelPassageParser = createParser(AnalogueParser, this.genericParse); public parse(quoteEntry: XMLElement): QuoteEntry { return { diff --git a/src/app/services/xml-parsers/xml-parsers.ts b/src/app/services/xml-parsers/xml-parsers.ts index 5f5e154ce..e6cd74cc2 100644 --- a/src/app/services/xml-parsers/xml-parsers.ts +++ b/src/app/services/xml-parsers/xml-parsers.ts @@ -39,6 +39,7 @@ import { PersonGroupParser, PersonParser, PlaceParser, RelationParser, } from './named-entity-parsers'; import { QuoteParser } from './quotes-parser'; +import { AnalogueParser } from './analogue-parser'; // eslint-disable-next-line @typescript-eslint/no-explicit-any export function ParsersDecl(declarations: Array>) { @@ -59,6 +60,7 @@ export function ParsersDecl(declarations: Array>) { AdditionParser, AdditionsParser, AdminInfoParser, + AnalogueParser, AltIdentifierParser, AppParser, AttributeMapParser, From 89cc110f54b9f5cb0f9b1104bb164c478d5fff2d Mon Sep 17 00:00:00 2001 From: davivcu Date: Thu, 10 Aug 2023 01:42:35 +0200 Subject: [PATCH 13/61] bibliolist component in order to reduce duplicated code in analogue and source component --- src/app/app.module.ts | 2 ++ src/app/components/biblio/biblio.component.ts | 8 ++--- .../biblioList/biblio-list.component.html | 17 ++++++++++ .../biblioList/biblio-list.component.scss | 0 .../biblioList/biblio-list.component.spec.ts | 25 ++++++++++++++ .../biblioList/biblio-list.component.ts | 12 +++++++ .../components/sources/sources.component.html | 34 ++++++------------- 7 files changed, 69 insertions(+), 29 deletions(-) create mode 100644 src/app/components/biblioList/biblio-list.component.html create mode 100644 src/app/components/biblioList/biblio-list.component.scss create mode 100644 src/app/components/biblioList/biblio-list.component.spec.ts create mode 100644 src/app/components/biblioList/biblio-list.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 3a6f9a2aa..27ade92d0 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -124,6 +124,7 @@ import { CriticalApparatusComponent } from './components/critical-apparatus/crit import { SourcesComponent } from './components/sources/sources.component'; import { QuoteEntryComponent } from './components/quote-entry/quote-entry.component'; import { BiblioEntryComponent } from './components/biblio/biblio.component'; +import { BiblioListComponent } from './components/biblioList/biblio-list.component'; const routes: Routes = [ ]; @@ -236,6 +237,7 @@ const DynamicComponents = [ SourcesComponent, QuoteEntryComponent, BiblioEntryComponent, + BiblioListComponent, ], imports: [ AppRoutingModule, diff --git a/src/app/components/biblio/biblio.component.ts b/src/app/components/biblio/biblio.component.ts index abf26e9bc..833257280 100644 --- a/src/app/components/biblio/biblio.component.ts +++ b/src/app/components/biblio/biblio.component.ts @@ -1,11 +1,11 @@ -import { Component, Input, OnInit } from '@angular/core'; +import { Component, Input } from '@angular/core'; @Component({ selector: 'evt-biblio-entry', templateUrl: './biblio.component.html', styleUrls: ['./biblio.component.scss'], }) -export class BiblioEntryComponent implements OnInit { +export class BiblioEntryComponent { @Input() data; @@ -14,9 +14,5 @@ export class BiblioEntryComponent implements OnInit { public showEmptyValues = false; public inline = true; - ngOnInit() { - console.log(this.data); - } - } diff --git a/src/app/components/biblioList/biblio-list.component.html b/src/app/components/biblioList/biblio-list.component.html new file mode 100644 index 000000000..75ba413c4 --- /dev/null +++ b/src/app/components/biblioList/biblio-list.component.html @@ -0,0 +1,17 @@ +
      + + + + + {{elem.head}} + + +
    • +
      +
      + + +
    • +
      +
      +
    \ No newline at end of file diff --git a/src/app/components/biblioList/biblio-list.component.scss b/src/app/components/biblioList/biblio-list.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/components/biblioList/biblio-list.component.spec.ts b/src/app/components/biblioList/biblio-list.component.spec.ts new file mode 100644 index 000000000..783c67d9a --- /dev/null +++ b/src/app/components/biblioList/biblio-list.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { BiblioListComponent } from './biblio-list.component'; + +describe('BiblioListComponent', () => { + let component: BiblioListComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ BiblioListComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(BiblioListComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/biblioList/biblio-list.component.ts b/src/app/components/biblioList/biblio-list.component.ts new file mode 100644 index 000000000..265a7850d --- /dev/null +++ b/src/app/components/biblioList/biblio-list.component.ts @@ -0,0 +1,12 @@ +import { Component, Input } from '@angular/core'; + +@Component({ + selector: 'evt-biblio-list', + templateUrl: './biblio-list.component.html', + styleUrls: ['./biblio-list.component.scss'], +}) +export class BiblioListComponent { + + @Input() data; + +} diff --git a/src/app/components/sources/sources.component.html b/src/app/components/sources/sources.component.html index 68bab3694..1c716cd04 100644 --- a/src/app/components/sources/sources.component.html +++ b/src/app/components/sources/sources.component.html @@ -15,33 +15,21 @@ {{'refBibl' | translate}} -

    {{'QuotedSources' | translate}}

    -
      - - - - - {{elem.head}} - + +

      {{'QuotedSources' | translate}}

      + +
      + + +

      {{'References' | translate}}

      +
        +
      • - - -
      • -
        - -
      - -

      {{'References' | translate}}

      -
        - - -
      • -
        -
        -
      +
    +
    From e5224e4fb07a5a8d0d2e852fff81775e46c2bb53 Mon Sep 17 00:00:00 2001 From: davivcu Date: Thu, 10 Aug 2023 03:57:50 +0200 Subject: [PATCH 14/61] chainFirstChildTexts in utils, originalEncoding, external sources --- .../components/sources/sources.component.html | 13 ++++++- src/app/models/evt-models.ts | 3 ++ src/app/services/xml-parsers/basic-parsers.ts | 8 ++-- src/app/services/xml-parsers/quotes-parser.ts | 39 +++++++++++-------- src/app/utils/xml-utils.ts | 14 +++++++ 5 files changed, 55 insertions(+), 22 deletions(-) diff --git a/src/app/components/sources/sources.component.html b/src/app/components/sources/sources.component.html index 1c716cd04..ca78937c0 100644 --- a/src/app/components/sources/sources.component.html +++ b/src/app/components/sources/sources.component.html @@ -8,10 +8,10 @@ {{source.text}} -