Gh Page: ensure that a row always have the same amount of cells.

This commit is contained in:
Benoit Marty 2024-04-15 11:29:47 +02:00
parent e8d8ee389a
commit dfccdd465d

View file

@ -191,6 +191,13 @@ function createMissingImageElement() {
return text; return text;
} }
function createUpToDateImageElement() {
const text = document.createElement('p');
text.className = "missing";
text.textContent = 'Image not updated';
return text;
}
function convertToHumanReadableDate(modifiedDayTime) { function convertToHumanReadableDate(modifiedDayTime) {
var date = new Date(modifiedDayTime * 86400000); var date = new Date(modifiedDayTime * 86400000);
return date.toLocaleDateString(); return date.toLocaleDateString();
@ -270,6 +277,8 @@ function addTable() {
const foreignFile = englishFile.replace("en]", `${dataLanguages[languageIndex]}]`).replace("_S_", "_T_") const foreignFile = englishFile.replace("en]", `${dataLanguages[languageIndex]}]`).replace("_S_", "_T_")
const fullForeignFile = `${dataLanguages[languageIndex]}/${foreignFile}.png`; const fullForeignFile = `${dataLanguages[languageIndex]}/${foreignFile}.png`;
td.appendChild(createImageElement(fullForeignFile, modifiedDayTime)); td.appendChild(createImageElement(fullForeignFile, modifiedDayTime));
} else {
td.appendChild(createUpToDateImageElement());
} }
} }
tr.appendChild(td); tr.appendChild(td);