Merge pull request #2705 from element-hq/feature/bma/ghPagesFix

Gh pages fix and Localazy fix
This commit is contained in:
Benoit Marty
2024-04-15 13:26:33 +02:00
committed by GitHub
2 changed files with 15 additions and 0 deletions

View File

@@ -149,6 +149,7 @@ function addForm() {
};
label2.appendChild(input2);
form.appendChild(label2);
/*
// Add a date picker to input the minimum date of modification
const label3 = document.createElement('label');
label3.textContent = 'If modified since:';
@@ -168,6 +169,7 @@ function addForm() {
addTable();
};
form.appendChild(dateInput);
*/
// Add a span with id result to display the number of lines
const lines = document.createElement('span');
lines.id = 'lines';
@@ -191,6 +193,13 @@ function createMissingImageElement() {
return text;
}
function createUpToDateImageElement() {
const text = document.createElement('p');
text.className = "missing";
text.textContent = 'Image not updated';
return text;
}
function convertToHumanReadableDate(modifiedDayTime) {
var date = new Date(modifiedDayTime * 86400000);
return date.toLocaleDateString();
@@ -270,6 +279,8 @@ function addTable() {
const foreignFile = englishFile.replace("en]", `${dataLanguages[languageIndex]}]`).replace("_S_", "_T_")
const fullForeignFile = `${dataLanguages[languageIndex]}/${foreignFile}.png`;
td.appendChild(createImageElement(fullForeignFile, modifiedDayTime));
} else {
td.appendChild(createUpToDateImageElement());
}
}
tr.appendChild(td);

View File

@@ -18,6 +18,7 @@
import os
import re
import sys
import time
from util import compare
@@ -134,6 +135,9 @@ def generateJavascriptFile():
if os.path.exists(translatedFile):
# Get the last modified date of the file in seconds and round to days
date = os.popen("git log -1 --format=%ct -- \"" + translatedFile + "\"").read().strip()
# if date is empty, use today's date
if date == "":
date = time.time()
dateDay = int(date) // 86400
dataForFile.append(dateDay)
else: