Update displayed data + menu

This commit is contained in:
2024-11-26 15:58:06 +01:00
parent 071641270c
commit fbb9efc4c7
4 changed files with 51 additions and 27 deletions

View File

@@ -3,6 +3,8 @@
* @class SiteDocuments
*/
export class SiteDocuments {
documentation = [];
publications = [];
/**
* @param {object} data
*/
@@ -11,38 +13,45 @@ export class SiteDocuments {
}
render() {
this.documentation = this._siteData.documents
.filter(d => d.type === 'documentazione')
this.publications = this._siteData.documents.filter(d => d.type === 'pubblicazione');
let content = `
<div class="has-bottom-border">
<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>
<tr><th>Titolo</th><th>Luogo di conservazione</th><th>Download</th></tr>
</thead>
<tbody>
`;
for (const doc of this._siteData.documents.filter(d => d.type === 'documentazione')) {
for (const doc of this.documentation) {
content += `
<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>
`;
}
content += `
</tbody>
<thead>
<tr><th colspan=3 class="p-2 has-text-centered is-size-5">Pubblicazioni del progetto Carta Archeologica</th>
<tr><th>Titolo</th><th>Autori</th><th>Download</th></tr>
</thead>
<tbody>
`;
for (const doc of this._siteData.documents.filter(d => d.type === 'pubblicazione')) {
content += `
<tr><td>${doc.title}</td><td>${doc.authors}</td><td><a class="button is-link has-text-white" href="docs/${doc.filename}">
<tr><td>${doc.title}</td><td>${doc.conservationPlace}</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>
`;
}
if (this.publications.length) {
content += `
</tbody>
<thead>
<tr><th colspan=3 class="p-2 has-text-centered is-size-5">Pubblicazioni del progetto Carta Archeologica</th>
<tr><th>Titolo</th><th>Autori</th><th>Download</th></tr>
</thead>
<tbody>
`;
for (const doc of this.publications) {
content += `
<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>
`;
}
}
content += `
</tbody>
</table>

View File

@@ -28,6 +28,7 @@ export class SiteSheet {
<tr><th>Motivazione cronologia</th><td>${this._siteData.motivation}</td></tr>
<tr class="is-link"><th class="is-size-5 has-text-centered" colspan=2>Conservazione e condizione giuridica</th></tr>
<tr><th>Stato di conservazione</th><td>${this._siteData.conservationState}</td></tr>
<tr><th>Tecniche edilizie impiegate:</th><td>${this._siteData.techniques}</td></tr>
<tr class="is-link"><th class="is-size-5 has-text-centered" colspan=2>Ritrovamento e materiali</th></tr>
<tr><th>Anno di ritrovamento</th><td>${this._siteData.finding}</td></tr>
<tr><th>Materiali rinvenuti</th><td>${this._siteData.materials}</td></tr>
@@ -62,6 +63,9 @@ export class SiteSheet {
<p class="mt-4 pl-2 pr-5">
${this._siteData.shortDescription}
</p>
<p class="p-2">
<strong>Autore scheda:</strong> ${this._siteData.author}
</p>
</div>`;
}
}