Skip to content
This repository was archived by the owner on Jun 7, 2025. It is now read-only.

Commit 12efc43

Browse files
committed
Modifica la funzione populateBasicPDFList per gestire documenti interni ed esterni e aggiunge supporto per lettere
1 parent e86eea2 commit 12efc43

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

populateSection.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,24 +75,36 @@ async function addAllDocuments() {
7575

7676
}
7777

78-
// TODO: This function has been temporarily modified to divide external and internal docs for RTB, it needs to get back to the original code and made more generic when the docs repo's structure will divide internal and external docs
78+
// TODO: This function has been temporarily modified to divide external and internal
79+
// docs for RTB, it needs to get back to the original code and made
80+
// more generic when the docs repo's structure will divide internal and external docs
81+
7982
function populateBasicPDFList(section) {
8083
const docsUrl = "/docs";
81-
let elementsEsterni = "", elementsInterni = "";
84+
85+
const LISTA_DOCUMENTI_INTERNI = ["Norme-di-Progetto.pdf"]
86+
87+
let elementsEsterni = "", elementsInterni = "", elementsLettere = "";
88+
8289
let pdfFiles = section.children;
8390
pdfFiles.sort((a, b) => parseInt(b.name.split(" ")[0]) - parseInt(a.name.split(" ")[0]));
8491

8592
pdfFiles.forEach((pdf) => {
8693
let path = findFilePath(section, pdf.name);
8794
if (pdf.type === "file" && pdf.name.endsWith(".pdf")) {
88-
if (!pdf.name.includes("Norme-di-Progetto"))
89-
elementsEsterni += `<li><a href="${docsUrl + path}" target="_blank" class="file-link">${(parseName(pdf.name))}</a></li>`;
90-
else
95+
if (pdf.name.includes("Lettera")) {
96+
elementsLettere += `<a href="${docsUrl + path}" target="_blank" class="file-link">${(parseName(pdf.name))}</a>`;
97+
} else if (LISTA_DOCUMENTI_INTERNI.includes(pdf.name)) {
9198
elementsInterni += `<li><a href="${docsUrl + path}" target="_blank" class="file-link">${(parseName(pdf.name))}</a></li>`;
99+
} else {
100+
elementsEsterni += `<li><a href="${docsUrl + path}" target="_blank" class="file-link">${(parseName(pdf.name))}</a></li>`;
101+
}
92102
}
93103
});
94104

95105
let result = `<div class="verbali">`;
106+
if (elementsLettere !== ``)
107+
result += `<div class="link-lettera"><h3>${elementsLettere}</h3></div>`;
96108
if (elementsInterni !== ``)
97109
result += `<div><h4>Interni</h4><ul class="link-file">${elementsInterni}</ul></div>`;
98110
if (elementsEsterni !== ``)

style.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,15 @@ section h3 {
150150
.verbali {
151151
display: grid;
152152
grid-template-columns: auto auto;
153-
justify-content: start;
153+
justify-items: center;
154+
justify-content: space-between;
154155
gap: 2em;
155156
}
157+
.link-lettera{
158+
grid-column: span 2;
159+
text-align: center;
160+
161+
}
156162

157163
.verbali h4 {
158164
margin-top: 0;

0 commit comments

Comments
 (0)