mirror of
https://github.com/GCMatters/hermes.git
synced 2026-02-04 21:50:12 +01:00
feat: image support
also translated some strings back into english
This commit is contained in:
@@ -13,7 +13,7 @@ async function getEvents(titleOrDescription?: string) {
|
||||
|
||||
if (titleOrDescription == null) {
|
||||
res = await fetch("/api/events" + (isAscending ? "?sort=asc" : ""));
|
||||
if (!res.ok) throw new Error("Błąd pobierania wydarzeń");
|
||||
if (!res.ok) throw new Error("Couldn't load events");
|
||||
} else {
|
||||
const payload = {
|
||||
titleOrDescription
|
||||
@@ -23,7 +23,7 @@ async function getEvents(titleOrDescription?: string) {
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(payload)
|
||||
});
|
||||
if (!res.ok) throw new Error("Błąd wyszukiwania wydarzeń");
|
||||
if (!res.ok) throw new Error("Failed to get search results");
|
||||
}
|
||||
|
||||
const events = await res.json();
|
||||
@@ -44,13 +44,16 @@ async function loadEvents(org_id: number, evs?: Promise<any>) {
|
||||
}
|
||||
|
||||
if (events.length === 0) {
|
||||
container.innerHTML = "<p class='text-muted'>Brak wydarzeń do wyświetlenia.</p>";
|
||||
container.innerHTML = "<p class='text-muted'>No events to display at this moment.</p>";
|
||||
return;
|
||||
}
|
||||
|
||||
// Wyczyść kontener przed dodaniem nowych
|
||||
container.innerHTML = '';
|
||||
|
||||
const styleDefault = "color: #2898BD";
|
||||
const styleHighlighted = "#2393BD";
|
||||
|
||||
for (const ev of events) {
|
||||
const card = document.createElement("div");
|
||||
card.className = "event-card filled";
|
||||
@@ -83,7 +86,7 @@ async function loadEvents(org_id: number, evs?: Promise<any>) {
|
||||
container.appendChild(card);
|
||||
}
|
||||
} catch (err) {
|
||||
container.innerHTML = `<p class="text-danger">Błąd ładowania danych.</p>`;
|
||||
container.innerHTML = `<p class="text-danger">General failure when trying to load data.</p>`;
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user