Add sheet for not conserved stuff

This commit is contained in:
2024-11-18 11:00:21 +01:00
parent a2028312b9
commit e9c8ac6b07
5 changed files with 125 additions and 20 deletions

View File

@@ -0,0 +1,67 @@
/**
* 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">
<span class="icon has-text-link">
<i class="fa fa-map"></i>
</span>
<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);
}
}

View File

@@ -13,18 +13,17 @@ export class SiteDocuments {
render() {
let content = `
<div class="has-bottom-border">
<p class="p-2 has-text-centered">${this._siteData.documenti}</p>
<div class="p-2">
<table class="p-4 table is-fullwidth is-striped">
<thead>
<tr><th colspan=3 class="p-2 has-text-centered is-size-5">Documentazione di archivio</th>
<tr><th>Titolo</th><th>Autori</th><th>Download</th></tr>
</thead>
<tbody>
<table class="p-4 table is-fullwidth is-striped">
<thead>
<tr><th colspan=3 class="p-2 has-text-centered is-size-5">Documentazione di archivio</th>
<tr><th>Titolo</th><th>Autori</th><th>Download</th></tr>
</thead>
<tbody>
`;
for (const doc of this._siteData.documents.filter(d => d.tipo === 'documentazione')) {
for (const doc of this._siteData.documents.filter(d => d.type === 'documentazione')) {
content += `
<tr><td>${doc.titolo}</td><td>${doc.autori}</td><td><a class="button is-link has-text-white" href="docs/${doc.filename}">
<tr><td>${doc.title}</td><td>${doc.authors}</td><td><a class="button is-link has-text-white" href="docs/${doc.filename}">
<i class="fa fa-download mr-2"></i> PDF
</a></td></tr>
`;
@@ -37,9 +36,9 @@ export class SiteDocuments {
</thead>
<tbody>
`;
for (const doc of this._siteData.documents.filter(d => d.tipo === 'pubblicazione')) {
for (const doc of this._siteData.documents.filter(d => d.type === 'pubblicazione')) {
content += `
<tr><td>${doc.titolo}</td><td>${doc.autori}</td><td><a class="button is-link has-text-white" href="docs/${doc.filename}">
<tr><td>${doc.title}</td><td>${doc.authors}</td><td><a class="button is-link has-text-white" href="docs/${doc.filename}">
<i class="fa fa-download mr-2"></i> PDF
</a></td></tr>
`;