65 lines
1.9 KiB
JavaScript
65 lines
1.9 KiB
JavaScript
/**
|
|
* Component to render data for not conserved assets sheet
|
|
* @class NotConservedSheet
|
|
*/
|
|
export class NotConservedSheet {
|
|
/**
|
|
* @param {object} data
|
|
*/
|
|
set siteData(data) {
|
|
this._data = data;
|
|
}
|
|
|
|
render() {
|
|
return `
|
|
<div class="container ml-3">
|
|
<p class="p-2">
|
|
<span class="icon has-text-link">
|
|
<i class="fa fa-tag"></i>
|
|
</span>
|
|
<strong>Denominazione:</strong> ${this._data.denomination}
|
|
</p>
|
|
<p class="p-2">
|
|
<span class="icon has-text-link">
|
|
<i class="fa fa-hourglass"></i>
|
|
</span>
|
|
<strong>Periodo:</strong> ${this._data.period}
|
|
</p>
|
|
<p class="p-2">
|
|
<span class="icon has-text-link">
|
|
<i class="fa fa-map"></i>
|
|
</span>
|
|
<strong>Località generica:</strong> ${this._data.genericLocation}
|
|
</p>
|
|
<p class="mt-4 pl-2 pr-5">
|
|
<strong class="pb-3">Descrizione</strong></br>
|
|
${this._data.shortDescription}
|
|
</p>
|
|
<p class="mt-4 pl-2 pr-5">
|
|
<span class="icon has-text-link">
|
|
<i class="fa fa-book"></i>
|
|
</span>
|
|
<strong>Bibliografia:</strong> ${this.biblio(this._data.bibliography)}
|
|
</p>
|
|
<p class="p-2">
|
|
<strong>Autore scheda:</strong> ${this._data.author}
|
|
</p>
|
|
</div>`;
|
|
}
|
|
|
|
biblio(records) {
|
|
let biblio = '';
|
|
|
|
if (records.length) {
|
|
records.forEach(record => {
|
|
biblio += `
|
|
<span class="is-capitalized">${record.citation.toLowerCase()}</span>,
|
|
${record.pages};
|
|
`;
|
|
});
|
|
}
|
|
|
|
return biblio.trim().slice(0, -1);
|
|
}
|
|
}
|