mirror of
https://github.com/GCMatters/hermes.git
synced 2026-02-04 13:40:13 +01:00
feat: image support
also translated some strings back into english
This commit is contained in:
@@ -17,6 +17,7 @@ function modifyEvent() {
|
||||
const title = document.getElementById('title').value;
|
||||
const location = document.getElementById('location').value;
|
||||
const description = document.getElementById('description').value;
|
||||
const imageURL = document.getElementById('imageURL').value;
|
||||
const eventDateRaw = document.getElementById('eventDate').value;
|
||||
// Walidacja prostych pól
|
||||
if (!title || !location || !eventDateRaw) {
|
||||
@@ -27,6 +28,7 @@ function modifyEvent() {
|
||||
const payload = {
|
||||
title,
|
||||
location,
|
||||
imageURL,
|
||||
description,
|
||||
eventDate,
|
||||
};
|
||||
@@ -40,12 +42,12 @@ function modifyEvent() {
|
||||
const errorText = yield response.text();
|
||||
throw new Error(errorText);
|
||||
}
|
||||
alert("Wydarzenie zmodyfikowane!");
|
||||
alert("Event modified!");
|
||||
window.location.href = "/"; // Przekierowanie do strony głównej
|
||||
}
|
||||
catch (error) {
|
||||
console.error("Błąd podczas modyfikowania:", error);
|
||||
alert("Nie udało się zmodyfikować wydarzenia: " + error);
|
||||
console.error("Error occurred while trying to modify event:", error);
|
||||
alert("Couldn't modify event, an error occurred: " + error);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -77,9 +79,10 @@ document.addEventListener("DOMContentLoaded", () => __awaiter(void 0, void 0, vo
|
||||
const locationInput = document.getElementById('location');
|
||||
const descriptionInput = document.getElementById('description');
|
||||
const dateInput = document.getElementById('eventDate');
|
||||
const imageInput = document.getElementById('imageURL');
|
||||
var ev = yield getEvent(eventId);
|
||||
if (ev === null) {
|
||||
container.innerHTML = "<p class='text-muted'>Brak wydarzeń do wyświetlenia.</p>";
|
||||
container.innerHTML = "<p class='text-muted'>Failed to load event data.</p>";
|
||||
return;
|
||||
}
|
||||
else {
|
||||
@@ -87,6 +90,7 @@ document.addEventListener("DOMContentLoaded", () => __awaiter(void 0, void 0, vo
|
||||
locationInput.value = ev.location || '';
|
||||
descriptionInput.value = ev.description || '';
|
||||
dateInput.value = ev.eventDate.slice(0, 16) || '';
|
||||
imageInput.value = ev.imageURL || '';
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user