Update displayed data + menu
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user