import { GisState } from "../state.js"; /** * @namespace Utils */ const Utils = {}; /** * * @param {string} galleryId The image gallery's id * @param {Object} imagesData * @returns {string} */ Utils.renderImages = function (galleryId, imagesData) { let content = `
Immagini
`; content += `Cliccare sull'immagine per aprire la gallery
Nessun documento disponibile.
'; const documentation = record.documents.filter(d => d.type === 'documentazione') const publications = record.documents.filter(d => d.type === 'pubblicazione'); let content = `Documentazione di archivio | ||
---|---|---|
Titolo | Luogo di conservazione | Download |
${doc.title} | ${doc.conservationPlace} | |
Pubblicazioni del progetto Carta Archeologica | ||
Titolo | Autori | Download |
${doc.title} | ${doc.authors} |
Nessun documento disponibile.
'; } return content; } /** * * @param {String} recordUri The record URI used for API calls * @param {Number} recordId This record's ID * @returns {{citations:String,biblioElements:String[]}} */ Utils.buildBibliography = async function(recordUri, recordId) { let record = await Utils.fetchData(`${GisState.apiUrl}/${recordUri}/${recordId}`); let biblioElements = []; let citations = ''; if (record.bibliography.length) { record.bibliography.forEach(record => { citations += ` ${record.citation.trim()} `; citations += record.pages?.length ? `, ${record.pages};` : ';'; biblioElements.push(`${record.reference}