/** * @class Prehistoric */ export class Prehistoric { biblioElements = []; set data(data) { this._data = data; } /** * * @todo Biblio * @returns {string} The HTML */ async render() { return `
Denominazione: ${this._data.denomination}
Periodo: ${this._data.period}
Località generica: ${this._data.genericPlace}
Descrizione breve ${this._data.description}
Conservazione: ${this._data.conservation}
Autore scheda: ${this._data.author}
Bibliografia: ${await this.biblio(this._data.id)}
*/ } /** * @param {number} recordId */ async biblio(recordId) { let finding = await this.fetchData(`${window.API_URL}/prehistoric/${recordId}`); let citations = ''; if (finding.bibliography.length) { finding.bibliography.forEach(record => { citations += ` ${record.citation.toLowerCase()}`; citations += record.pages?.length ? `, ${record.pages};` : ';'; this.biblioElements.push(`${record.reference}