Reorganize structure with entry point
This commit is contained in:
67
webgis/js/components/NotConservedSheet.js
Normal file
67
webgis/js/components/NotConservedSheet.js
Normal 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);
|
||||
}
|
||||
}
|
||||
55
webgis/js/components/SiteDocuments.js
Normal file
55
webgis/js/components/SiteDocuments.js
Normal file
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* Component to render data for site documents
|
||||
* @class SiteDocuments
|
||||
*/
|
||||
export class SiteDocuments {
|
||||
/**
|
||||
* @param {object} data
|
||||
*/
|
||||
set siteData(data) {
|
||||
this._siteData = data;
|
||||
}
|
||||
|
||||
render() {
|
||||
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>
|
||||
</thead>
|
||||
<tbody>
|
||||
`;
|
||||
for (const doc of this._siteData.documents.filter(d => d.type === 'documentazione')) {
|
||||
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}">
|
||||
<i class="fa fa-download mr-2"></i> PDF
|
||||
</a></td></tr>
|
||||
`;
|
||||
}
|
||||
content += `
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
return content;
|
||||
}
|
||||
}
|
||||
31
webgis/js/components/SitePhotos.js
Normal file
31
webgis/js/components/SitePhotos.js
Normal file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Component to render data for site photos
|
||||
* @class SitePhotos
|
||||
*/
|
||||
export class SitePhotos {
|
||||
/**
|
||||
* @param {object} data
|
||||
*/
|
||||
set siteData(data) {
|
||||
this._siteData = data;
|
||||
}
|
||||
|
||||
render() {
|
||||
let content = `<div class="content has-text-centered">
|
||||
<p class="is-size-5 mt-3">Fotografie</p>`;
|
||||
content += `
|
||||
<div style="max-width: 70%; margin: 0 auto">
|
||||
<p class="is-size-6 has-text-centered">Cliccare sull'immagine per aprire la gallery</p>
|
||||
<figure class="is-relative is-clickable has-text-centered" id="gallery-2">
|
||||
<img src="img/${this._siteData.filename}" width="300"/>
|
||||
<div class="icon overlay is-flex is-justify-content-center is-align-items-center">
|
||||
<i class="is-flex fa fa-2x fa-play-circle"></i>
|
||||
</div>
|
||||
</figure>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
return content;
|
||||
}
|
||||
}
|
||||
67
webgis/js/components/SiteSheet.js
Normal file
67
webgis/js/components/SiteSheet.js
Normal file
@@ -0,0 +1,67 @@
|
||||
/**
|
||||
* Component to render data for site sheet
|
||||
* @class SiteSheet
|
||||
*/
|
||||
export class SiteSheet {
|
||||
/**
|
||||
* @param {object} data
|
||||
*/
|
||||
set siteData(data) {
|
||||
this._siteData = data;
|
||||
}
|
||||
|
||||
render() {
|
||||
return `<div class="container has-bottom-border">
|
||||
<table class="table is-fullwidth is-striped">
|
||||
<tr class="is-link"><th class="is-size-5 has-text-centered" colspan=2>Identificazione</th></tr>
|
||||
<tr><th>Denominazione</th><td>${this._siteData.denomination}</td></tr>
|
||||
<tr><th>Definizione</th><td>${this._siteData.definition}</td></tr>
|
||||
<tr class="is-link"><th class="is-size-5 has-text-centered" colspan=2>Localizzazione geografico-amministrativa</th></tr>
|
||||
<tr><th>Comune</th><td>${this._siteData.municipality}</td></tr>
|
||||
<tr><th>Indirizzo</th><td>${this._siteData.address}</td></tr>
|
||||
<tr><th>Località</th><td>${this._siteData.place}</td></tr>
|
||||
<tr><th>Localizzazione</th><td>${this._siteData.localization}</td></tr>
|
||||
<tr class="is-link"><th class="is-size-5 has-text-centered" colspan=2>Cronologia</th></tr>
|
||||
<tr><th>Periodo</th><td>${this._siteData.period}</td></tr>
|
||||
<tr><th>Fase</th><td>${this._siteData.phase}</td></tr>
|
||||
<tr><th>Cronologia</th><td>${this._siteData.chronology}</td></tr>
|
||||
<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 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>
|
||||
<tr><th>Luogo custodia materiali</th><td>${this._siteData.conservationPlace}</td></tr>
|
||||
<tr class="is-link"><th class="is-size-5 has-text-centered" colspan=2>Descrizione</th></tr>
|
||||
<tr><td class="pr-6 pl-6 pt-3" colspan="2">${this._siteData.description}</td></tr>
|
||||
</table>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
renderShort() {
|
||||
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._siteData.denomination}
|
||||
</p>
|
||||
<p class="p-2">
|
||||
<span class="icon has-text-link">
|
||||
<i class="fa fa-hourglass"></i>
|
||||
</span>
|
||||
<strong>Periodo:</strong> ${this._siteData.period}
|
||||
</p>
|
||||
<p class="p-2">
|
||||
<span class="icon has-text-link">
|
||||
<i class="fa fa-map"></i>
|
||||
</span>
|
||||
<strong>Località generica:</strong> ${this._siteData.genericPlace}
|
||||
</p>
|
||||
<p class="mt-4 pl-2 pr-5">
|
||||
${this._siteData.shortDescription}
|
||||
</p>
|
||||
</div>`;
|
||||
}
|
||||
}
|
||||
31
webgis/js/components/SiteSurveys.js
Normal file
31
webgis/js/components/SiteSurveys.js
Normal file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Component to render data for site surveys
|
||||
* @class SiteSurveys
|
||||
*/
|
||||
export class SiteSurveys {
|
||||
/**
|
||||
* @param {object} data
|
||||
*/
|
||||
set siteData(data) {
|
||||
this._siteData = data;
|
||||
}
|
||||
|
||||
render() {
|
||||
let content = `<div class="has-text-centered has-bottom-border mb-5 pb-5">
|
||||
<p class="is-size-5 mt-3">Elaborazioni CNR da rilievi</p>`;
|
||||
content += `
|
||||
<div style="max-width: 70%; margin: 0 auto">
|
||||
<p class="is-size-6 has-text-centered">Cliccare sull'immagine per aprire la gallery</p>
|
||||
<figure class="is-relative has-text-centered is-clickable" id="gallery-1">
|
||||
<img src="img/${this._siteData.filename}" width="300"/>
|
||||
<div class="icon overlay is-flex is-justify-content-center is-align-items-center">
|
||||
<i class="is-flex fa fa-2x fa-play-circle"></i>
|
||||
</div>
|
||||
</figure>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
return content;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user