Improved authorization, added link to event cards
This commit is contained in:
1 parent
43246d30a3
commit
da0cac463b
8 files changed
+130
-15
No files matched your search
+17
-1
@@ -41,6 +41,21 @@ export function createEventCard(event) {
|
||||
|
||||
article.append(title, date, venue);
|
||||
|
||||
if (event.url) {
|
||||
const link = document.createElement("a");
|
||||
link.href = event.url;
|
||||
link.target = "_blank";
|
||||
link.rel = "noopener noreferrer";
|
||||
link.className = "btn btn-outline-secondary btn-sm mt-2";
|
||||
link.textContent = "Event ansehen";
|
||||
article.appendChild(link);
|
||||
}
|
||||
|
||||
// Gäste sehen nur Event-Informationen. Speichern und Einladen sind Login-Funktionen.
|
||||
if (!window.currentUser) {
|
||||
return article;
|
||||
}
|
||||
|
||||
// --- BUTTON-GRUPPE ---
|
||||
const buttonContainer = document.createElement("div");
|
||||
buttonContainer.className = "d-flex gap-2 mt-2 flex-wrap";
|
||||
@@ -154,7 +169,8 @@ function createInviteForm(event, card) {
|
||||
body: JSON.stringify({
|
||||
toUser,
|
||||
eventId: event.id,
|
||||
eventName: event.name
|
||||
eventName: event.name,
|
||||
eventUrl: event.url || null
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user