Compare commits
3
Commits
46074df578
...
d04a7e07de
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d04a7e07de | ||
|
|
c3bea2817c | ||
|
|
1efa4dcd39 |
No files matched your search
@@ -39,7 +39,7 @@ html {
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
font-family: var(--font-main);
|
||||
background: var(--color-bg);
|
||||
color: var(--color-text);
|
||||
line-height: 1.5;
|
||||
@@ -183,6 +183,7 @@ fieldset {
|
||||
h1,
|
||||
h2 {
|
||||
margin: 0;
|
||||
font-family: "Bagel Fat One", cursive;
|
||||
font-size: clamp(2rem, 4vw, 4rem);
|
||||
line-height: 1.03;
|
||||
letter-spacing: -0.03em;
|
||||
|
||||
+85
-5
@@ -266,7 +266,6 @@
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: var(--olive);
|
||||
color: #fffde8;
|
||||
border: none;
|
||||
border-radius: var(--radius-pill);
|
||||
@@ -275,10 +274,52 @@
|
||||
line-height: 1.3;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
filter: brightness(0.95);
|
||||
.btn-primary-register {
|
||||
background: var(--olive);
|
||||
}
|
||||
|
||||
.btn-primary-register:hover,
|
||||
.btn-primary-register:focus-visible {
|
||||
background: #575704;
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 4px 10px rgba(107, 107, 5, 0.28);
|
||||
}
|
||||
|
||||
.btn-primary-register:active {
|
||||
transform: translateY(0);
|
||||
box-shadow: 0 2px 6px rgba(107, 107, 5, 0.25);
|
||||
}
|
||||
|
||||
.btn-primary-danger {
|
||||
background: var(--tomato);
|
||||
}
|
||||
|
||||
.btn-primary-danger:hover,
|
||||
.btn-primary-danger:focus-visible {
|
||||
background: var(--tomato-dark);
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 4px 10px rgba(188, 74, 52, 0.28);
|
||||
}
|
||||
|
||||
.btn-primary-danger:active {
|
||||
transform: translateY(0);
|
||||
box-shadow: 0 2px 6px rgba(188, 74, 52, 0.25);
|
||||
}
|
||||
|
||||
.btn-primary:disabled {
|
||||
opacity: 0.6;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.btn-primary-own,
|
||||
.btn-primary-own:disabled {
|
||||
background: var(--olive-light);
|
||||
color: var(--black);
|
||||
opacity: 1;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------
|
||||
@@ -680,12 +721,42 @@
|
||||
}
|
||||
|
||||
.detail-primary-btn {
|
||||
border: 2px solid var(--tomato);
|
||||
border-radius: var(--radius-pill);
|
||||
background: var(--tomato);
|
||||
color: var(--white);
|
||||
padding: 10px 22px;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.detail-primary-btn-register {
|
||||
border: 2px solid var(--olive);
|
||||
background: var(--olive);
|
||||
}
|
||||
|
||||
.detail-primary-btn-register:not(:disabled):hover,
|
||||
.detail-primary-btn-register:not(:disabled):focus-visible {
|
||||
background: #575704;
|
||||
border-color: #575704;
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 4px 10px rgba(107, 107, 5, 0.28);
|
||||
}
|
||||
|
||||
.detail-primary-btn-danger {
|
||||
border: 2px solid var(--tomato);
|
||||
background: var(--tomato);
|
||||
}
|
||||
|
||||
.detail-primary-btn-danger:not(:disabled):hover,
|
||||
.detail-primary-btn-danger:not(:disabled):focus-visible {
|
||||
background: var(--tomato-dark);
|
||||
border-color: var(--tomato-dark);
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 4px 10px rgba(188, 74, 52, 0.28);
|
||||
}
|
||||
|
||||
.detail-primary-btn:not(:disabled):active {
|
||||
transform: translateY(0);
|
||||
box-shadow: 0 2px 6px rgba(102, 52, 13, 0.22);
|
||||
}
|
||||
|
||||
.detail-primary-btn:disabled {
|
||||
@@ -693,6 +764,15 @@
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.detail-primary-btn-own,
|
||||
.detail-primary-btn-own:disabled {
|
||||
border-color: var(--olive-light);
|
||||
background: var(--olive-light);
|
||||
color: var(--black);
|
||||
opacity: 1;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
|
||||
/* ---------------------------------------------------------
|
||||
Responsive: Tablet (<= 850px)
|
||||
|
||||
+16
-9
@@ -20,15 +20,15 @@
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
:root {
|
||||
--black: #000000;
|
||||
--black: #22211A;
|
||||
--white: #ffffff;
|
||||
--button-green: #6b6b05;
|
||||
--button-green-dark: #514c04;
|
||||
--button-green: var(--olive);
|
||||
--button-green-dark: var(--olive-dark);
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Inter', sans-serif;
|
||||
font-family: var(--font-main);
|
||||
background: #FFFDE3; /* butter background color from stylesheet */
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ body {
|
||||
.how-step__png--brown {
|
||||
filter: brightness(0) saturate(100%) invert(39%) sepia(84%) saturate(1682%) hue-rotate(349deg) brightness(93%) contrast(86%);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.how-it-works__steps {
|
||||
@@ -378,7 +378,7 @@ body {
|
||||
}
|
||||
|
||||
/* Center arrow removed – using side arrows only */
|
||||
}
|
||||
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.gallery__track {
|
||||
@@ -405,12 +405,19 @@ body {
|
||||
justify-content: center;
|
||||
border-radius: 999px;
|
||||
font-size: 0.95rem;
|
||||
transition: background-color 0.2s ease, transform 0.2s ease;
|
||||
transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.btn:hover {
|
||||
.btn:hover,
|
||||
.btn:focus-visible {
|
||||
background-color: var(--button-green-dark);
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 4px 10px rgba(107, 107, 5, 0.28);
|
||||
}
|
||||
|
||||
.btn:active {
|
||||
transform: translateY(0);
|
||||
box-shadow: 0 2px 6px rgba(107, 107, 5, 0.25);
|
||||
}
|
||||
|
||||
.nav__link {
|
||||
@@ -512,7 +519,7 @@ body {
|
||||
}
|
||||
|
||||
.gallery__brand {
|
||||
font-family: 'Inter', sans-serif;
|
||||
font-family: var(--font-main);
|
||||
color: #DD541A;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,380 @@
|
||||
.profile-page {
|
||||
/* Reserve a large safe zone below sticky nav so title/actions are never covered. */
|
||||
margin-top: 0;
|
||||
padding-top: 6.5rem;
|
||||
margin-bottom: var(--space-8);
|
||||
}
|
||||
|
||||
/* Kopfbereich mit Titel und Logout-Aktion. */
|
||||
.profile-hero {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
gap: var(--space-4);
|
||||
margin-bottom: var(--space-5);
|
||||
}
|
||||
|
||||
.profile-kicker {
|
||||
margin: 0;
|
||||
color: var(--olive);
|
||||
font-size: 1rem;
|
||||
font-weight: 500;
|
||||
letter-spacing: var(--ls-label);
|
||||
}
|
||||
|
||||
#profile-headline {
|
||||
margin: 0.4rem 0;
|
||||
color: var(--brown);
|
||||
font-size: clamp(2rem, 4.4vw, 2.8rem);
|
||||
}
|
||||
|
||||
.profile-subline {
|
||||
margin: 0;
|
||||
max-width: 48rem;
|
||||
}
|
||||
|
||||
.profile-logout {
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.profile-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: var(--space-4);
|
||||
}
|
||||
|
||||
.profile-tabs {
|
||||
display: inline-flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.profile-tab {
|
||||
border: 2px solid var(--olive);
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--butter);
|
||||
color: var(--black);
|
||||
padding: 0.45rem 1rem;
|
||||
min-height: 2.5rem;
|
||||
font-family: "Jost", sans-serif;
|
||||
font-size: 1rem;
|
||||
font-weight: 500;
|
||||
letter-spacing: var(--ls-ui);
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
|
||||
}
|
||||
|
||||
.profile-tab:hover,
|
||||
.profile-tab:focus-visible {
|
||||
background: #faf8e8;
|
||||
}
|
||||
|
||||
.profile-tab.is-active {
|
||||
border-color: transparent;
|
||||
background: var(--olive);
|
||||
color: var(--white);
|
||||
}
|
||||
|
||||
/* Konsistentes Karten-Layout fuer alle Profilsektionen. */
|
||||
.profile-panel {
|
||||
background: rgba(255, 255, 255, 0.88);
|
||||
border-radius: var(--radius-lg);
|
||||
box-shadow: 0 3px 12px rgba(102, 52, 13, 0.1);
|
||||
padding: var(--space-5);
|
||||
}
|
||||
|
||||
.panel-head {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: var(--space-3);
|
||||
}
|
||||
|
||||
.panel-title {
|
||||
margin: 0;
|
||||
color: var(--brown);
|
||||
font-size: 1.8rem;
|
||||
}
|
||||
|
||||
.panel-count {
|
||||
min-width: 2rem;
|
||||
padding: 0.1rem 0.65rem;
|
||||
border-radius: var(--radius-pill);
|
||||
background: var(--olive-light);
|
||||
color: var(--black);
|
||||
font-size: 0.95rem;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.profile-card-list {
|
||||
display: grid;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
/* Einzelne Eventkarte fuer "Meine Events" und "Meine Anmeldungen". */
|
||||
.profile-event-card {
|
||||
border: 1px solid rgba(107, 107, 5, 0.25);
|
||||
border-radius: var(--radius-md);
|
||||
padding: var(--space-3);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
.profile-event-card-clickable {
|
||||
cursor: pointer;
|
||||
transition: box-shadow 0.2s ease, transform 0.2s ease;
|
||||
}
|
||||
|
||||
.profile-event-card-clickable:hover {
|
||||
box-shadow: 0 6px 16px rgba(102, 52, 13, 0.14);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.profile-event-title {
|
||||
margin: 0;
|
||||
color: var(--black);
|
||||
font-family: "Jost", sans-serif;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.profile-event-meta {
|
||||
margin: 0.3rem 0 0;
|
||||
font-size: 0.95rem;
|
||||
color: var(--olive);
|
||||
}
|
||||
|
||||
.profile-event-address-block {
|
||||
margin-top: 0.55rem;
|
||||
padding: 0.6rem 0.75rem;
|
||||
border-radius: var(--radius-sm);
|
||||
border-left: 4px solid var(--tomato);
|
||||
background: rgba(232, 237, 209, 0.65);
|
||||
}
|
||||
|
||||
.profile-event-address-label {
|
||||
margin: 0;
|
||||
color: var(--olive);
|
||||
font-size: 0.72rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: var(--ls-label);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.profile-event-address {
|
||||
margin: 0.2rem 0 0;
|
||||
font-size: 0.95rem;
|
||||
color: var(--black);
|
||||
font-weight: 600;
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.profile-event-link {
|
||||
flex-shrink: 0;
|
||||
color: var(--blue);
|
||||
font-weight: 500;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.profile-event-link:hover,
|
||||
.profile-event-link:focus-visible {
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 3px;
|
||||
}
|
||||
|
||||
.profile-event-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.profile-unregister-btn {
|
||||
border: none;
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--tomato);
|
||||
color: var(--butter-light);
|
||||
padding: 0.45rem 0.95rem;
|
||||
font-family: "Jost", sans-serif;
|
||||
font-size: 0.95rem;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.profile-cancel-btn {
|
||||
border: none;
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--tomato);
|
||||
color: var(--butter-light);
|
||||
padding: 0.45rem 0.95rem;
|
||||
font-family: "Jost", sans-serif;
|
||||
font-size: 0.95rem;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.profile-cancel-btn:hover,
|
||||
.profile-cancel-btn:focus-visible {
|
||||
background: var(--tomato-dark);
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 4px 10px rgba(188, 74, 52, 0.28);
|
||||
}
|
||||
|
||||
.profile-cancel-btn:active {
|
||||
transform: translateY(0);
|
||||
box-shadow: 0 2px 6px rgba(188, 74, 52, 0.25);
|
||||
}
|
||||
|
||||
.profile-unregister-btn:hover,
|
||||
.profile-unregister-btn:focus-visible {
|
||||
background: var(--tomato-dark);
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 4px 10px rgba(188, 74, 52, 0.28);
|
||||
}
|
||||
|
||||
.profile-unregister-btn:active {
|
||||
transform: translateY(0);
|
||||
box-shadow: 0 2px 6px rgba(188, 74, 52, 0.25);
|
||||
}
|
||||
|
||||
.profile-empty {
|
||||
margin: 0;
|
||||
color: var(--black);
|
||||
}
|
||||
|
||||
.profile-empty-state {
|
||||
text-align: center;
|
||||
padding: 2.4rem 1.3rem;
|
||||
border: 2px solid var(--olive-light);
|
||||
border-radius: var(--radius-lg);
|
||||
background: rgba(255, 255, 255, 0.92);
|
||||
box-shadow: 0 3px 12px rgba(102, 52, 13, 0.08);
|
||||
}
|
||||
|
||||
.profile-empty-kicker {
|
||||
margin: 0 0 0.5rem;
|
||||
color: var(--olive);
|
||||
font-size: 0.8rem;
|
||||
font-weight: 600;
|
||||
letter-spacing: var(--ls-label);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.profile-empty-state h3 {
|
||||
margin: 0;
|
||||
font-size: 1.5rem;
|
||||
color: var(--brown);
|
||||
}
|
||||
|
||||
.profile-empty-state p {
|
||||
margin: 0.65rem auto 1rem;
|
||||
max-width: 36rem;
|
||||
}
|
||||
|
||||
.form-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: var(--space-3);
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
display: block;
|
||||
margin-bottom: 0.35rem;
|
||||
font-size: 0.95rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.form-group input {
|
||||
width: 100%;
|
||||
border: 1px solid #d8d8d8;
|
||||
border-radius: var(--radius-sm);
|
||||
background: var(--white);
|
||||
padding: 0.7rem 0.85rem;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.form-group input:focus {
|
||||
outline: 2px solid rgba(107, 107, 5, 0.35);
|
||||
outline-offset: 1px;
|
||||
}
|
||||
|
||||
.input-hint {
|
||||
margin: 0.4rem 0 0;
|
||||
font-size: 0.9rem;
|
||||
color: #535353;
|
||||
}
|
||||
|
||||
.input-error {
|
||||
margin-top: 0.35rem;
|
||||
color: var(--error);
|
||||
font-size: 0.85rem;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.form-group.has-error .input-error {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.form-group.has-error input {
|
||||
border-color: var(--error);
|
||||
}
|
||||
|
||||
.profile-feedback {
|
||||
margin: 0.75rem 0 0;
|
||||
font-size: 0.95rem;
|
||||
color: var(--olive);
|
||||
min-height: 1.3rem;
|
||||
}
|
||||
|
||||
.profile-cta-row {
|
||||
display: flex;
|
||||
gap: var(--space-2);
|
||||
margin-top: var(--space-3);
|
||||
}
|
||||
|
||||
.profile-button-secondary {
|
||||
background: var(--tomato);
|
||||
}
|
||||
|
||||
.profile-button-secondary:hover {
|
||||
background: var(--tomato-dark);
|
||||
}
|
||||
|
||||
@media (max-width: 48rem) {
|
||||
.profile-page {
|
||||
padding-top: 5.5rem;
|
||||
}
|
||||
|
||||
.profile-hero {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.profile-logout {
|
||||
width: max-content;
|
||||
}
|
||||
|
||||
.form-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.profile-event-card {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.profile-event-actions {
|
||||
width: 100%;
|
||||
justify-content: flex-start;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
}
|
||||
@@ -210,6 +210,25 @@ p {
|
||||
color: var(--butter-light);
|
||||
}
|
||||
|
||||
/* Auth-Links in ausgeloggter Navigation: klarer Aktiv-/Default-Zustand. */
|
||||
.auth-nav-button--default {
|
||||
background: transparent;
|
||||
color: var(--olive);
|
||||
border: 2px solid var(--olive);
|
||||
}
|
||||
|
||||
.auth-nav-button--default:hover,
|
||||
.auth-nav-button--default:focus-visible {
|
||||
background: var(--olive-light);
|
||||
color: var(--black);
|
||||
}
|
||||
|
||||
.auth-nav-button--active {
|
||||
background: var(--olive);
|
||||
color: var(--butter-light);
|
||||
border: 2px solid var(--olive);
|
||||
}
|
||||
|
||||
.profile-pill {
|
||||
width: 2.375rem;
|
||||
height: 2.375rem;
|
||||
|
||||
+5
-2
@@ -3,8 +3,9 @@
|
||||
"id": 1,
|
||||
"title": "Italienische Tavolata",
|
||||
"location": "Luzern",
|
||||
"date": "19. MÄR. 2026",
|
||||
"time": "18:30 UHR",
|
||||
"address": "Pilatusstrasse 18, 6003 Luzern",
|
||||
"date": "11. APR. 2026",
|
||||
"time": "3:30 UHR",
|
||||
"category": "DINNER",
|
||||
"diet": "VEGGIE",
|
||||
"spots": 6,
|
||||
@@ -43,6 +44,7 @@
|
||||
"id": 2,
|
||||
"title": "Noche Peruana",
|
||||
"location": "Chur",
|
||||
"address": "Obere Gasse 41, 7000 Chur",
|
||||
"date": "11. APR. 2026",
|
||||
"time": "19:00 UHR",
|
||||
"category": "DINNER",
|
||||
@@ -84,6 +86,7 @@
|
||||
"id": 3,
|
||||
"title": "Japanese Delight",
|
||||
"location": "ZÜRICH",
|
||||
"address": "Limmatquai 92, 8001 Zürich",
|
||||
"date": "02. MAI. 2026",
|
||||
"time": "12:30 UHR",
|
||||
"category": "LUNCH",
|
||||
|
||||
+2
-3
@@ -9,6 +9,7 @@
|
||||
<link rel="stylesheet" href="css/event_create.css" />
|
||||
<!-- Globales Stylesheet -->
|
||||
<link rel="stylesheet" href="css/stylesheet_global.css">
|
||||
<script src="js/navigation.js" defer></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -19,9 +20,7 @@
|
||||
<img src="assets/logo_invite.svg" alt="Invite Logo">
|
||||
</a>
|
||||
<nav class="nav-tab-links" aria-label="Hauptnavigation">
|
||||
<a class="nav-tab" href="event_overview.html">Event finden</a>
|
||||
<a class="nav-tab" href="event_create.html">Event erstellen</a>
|
||||
<a class="button-small" href="login.html" aria-label="Profil">Login</a>
|
||||
<a class="button-small" href="login.html" aria-label="Login">Login</a>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
+2
-3
@@ -9,6 +9,7 @@
|
||||
<link rel="stylesheet" href="css/event_overview.css">
|
||||
<!-- Globales Stylesheet -->
|
||||
<link rel="stylesheet" href="css/stylesheet_global.css">
|
||||
<script src="js/navigation.js" defer></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -19,9 +20,7 @@
|
||||
<img src="assets/logo_invite.svg" alt="Invite Logo">
|
||||
</a>
|
||||
<nav class="nav-tab-links" aria-label="Hauptnavigation">
|
||||
<a class="nav-tab" href="event_overview.html">Event finden</a>
|
||||
<a class="nav-tab" href="event_create.html">Event erstellen</a>
|
||||
<a class="button-small" href="login.html" aria-label="Profil">Login</a>
|
||||
<a class="button-small" href="login.html" aria-label="Login">Login</a>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
+2
-3
@@ -9,6 +9,7 @@
|
||||
<link rel="stylesheet" href="css/event_overview.css">
|
||||
<!-- Globales Stylesheet -->
|
||||
<link rel="stylesheet" href="css/stylesheet_global.css">
|
||||
<script src="js/navigation.js" defer></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -19,9 +20,7 @@
|
||||
<img src="assets/logo_invite.svg" alt="Invite Logo">
|
||||
</a>
|
||||
<nav class="nav-tab-links" aria-label="Hauptnavigation">
|
||||
<a class="nav-tab" href="event_overview.html">Event finden</a>
|
||||
<a class="nav-tab" href="event_create.html">Event erstellen</a>
|
||||
<a class="button-small" href="login.html" aria-label="Profil">Login</a>
|
||||
<a class="button-small" href="login.html" aria-label="Login">Login</a>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
+3
-3
@@ -9,6 +9,7 @@
|
||||
<link rel="stylesheet" href="css/landingpage.css?v=2" />
|
||||
<!-- Globales Stylesheet -->
|
||||
<link rel="stylesheet" href="css/stylesheet_global.css?v=2">
|
||||
<script src="js/navigation.js" defer></script>
|
||||
|
||||
<!-- Font Awesome
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css" integrity="sha512-dU7ZrF1pFq5kVnPzlV9+04YhARzNjCX5Q5P1shgMpuN4s5I8mI8QD4981h7kYtV7sSgNldR0z5pZW5bS2ZpY3Q==" crossorigin="anonymous" referrerpolicy="no-referrer" /> -->
|
||||
@@ -22,9 +23,8 @@
|
||||
<img src="assets/logo_invite.svg" alt="Invite Logo">
|
||||
</a>
|
||||
<nav class="nav-tab-links" aria-label="Hauptnavigation">
|
||||
<a class="nav-tab" href="event_overview.html">Event finden</a>
|
||||
<a class="nav-tab" href="event_create.html">Event erstellen</a>
|
||||
<a class="button-small" href="login.html" aria-label="Profil">Login</a>
|
||||
<a class="button-small auth-nav-button auth-nav-button--default" href="login.html" aria-label="Login">Login</a>
|
||||
<a class="button-small auth-nav-button auth-nav-button--default" href="signup.html" aria-label="Signup">Signup</a>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
+18
-3
@@ -15,6 +15,7 @@ const usernameElement = document.getElementById("username");
|
||||
const flowFooter = document.getElementById("flowFooter");
|
||||
const submissionSuccess = document.getElementById("submissionSuccess");
|
||||
const EVENTS_STORAGE_KEY = "socialCookingEvents";
|
||||
const CURRENT_USER_KEY = "socialCookingCurrentUser";
|
||||
|
||||
// =============================
|
||||
// STATE: aktueller Schritt im Flow
|
||||
@@ -36,8 +37,20 @@ const nextLabels = {
|
||||
7: "Event veröffentlichen"
|
||||
};
|
||||
|
||||
// Demo-Wert: Später könnte der Name z. B. aus einem User-Profil kommen
|
||||
usernameElement.textContent = "Mia";
|
||||
// Liest den aktiven Benutzer aus localStorage und setzt den Anzeigenamen im Header.
|
||||
function getCurrentUser() {
|
||||
try {
|
||||
const raw = localStorage.getItem(CURRENT_USER_KEY);
|
||||
return raw ? JSON.parse(raw) : null;
|
||||
} catch (error) {
|
||||
console.error("Aktueller Benutzer konnte nicht gelesen werden:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
const currentUser = getCurrentUser();
|
||||
const displayName = currentUser?.vorname?.trim() || "Mia";
|
||||
usernameElement.textContent = displayName;
|
||||
|
||||
|
||||
// =============================
|
||||
@@ -409,13 +422,15 @@ function buildStoredEvent() {
|
||||
name: usernameElement.textContent.trim() || "Host",
|
||||
initial: (usernameElement.textContent.trim().charAt(0) || "H").toUpperCase()
|
||||
},
|
||||
hostEmail: currentUser?.email || "",
|
||||
hostMessage: [eventDescription],
|
||||
menu: buildMenuItems(menuDescription),
|
||||
specifications: getCheckboxValues("allergies") === "Keine Angabe"
|
||||
? []
|
||||
: getCheckboxValues("allergies").split(", ").filter(Boolean),
|
||||
allergiesNote: form.elements.allergiesOther.value.trim(),
|
||||
participants: [usernameElement.textContent.trim() || "Host"],
|
||||
// Host wird separat gefuehrt und nicht als angemeldeter Gast gezaehlt.
|
||||
participants: [],
|
||||
gallery: [],
|
||||
createdAt: new Date().toISOString(),
|
||||
source: "local"
|
||||
|
||||
+238
-4
@@ -1,10 +1,13 @@
|
||||
document.addEventListener('DOMContentLoaded', async () => {
|
||||
const EVENTS_STORAGE_KEY = 'socialCookingEvents';
|
||||
const CURRENT_USER_KEY = 'socialCookingCurrentUser';
|
||||
const REGISTRATION_STORAGE_KEY = 'socialCookingRegistrations';
|
||||
// -------------------------------------------------------------
|
||||
// DOM entry point and shared asset path.
|
||||
// -------------------------------------------------------------
|
||||
const detailContainer = document.getElementById('detail-view');
|
||||
const locationIconPath = 'assets/location-pin.svg';
|
||||
const currentUser = getCurrentUser();
|
||||
|
||||
// Read event id from query string (detail page deep-link support).
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
@@ -25,6 +28,159 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||
}
|
||||
}
|
||||
|
||||
function getCurrentUser() {
|
||||
try {
|
||||
const stored = localStorage.getItem(CURRENT_USER_KEY);
|
||||
return stored ? JSON.parse(stored) : null;
|
||||
} catch (error) {
|
||||
console.error('Aktueller Benutzer konnte nicht gelesen werden.', error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function getRegistrationMap() {
|
||||
try {
|
||||
const stored = localStorage.getItem(REGISTRATION_STORAGE_KEY);
|
||||
return stored ? JSON.parse(stored) : {};
|
||||
} catch (error) {
|
||||
console.error('Anmeldedaten konnten nicht gelesen werden.', error);
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
function setRegistrationMap(registrationMap) {
|
||||
localStorage.setItem(REGISTRATION_STORAGE_KEY, JSON.stringify(registrationMap));
|
||||
}
|
||||
|
||||
function parseEventDateTime(event) {
|
||||
if (!event?.date) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const dateValue = String(event.date).trim();
|
||||
const isoDateMatch = dateValue.match(/^(\d{4})-(\d{2})-(\d{2})$/);
|
||||
let year;
|
||||
let month;
|
||||
let day;
|
||||
|
||||
if (isoDateMatch) {
|
||||
year = Number(isoDateMatch[1]);
|
||||
month = Number(isoDateMatch[2]);
|
||||
day = Number(isoDateMatch[3]);
|
||||
} else {
|
||||
const monthMap = {
|
||||
JAN: 1,
|
||||
FEB: 2,
|
||||
'MÄR': 3,
|
||||
MRZ: 3,
|
||||
APR: 4,
|
||||
MAI: 5,
|
||||
JUN: 6,
|
||||
JUL: 7,
|
||||
AUG: 8,
|
||||
SEP: 9,
|
||||
OKT: 10,
|
||||
NOV: 11,
|
||||
DEZ: 12
|
||||
};
|
||||
const localizedMatch = dateValue.match(/^(\d{1,2})\.\s*([A-ZÄÖÜ]{3})\.\s*(\d{4})$/);
|
||||
|
||||
if (!localizedMatch) {
|
||||
return null;
|
||||
}
|
||||
|
||||
day = Number(localizedMatch[1]);
|
||||
month = monthMap[localizedMatch[2]];
|
||||
year = Number(localizedMatch[3]);
|
||||
|
||||
if (!month) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
const timeMatch = String(event.time || '').match(/(\d{1,2}):(\d{2})/);
|
||||
const hours = timeMatch ? Number(timeMatch[1]) : 0;
|
||||
const minutes = timeMatch ? Number(timeMatch[2]) : 0;
|
||||
|
||||
return new Date(year, month - 1, day, hours, minutes, 0, 0);
|
||||
}
|
||||
|
||||
function isRegistrationClosedForEvent(event) {
|
||||
const eventDateTime = parseEventDateTime(event);
|
||||
if (!eventDateTime || Number.isNaN(eventDateTime.getTime())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const msUntilStart = eventDateTime.getTime() - Date.now();
|
||||
const twelveHoursInMs = 12 * 60 * 60 * 1000;
|
||||
|
||||
return msUntilStart <= twelveHoursInMs;
|
||||
}
|
||||
|
||||
// Adresse ist nur im 12h-Fenster VOR Eventstart sichtbar.
|
||||
function isAddressVisibleWindow(event) {
|
||||
const eventDateTime = parseEventDateTime(event);
|
||||
if (!eventDateTime || Number.isNaN(eventDateTime.getTime())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const msUntilStart = eventDateTime.getTime() - Date.now();
|
||||
const twelveHoursInMs = 12 * 60 * 60 * 1000;
|
||||
|
||||
return msUntilStart >= 0 && msUntilStart <= twelveHoursInMs;
|
||||
}
|
||||
|
||||
function countRegistrationsForEvent(registrationMap, eventId) {
|
||||
return Object.values(registrationMap).reduce((count, ids) => {
|
||||
const hasEvent = Array.isArray(ids)
|
||||
&& ids.map(id => Number(id)).includes(Number(eventId));
|
||||
|
||||
return hasEvent ? count + 1 : count;
|
||||
}, 0);
|
||||
}
|
||||
|
||||
// Ermittelt, ob das Event vom aktuell eingeloggten Benutzer erstellt wurde.
|
||||
function isEventOwnedByCurrentUser(event, user) {
|
||||
if (!event || !user) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const userEmail = String(user.email || '').trim().toLowerCase();
|
||||
const hostEmail = String(event.hostEmail || '').trim().toLowerCase();
|
||||
|
||||
if (userEmail && hostEmail) {
|
||||
return userEmail === hostEmail;
|
||||
}
|
||||
|
||||
// Fallback fuer aeltere Datensaetze ohne hostEmail.
|
||||
const userFirstName = String(user.vorname || '').trim().toLowerCase();
|
||||
const hostName = String(event.host?.name || '').trim().toLowerCase();
|
||||
return Boolean(userFirstName && hostName && userFirstName === hostName);
|
||||
}
|
||||
|
||||
// Prueft, ob der aktuelle Benutzer bereits in der Teilnehmerliste des Events steht.
|
||||
function isUserListedInEventParticipants(event, user) {
|
||||
if (!event || !user || !Array.isArray(event.participants)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const participantSet = new Set(
|
||||
event.participants
|
||||
.map(name => String(name || '').trim().toLowerCase())
|
||||
.filter(Boolean)
|
||||
);
|
||||
|
||||
const userFirstName = String(user.vorname || '').trim().toLowerCase();
|
||||
const userFullName = `${String(user.vorname || '').trim()} ${String(user.nachname || '').trim()}`
|
||||
.trim()
|
||||
.toLowerCase();
|
||||
|
||||
return Boolean(
|
||||
(userFirstName && participantSet.has(userFirstName))
|
||||
|| (userFullName && participantSet.has(userFullName))
|
||||
);
|
||||
}
|
||||
|
||||
// Fetch data source and resolve the matching event record.
|
||||
try {
|
||||
const response = await fetch('data/events.json');
|
||||
@@ -111,11 +267,47 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||
? event.gallery
|
||||
: [event.image, event.image, event.image];
|
||||
const visibleParticipants = participants.slice(0, 6);
|
||||
const remainingParticipants = Math.max(0, participants.length - visibleParticipants.length);
|
||||
const registrationMap = getRegistrationMap();
|
||||
const extraRegistrations = countRegistrationsForEvent(registrationMap, event.id);
|
||||
const remainingParticipants = Math.max(0, participants.length + extraRegistrations - visibleParticipants.length);
|
||||
const totalGuests = Number.isFinite(event.spots) ? event.spots : 0;
|
||||
const confirmedGuests = participants.length;
|
||||
const confirmedGuests = participants.length + extraRegistrations;
|
||||
const freePlaces = Math.max(0, totalGuests - confirmedGuests);
|
||||
const isFull = freePlaces === 0;
|
||||
const isRegistrationClosed = isRegistrationClosedForEvent(event);
|
||||
const isOwnEvent = isEventOwnedByCurrentUser(event, currentUser);
|
||||
const userRegistrations = currentUser?.email && Array.isArray(registrationMap[currentUser.email])
|
||||
? registrationMap[currentUser.email].map(id => Number(id))
|
||||
: [];
|
||||
const isRegistered = userRegistrations.includes(Number(event.id));
|
||||
const isListedParticipant = isUserListedInEventParticipants(event, currentUser);
|
||||
const hasAddressAccess = isRegistered || isListedParticipant;
|
||||
const actionButtonLabel = isOwnEvent
|
||||
? 'Dein Event!'
|
||||
: !currentUser
|
||||
? 'Einloggen'
|
||||
: isRegistered
|
||||
? 'Abmelden'
|
||||
: isRegistrationClosed
|
||||
? 'Anmeldung geschlossen'
|
||||
: 'Anmelden';
|
||||
const actionButtonDisabled = isOwnEvent || (!isRegistered && (isFull || isRegistrationClosed));
|
||||
const actionButtonVariantClass = isOwnEvent
|
||||
? ' detail-primary-btn-own'
|
||||
: isRegistered
|
||||
? ' detail-primary-btn-danger'
|
||||
: isRegistrationClosed
|
||||
? ' detail-primary-btn-danger'
|
||||
: ' detail-primary-btn-register';
|
||||
const shouldRevealAddress = Boolean(event.address) && isAddressVisibleWindow(event) && hasAddressAccess;
|
||||
const addressPanelMarkup = shouldRevealAddress
|
||||
? `
|
||||
<article class="detail-panel detail-panel-compact">
|
||||
<h2 class="detail-section-title">Adresse</h2>
|
||||
<p>${event.address}</p>
|
||||
</article>
|
||||
`
|
||||
: '';
|
||||
const detailChips = [
|
||||
`<span class="event-tag">${eventCategory}</span>`,
|
||||
`<span class="event-tag">${dietLabel}</span>`,
|
||||
@@ -173,6 +365,8 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||
${remainingParticipants > 0 ? `<span class="participant-more">+${remainingParticipants}</span>` : ''}
|
||||
</div>
|
||||
</article>
|
||||
|
||||
${addressPanelMarkup}
|
||||
</div>
|
||||
|
||||
<div class="detail-gallery detail-gallery-large">
|
||||
@@ -200,8 +394,8 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||
<span class="detail-spots-pill${isFull ? ' detail-spots-pill-full' : ''}">
|
||||
${isFull ? 'AUSGEBUCHT' : `${freePlaces} Plaetze frei`}
|
||||
</span>
|
||||
<button class="detail-primary-btn" type="button" ${isFull ? 'disabled' : ''}>
|
||||
Anmelden
|
||||
<button class="detail-primary-btn${actionButtonVariantClass}" type="button" data-register-button ${actionButtonDisabled ? 'disabled' : ''}>
|
||||
${actionButtonLabel}
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
@@ -224,6 +418,46 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||
const lightboxImage = detailContainer.querySelector('.detail-lightbox-image');
|
||||
const lightboxClose = detailContainer.querySelector('.detail-lightbox-close');
|
||||
const galleryButtons = detailContainer.querySelectorAll('.detail-gallery-item');
|
||||
const registerButton = detailContainer.querySelector('[data-register-button]');
|
||||
|
||||
// Harte Absicherung: Eigene Events sind auf der Detailseite immer deaktiviert.
|
||||
if (registerButton && isOwnEvent) {
|
||||
registerButton.disabled = true;
|
||||
registerButton.textContent = 'Dein Event!';
|
||||
registerButton.setAttribute('aria-disabled', 'true');
|
||||
}
|
||||
|
||||
// Anmeldung toggeln und im lokalen Registrierungs-Store persistieren.
|
||||
if (registerButton) {
|
||||
registerButton.addEventListener('click', () => {
|
||||
if (isOwnEvent) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!currentUser || !currentUser.email) {
|
||||
window.location.href = 'login.html';
|
||||
return;
|
||||
}
|
||||
|
||||
const nextRegistrationMap = getRegistrationMap();
|
||||
const currentList = Array.isArray(nextRegistrationMap[currentUser.email])
|
||||
? nextRegistrationMap[currentUser.email].map(id => Number(id))
|
||||
: [];
|
||||
const registrationSet = new Set(currentList);
|
||||
|
||||
if (registrationSet.has(Number(event.id))) {
|
||||
registrationSet.delete(Number(event.id));
|
||||
} else if (!isFull && !isRegistrationClosed) {
|
||||
registrationSet.add(Number(event.id));
|
||||
}
|
||||
|
||||
nextRegistrationMap[currentUser.email] = Array.from(registrationSet);
|
||||
setRegistrationMap(nextRegistrationMap);
|
||||
|
||||
// Re-Render aktualisiert Buttonzustand und CTA ohne Seitenreload.
|
||||
renderDetailPage(event);
|
||||
});
|
||||
}
|
||||
|
||||
// Central close helper to keep all close paths consistent.
|
||||
function closeLightbox() {
|
||||
|
||||
+200
-4
@@ -1,5 +1,7 @@
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const EVENTS_STORAGE_KEY = 'socialCookingEvents';
|
||||
const CURRENT_USER_KEY = 'socialCookingCurrentUser';
|
||||
const REGISTRATION_STORAGE_KEY = 'socialCookingRegistrations';
|
||||
// -------------------------------------------------------------
|
||||
// DOM references used throughout the page lifecycle.
|
||||
// -------------------------------------------------------------
|
||||
@@ -14,6 +16,35 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
// -------------------------------------------------------------
|
||||
let allEvents = [];
|
||||
let activeCategory = 'ALLE';
|
||||
const currentUser = getCurrentUser();
|
||||
|
||||
function getCurrentUser() {
|
||||
try {
|
||||
const stored = localStorage.getItem(CURRENT_USER_KEY);
|
||||
return stored ? JSON.parse(stored) : null;
|
||||
} catch (error) {
|
||||
console.error('Aktueller Benutzer konnte nicht gelesen werden.', error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Prueft, ob ein Event dem aktuellen Benutzer gehoert.
|
||||
function isEventOwnedByCurrentUser(event, user) {
|
||||
if (!event || !user) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const userEmail = String(user.email || '').trim().toLowerCase();
|
||||
const hostEmail = String(event.hostEmail || '').trim().toLowerCase();
|
||||
|
||||
if (userEmail && hostEmail) {
|
||||
return userEmail === hostEmail;
|
||||
}
|
||||
|
||||
const userFirstName = String(user.vorname || '').trim().toLowerCase();
|
||||
const hostName = String(event.host?.name || '').trim().toLowerCase();
|
||||
return Boolean(userFirstName && hostName && userFirstName === hostName);
|
||||
}
|
||||
|
||||
function getStoredEvents() {
|
||||
try {
|
||||
@@ -25,6 +56,20 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
}
|
||||
}
|
||||
|
||||
function getRegistrationMap() {
|
||||
try {
|
||||
const stored = localStorage.getItem(REGISTRATION_STORAGE_KEY);
|
||||
return stored ? JSON.parse(stored) : {};
|
||||
} catch (error) {
|
||||
console.error('Anmeldedaten konnten nicht gelesen werden.', error);
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
function setRegistrationMap(registrationMap) {
|
||||
localStorage.setItem(REGISTRATION_STORAGE_KEY, JSON.stringify(registrationMap));
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------
|
||||
// Initial data bootstrap:
|
||||
// 1) fetch JSON,
|
||||
@@ -153,6 +198,83 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
: `${timeString} Uhr`;
|
||||
}
|
||||
|
||||
// Baut aus Eventdatum/-zeit ein Date-Objekt fuer Fristlogik und Vergleiche.
|
||||
function parseEventDateTime(event) {
|
||||
if (!event?.date) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const dateValue = String(event.date).trim();
|
||||
const isoDateMatch = dateValue.match(/^(\d{4})-(\d{2})-(\d{2})$/);
|
||||
let year;
|
||||
let month;
|
||||
let day;
|
||||
|
||||
if (isoDateMatch) {
|
||||
year = Number(isoDateMatch[1]);
|
||||
month = Number(isoDateMatch[2]);
|
||||
day = Number(isoDateMatch[3]);
|
||||
} else {
|
||||
const monthMap = {
|
||||
JAN: 1,
|
||||
FEB: 2,
|
||||
'MÄR': 3,
|
||||
MRZ: 3,
|
||||
APR: 4,
|
||||
MAI: 5,
|
||||
JUN: 6,
|
||||
JUL: 7,
|
||||
AUG: 8,
|
||||
SEP: 9,
|
||||
OKT: 10,
|
||||
NOV: 11,
|
||||
DEZ: 12
|
||||
};
|
||||
const localizedMatch = dateValue.match(/^(\d{1,2})\.\s*([A-ZÄÖÜ]{3})\.\s*(\d{4})$/);
|
||||
|
||||
if (!localizedMatch) {
|
||||
return null;
|
||||
}
|
||||
|
||||
day = Number(localizedMatch[1]);
|
||||
month = monthMap[localizedMatch[2]];
|
||||
year = Number(localizedMatch[3]);
|
||||
|
||||
if (!month) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
const timeMatch = String(event.time || '').match(/(\d{1,2}):(\d{2})/);
|
||||
const hours = timeMatch ? Number(timeMatch[1]) : 0;
|
||||
const minutes = timeMatch ? Number(timeMatch[2]) : 0;
|
||||
|
||||
return new Date(year, month - 1, day, hours, minutes, 0, 0);
|
||||
}
|
||||
|
||||
// Zaehlt eindeutige Registrierungen eines Events ueber alle Benutzer.
|
||||
function countRegistrationsForEvent(registrationMap, eventId) {
|
||||
return Object.values(registrationMap).reduce((count, ids) => {
|
||||
const hasEvent = Array.isArray(ids)
|
||||
&& ids.map(id => Number(id)).includes(Number(eventId));
|
||||
|
||||
return hasEvent ? count + 1 : count;
|
||||
}, 0);
|
||||
}
|
||||
|
||||
// Schliesst neue Anmeldungen ab 12h vor Start (inkl. bereits gestarteter Events).
|
||||
function isRegistrationClosedForEvent(event) {
|
||||
const eventDateTime = parseEventDateTime(event);
|
||||
if (!eventDateTime || Number.isNaN(eventDateTime.getTime())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const msUntilStart = eventDateTime.getTime() - Date.now();
|
||||
const twelveHoursInMs = 12 * 60 * 60 * 1000;
|
||||
|
||||
return msUntilStart <= twelveHoursInMs;
|
||||
}
|
||||
|
||||
// Safely verify whether a value exists in the given select element.
|
||||
function hasOption(selectElement, value) {
|
||||
return Array.from(selectElement.options).some(option => option.value === value);
|
||||
@@ -172,6 +294,11 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
});
|
||||
|
||||
const filtered = allEvents.filter(event => {
|
||||
// Lokal erstellte Events werden nicht in der allgemeinen Event-Uebersicht angezeigt.
|
||||
if (event.source === 'local') {
|
||||
return false;
|
||||
}
|
||||
|
||||
const categoryMatch = activeCategory === 'ALLE' || event.category === activeCategory;
|
||||
const locationMatch = selectedLocation === 'ALLE_ORTE' || event.location === selectedLocation;
|
||||
const eventDateIso = parseEventDateToIso(event.date);
|
||||
@@ -192,6 +319,10 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
// - or event cards with status and metadata.
|
||||
function renderEvents(events) {
|
||||
eventGrid.innerHTML = '';
|
||||
const registrationMap = getRegistrationMap();
|
||||
const userRegistrationSet = currentUser?.email && Array.isArray(registrationMap[currentUser.email])
|
||||
? new Set(registrationMap[currentUser.email].map(id => Number(id)))
|
||||
: new Set();
|
||||
|
||||
if (events.length === 0) {
|
||||
eventGrid.innerHTML = `
|
||||
@@ -212,25 +343,46 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
const card = document.createElement('article');
|
||||
card.className = 'event-card';
|
||||
card.style.cursor = 'pointer';
|
||||
card.onclick = () => {
|
||||
card.addEventListener('click', clickedEvent => {
|
||||
if (clickedEvent.target instanceof HTMLElement && clickedEvent.target.closest('button')) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.location.href = `event_detail.html?id=${event.id}`;
|
||||
};
|
||||
});
|
||||
|
||||
const displayDate = formatEventDate(event.date);
|
||||
const displayTime = formatEventTime(event.time);
|
||||
|
||||
// Capacity logic:
|
||||
// spots = total capacity, participants.length = booked seats.
|
||||
const bookedSeats = event.participants ? event.participants.length : 0;
|
||||
const baseParticipants = Array.isArray(event.participants) ? event.participants.length : 0;
|
||||
const extraRegistrations = countRegistrationsForEvent(registrationMap, event.id);
|
||||
const bookedSeats = baseParticipants + extraRegistrations;
|
||||
const totalCapacity = event.spots;
|
||||
const freePlaces = Math.max(0, totalCapacity - bookedSeats);
|
||||
const isFull = freePlaces === 0;
|
||||
const isOwnEvent = isEventOwnedByCurrentUser(event, currentUser);
|
||||
const isRegistered = userRegistrationSet.has(Number(event.id));
|
||||
const isRegistrationClosed = isRegistrationClosedForEvent(event);
|
||||
|
||||
// Build optional specification chips only when data exists.
|
||||
const specsChips = event.specifications && event.specifications.length > 0
|
||||
? event.specifications.map(spec => `<span class="event-tag">${spec}</span>`).join('')
|
||||
: '';
|
||||
|
||||
const actionMarkup = isOwnEvent
|
||||
? '<button class="btn-primary btn-primary-own" type="button" data-registration-action="own" disabled>Dein Event!</button>'
|
||||
: isRegistered
|
||||
? '<button class="btn-primary btn-primary-danger" type="button" data-registration-action="unregister">Abmelden</button>'
|
||||
: isRegistrationClosed
|
||||
? '<button class="btn-primary btn-primary-danger" type="button" data-registration-action="closed" disabled>Anmeldung geschlossen</button>'
|
||||
: isFull
|
||||
? ''
|
||||
: !currentUser
|
||||
? '<button class="btn-primary btn-primary-register" type="button" data-registration-action="login">Anmelden</button>'
|
||||
: '<button class="btn-primary btn-primary-register" type="button" data-registration-action="register">Anmelden</button>';
|
||||
|
||||
card.innerHTML = `
|
||||
<div class="event-main">
|
||||
<div class="event-top-row">
|
||||
@@ -249,10 +401,54 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
</div>
|
||||
<div class="event-side${isFull ? ' event-side-full' : ''}">
|
||||
<span class="event-spots${isFull ? ' event-spots-full' : ''}">${isFull ? 'AUSGEBUCHT' : `${freePlaces} Plätze FREI`}</span>
|
||||
${isFull ? '' : '<button class="btn-primary" type="button">Anmelden</button>'}
|
||||
${actionMarkup}
|
||||
</div>
|
||||
`;
|
||||
|
||||
const actionButton = card.querySelector('[data-registration-action]');
|
||||
if (actionButton) {
|
||||
actionButton.addEventListener('click', clickEvent => {
|
||||
clickEvent.stopPropagation();
|
||||
|
||||
const action = actionButton.getAttribute('data-registration-action');
|
||||
if (action === 'own') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (action === 'closed') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (action === 'login') {
|
||||
window.location.href = 'login.html';
|
||||
return;
|
||||
}
|
||||
|
||||
if (!currentUser?.email) {
|
||||
window.location.href = 'login.html';
|
||||
return;
|
||||
}
|
||||
|
||||
const nextRegistrationMap = getRegistrationMap();
|
||||
const currentIds = Array.isArray(nextRegistrationMap[currentUser.email])
|
||||
? nextRegistrationMap[currentUser.email].map(id => Number(id))
|
||||
: [];
|
||||
const idSet = new Set(currentIds);
|
||||
|
||||
if (action === 'unregister') {
|
||||
idSet.delete(Number(event.id));
|
||||
}
|
||||
|
||||
if (action === 'register' && !isFull && !isRegistrationClosed) {
|
||||
idSet.add(Number(event.id));
|
||||
}
|
||||
|
||||
nextRegistrationMap[currentUser.email] = Array.from(idSet);
|
||||
setRegistrationMap(nextRegistrationMap);
|
||||
applyFilters();
|
||||
});
|
||||
}
|
||||
|
||||
eventGrid.appendChild(card);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,30 +1,45 @@
|
||||
// =============================================
|
||||
// Galerie-Karussell (Startseite)
|
||||
// Diese Datei steuert die Foto-Galerie mit Pfeilen.
|
||||
// =============================================
|
||||
|
||||
// Wichtige Elemente aus dem HTML holen.
|
||||
const carouselTrack = document.querySelector('.gallery__track');
|
||||
const prevArrow = document.querySelector('.gallery__arrow--prev');
|
||||
const nextArrow = document.querySelector('.gallery__arrow--next');
|
||||
|
||||
// Nur ausfuehren, wenn die Galerie auf der Seite vorhanden ist.
|
||||
if (carouselTrack) {
|
||||
// Alle einzelnen Karten/Bilder im Track sammeln.
|
||||
const items = Array.from(carouselTrack.querySelectorAll('.gallery__item'));
|
||||
|
||||
// Auf Mobile zeigen wir 1 Bild, auf Desktop 3 Bilder pro "Seite".
|
||||
const getItemsPerPage = () => (window.matchMedia('(max-width: 900px)').matches ? 1 : 3);
|
||||
let itemsPerPage = getItemsPerPage();
|
||||
const pageCount = Math.ceil(items.length / itemsPerPage);
|
||||
let activePage = 0;
|
||||
|
||||
// Scrollt den Track auf eine bestimmte Seite.
|
||||
function scrollToPage(page) {
|
||||
activePage = page;
|
||||
const pageWidth = carouselTrack.clientWidth;
|
||||
carouselTrack.scrollTo({ left: pageWidth * page, behavior: 'smooth' });
|
||||
}
|
||||
|
||||
// Geht zur naechsten Seite (mit Wrap-around am Ende).
|
||||
function showNext() {
|
||||
activePage = (activePage + 1) % pageCount;
|
||||
scrollToPage(activePage);
|
||||
}
|
||||
|
||||
// Geht zur vorherigen Seite (mit Wrap-around zum Ende).
|
||||
function showPrev() {
|
||||
activePage = (activePage - 1 + pageCount) % pageCount;
|
||||
scrollToPage(activePage);
|
||||
}
|
||||
|
||||
// Wenn sich bei Resize die Karten-Anzahl pro Seite aendert,
|
||||
// laden wir die Seite neu, damit Layout und Seitenzahl wieder stimmen.
|
||||
function refreshCarousel() {
|
||||
const responsiveItemsPerPage = getItemsPerPage();
|
||||
if (responsiveItemsPerPage !== itemsPerPage) {
|
||||
@@ -33,9 +48,11 @@ if (carouselTrack) {
|
||||
}
|
||||
}
|
||||
|
||||
// Klick-Steuerung der Pfeile.
|
||||
if (nextArrow) nextArrow.addEventListener('click', showNext);
|
||||
if (prevArrow) prevArrow.addEventListener('click', showPrev);
|
||||
|
||||
// Tastatur-Support fuer Barrierefreiheit.
|
||||
document.addEventListener('keydown', (event) => {
|
||||
if (event.key === 'ArrowRight') {
|
||||
showNext();
|
||||
@@ -45,6 +62,7 @@ if (carouselTrack) {
|
||||
}
|
||||
});
|
||||
|
||||
// Reagiert auf Bildschirmgroessen-Aenderungen.
|
||||
window.addEventListener('resize', () => {
|
||||
refreshCarousel();
|
||||
scrollToPage(activePage);
|
||||
|
||||
+19
-3
@@ -1,8 +1,18 @@
|
||||
// =============================================
|
||||
// Mini-Galerie auf der Landingpage
|
||||
// Diese Datei hebt immer ein Bild hervor und
|
||||
// erlaubt Navigation mit Pfeilen/Tastatur.
|
||||
// =============================================
|
||||
|
||||
// Elemente aus dem DOM lesen.
|
||||
const prevBtn = document.querySelector('.arrow--prev');
|
||||
const nextBtn = document.querySelector('.arrow--next');
|
||||
const items = Array.from(document.querySelectorAll('.gallery__item'));
|
||||
let activeIndex = 0;
|
||||
|
||||
// Aktualisiert die Darstellung aller Bilder:
|
||||
// - aktives Bild ist klar sichtbar
|
||||
// - inaktive Bilder sind abgeblendet
|
||||
function updateGallery() {
|
||||
items.forEach((item, i) => {
|
||||
item.style.opacity = i === activeIndex ? '1' : '0.35';
|
||||
@@ -10,20 +20,25 @@ function updateGallery() {
|
||||
});
|
||||
}
|
||||
|
||||
// Ein Schritt nach rechts.
|
||||
function showNext() {
|
||||
if (!items.length) return;
|
||||
activeIndex = (activeIndex + 1) % items.length;
|
||||
updateGallery();
|
||||
}
|
||||
|
||||
// Ein Schritt nach links.
|
||||
function showPrev() {
|
||||
if (!items.length) return;
|
||||
activeIndex = (activeIndex - 1 + items.length) % items.length;
|
||||
updateGallery();
|
||||
}
|
||||
|
||||
nextBtn.addEventListener('click', showNext);
|
||||
prevBtn.addEventListener('click', showPrev);
|
||||
// Event-Handler nur registrieren, wenn die Buttons existieren.
|
||||
if (nextBtn) nextBtn.addEventListener('click', showNext);
|
||||
if (prevBtn) prevBtn.addEventListener('click', showPrev);
|
||||
|
||||
// keyboard support
|
||||
// Tastatursteuerung fuer bessere Bedienbarkeit.
|
||||
document.addEventListener('keydown', (event) => {
|
||||
if (event.key === 'ArrowRight') {
|
||||
showNext();
|
||||
@@ -33,4 +48,5 @@ document.addEventListener('keydown', (event) => {
|
||||
}
|
||||
});
|
||||
|
||||
// Initialen Zustand einmal setzen.
|
||||
updateGallery();
|
||||
+59
-3
@@ -1,9 +1,52 @@
|
||||
// =============================================
|
||||
// Login-Logik
|
||||
// Diese Datei validiert die Eingaben, sucht den
|
||||
// Benutzer im localStorage und legt die Session an.
|
||||
// =============================================
|
||||
|
||||
// Formular und Felder aus dem HTML holen.
|
||||
const loginForm = document.getElementById('loginForm');
|
||||
const emailInput = document.getElementById('email');
|
||||
const passwortInput = document.getElementById('passwort');
|
||||
const emailError = document.getElementById('emailError');
|
||||
const passwortError = document.getElementById('passwortError');
|
||||
|
||||
const USERS_STORAGE_KEY = 'socialCookingUsers';
|
||||
const CURRENT_USER_KEY = 'socialCookingCurrentUser';
|
||||
|
||||
// Liest alle registrierten Benutzer robust aus localStorage.
|
||||
function getStoredUsers() {
|
||||
try {
|
||||
const raw = localStorage.getItem(USERS_STORAGE_KEY);
|
||||
return raw ? JSON.parse(raw) : [];
|
||||
} catch (error) {
|
||||
console.error('Benutzerdaten konnten nicht gelesen werden.', error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
// Speichert den aktiven Benutzer fuer nachfolgende Seiten.
|
||||
function setCurrentUser(user) {
|
||||
localStorage.setItem(CURRENT_USER_KEY, JSON.stringify(user));
|
||||
}
|
||||
|
||||
// Erstellt einen Demo-Benutzer, falls fuer die E-Mail noch kein Account existiert.
|
||||
function createFallbackUser(email, passwort) {
|
||||
const localPart = email.split('@')[0] || 'Gast';
|
||||
const normalized = localPart.replace(/[._-]/g, ' ').trim();
|
||||
const guessedVorname = normalized ? normalized.split(' ')[0] : 'Gast';
|
||||
|
||||
return {
|
||||
id: Date.now(),
|
||||
vorname: guessedVorname.charAt(0).toUpperCase() + guessedVorname.slice(1),
|
||||
nachname: '',
|
||||
email,
|
||||
passwort,
|
||||
createdAt: new Date().toISOString(),
|
||||
source: 'login-fallback'
|
||||
};
|
||||
}
|
||||
|
||||
// Validierungsfunktion
|
||||
function validateForm(event) {
|
||||
event.preventDefault();
|
||||
@@ -43,11 +86,24 @@ function validateForm(event) {
|
||||
passwortGroup.classList.remove('has-error');
|
||||
}
|
||||
|
||||
// Wenn alle Validierungen bestanden, Form absenden
|
||||
// Wenn alle Validierungen bestanden, pruefen wir:
|
||||
// 1) gibt es den Benutzer schon?
|
||||
// 2) ist das Passwort korrekt?
|
||||
// Danach speichern wir die aktive Session.
|
||||
if (isValid) {
|
||||
//alert('Login erfolgreich! (Dies ist eine Demo)');
|
||||
const users = getStoredUsers();
|
||||
const matchedUser = users.find(user => user.email?.toLowerCase() === emailValue.toLowerCase());
|
||||
|
||||
// Weiterleitung zur event overview Page
|
||||
if (matchedUser && matchedUser.passwort !== passwortValue) {
|
||||
passwortGroup.classList.add('has-error');
|
||||
passwortError.textContent = 'Das Passwort ist nicht korrekt.';
|
||||
return;
|
||||
}
|
||||
|
||||
const userToLogin = matchedUser || createFallbackUser(emailValue, passwortValue);
|
||||
setCurrentUser(userToLogin);
|
||||
|
||||
// Nach erfolgreichem Login geht es zur Event-Uebersicht.
|
||||
window.location.href = 'event_overview.html';
|
||||
}
|
||||
}
|
||||
|
||||
+584
@@ -0,0 +1,584 @@
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const EVENTS_STORAGE_KEY = 'socialCookingEvents';
|
||||
const USERS_STORAGE_KEY = 'socialCookingUsers';
|
||||
const CURRENT_USER_KEY = 'socialCookingCurrentUser';
|
||||
const REGISTRATION_STORAGE_KEY = 'socialCookingRegistrations';
|
||||
|
||||
// Zentrale DOM-Referenzen fuer klare, testbare Funktionen.
|
||||
const loggedOutState = document.getElementById('logged-out-state');
|
||||
const loggedInContent = document.getElementById('logged-in-content');
|
||||
const profileHeadline = document.getElementById('profile-headline');
|
||||
const profileSubline = document.getElementById('profile-subline');
|
||||
const logoutButton = document.getElementById('logout-button');
|
||||
const profileTabButtons = Array.from(document.querySelectorAll('[data-profile-tab]'));
|
||||
const profileTabPanels = Array.from(document.querySelectorAll('[data-profile-panel]'));
|
||||
|
||||
const myEventsCount = document.getElementById('my-events-count');
|
||||
const myRegistrationsCount = document.getElementById('my-registrations-count');
|
||||
const myEventsList = document.getElementById('my-events-list');
|
||||
const myRegistrationsList = document.getElementById('my-registrations-list');
|
||||
|
||||
const profileForm = document.getElementById('profile-form');
|
||||
const profileFeedback = document.getElementById('profile-feedback');
|
||||
const vornameInput = document.getElementById('vorname');
|
||||
const nachnameInput = document.getElementById('nachname');
|
||||
const emailInput = document.getElementById('email');
|
||||
const passwortInput = document.getElementById('passwort');
|
||||
|
||||
let currentUser = getCurrentUser();
|
||||
let allEvents = [];
|
||||
|
||||
init();
|
||||
|
||||
async function init() {
|
||||
if (!currentUser) {
|
||||
renderLoggedOutState();
|
||||
return;
|
||||
}
|
||||
|
||||
renderLoggedInState(currentUser);
|
||||
bindFormHandlers();
|
||||
activateProfileTab('hosting');
|
||||
|
||||
allEvents = await loadAllEvents();
|
||||
renderMyEvents(allEvents, currentUser);
|
||||
renderMyRegistrations(allEvents, currentUser);
|
||||
}
|
||||
|
||||
// Liest den aktuell eingeloggten Benutzer robust aus dem Storage.
|
||||
function getCurrentUser() {
|
||||
try {
|
||||
const raw = localStorage.getItem(CURRENT_USER_KEY);
|
||||
return raw ? JSON.parse(raw) : null;
|
||||
} catch (error) {
|
||||
console.error('Der aktuelle Benutzer konnte nicht geladen werden.', error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Liest lokal erstellte Events aus dem Storage.
|
||||
function getStoredEvents() {
|
||||
try {
|
||||
const raw = localStorage.getItem(EVENTS_STORAGE_KEY);
|
||||
return raw ? JSON.parse(raw) : [];
|
||||
} catch (error) {
|
||||
console.error('Lokale Events konnten nicht gelesen werden.', error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
// Liest den Anmeldestatus pro Benutzer-E-Mail.
|
||||
function getRegistrationMap() {
|
||||
try {
|
||||
const raw = localStorage.getItem(REGISTRATION_STORAGE_KEY);
|
||||
return raw ? JSON.parse(raw) : {};
|
||||
} catch (error) {
|
||||
console.error('Anmeldedaten konnten nicht gelesen werden.', error);
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
// Schreibt den gesamten Registrierungszustand in localStorage.
|
||||
function setRegistrationMap(registrationMap) {
|
||||
localStorage.setItem(REGISTRATION_STORAGE_KEY, JSON.stringify(registrationMap));
|
||||
}
|
||||
|
||||
// Schreibt die lokal erstellten Events in den Storage.
|
||||
function setStoredEvents(events) {
|
||||
localStorage.setItem(EVENTS_STORAGE_KEY, JSON.stringify(events));
|
||||
}
|
||||
|
||||
// Fuehrt JSON-Daten und lokal erstellte Events in einer Liste zusammen.
|
||||
async function loadAllEvents() {
|
||||
try {
|
||||
const response = await fetch('data/events.json');
|
||||
const apiEvents = await response.json();
|
||||
return [...getStoredEvents(), ...apiEvents];
|
||||
} catch (error) {
|
||||
console.error('Events konnten nicht geladen werden.', error);
|
||||
return getStoredEvents();
|
||||
}
|
||||
}
|
||||
|
||||
// Schaltet in den ausgeloggten Zustand und blendet geschuetzte Inhalte aus.
|
||||
function renderLoggedOutState() {
|
||||
loggedOutState.classList.remove('hidden');
|
||||
loggedInContent.classList.add('hidden');
|
||||
logoutButton.classList.add('hidden');
|
||||
profileHeadline.textContent = 'Mein Profil';
|
||||
profileSubline.textContent = 'Bitte logge dich ein, um deinen Bereich zu sehen.';
|
||||
}
|
||||
|
||||
// Fuellt Ueberschriften und Formular mit den aktuellen Benutzerdaten.
|
||||
function renderLoggedInState(user) {
|
||||
loggedOutState.classList.add('hidden');
|
||||
loggedInContent.classList.remove('hidden');
|
||||
logoutButton.classList.remove('hidden');
|
||||
|
||||
profileHeadline.textContent = `Hallo ${user.vorname || 'Gast'}`;
|
||||
profileSubline.textContent = 'Hier kannst du deine Events und Anmeldungen verwalten.';
|
||||
|
||||
vornameInput.value = user.vorname || '';
|
||||
nachnameInput.value = user.nachname || '';
|
||||
emailInput.value = user.email || '';
|
||||
}
|
||||
|
||||
// Bindet Submit-, Input- und Logout-Verhalten an die Profilseite.
|
||||
function bindFormHandlers() {
|
||||
profileForm.addEventListener('submit', handleProfileSubmit);
|
||||
myRegistrationsList.addEventListener('click', handleRegistrationListClick);
|
||||
myEventsList.addEventListener('click', handleHostedListClick);
|
||||
|
||||
profileTabButtons.forEach(button => {
|
||||
button.addEventListener('click', () => {
|
||||
const tabName = button.getAttribute('data-profile-tab');
|
||||
if (!tabName) {
|
||||
return;
|
||||
}
|
||||
|
||||
activateProfileTab(tabName);
|
||||
});
|
||||
});
|
||||
|
||||
[vornameInput, nachnameInput, emailInput, passwortInput].forEach(input => {
|
||||
input.addEventListener('input', () => {
|
||||
input.parentElement.classList.remove('has-error');
|
||||
profileFeedback.textContent = '';
|
||||
});
|
||||
});
|
||||
|
||||
logoutButton.addEventListener('click', () => {
|
||||
localStorage.removeItem(CURRENT_USER_KEY);
|
||||
window.location.href = 'login.html';
|
||||
});
|
||||
}
|
||||
|
||||
// Reagiert auf Aktionen in der Liste "Meine Events" per Event Delegation.
|
||||
function handleHostedListClick(event) {
|
||||
const target = event.target;
|
||||
if (!(target instanceof HTMLElement)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const cancelButton = target.closest('[data-cancel-event-id]');
|
||||
if (cancelButton && currentUser?.email) {
|
||||
const eventId = Number(cancelButton.getAttribute('data-cancel-event-id'));
|
||||
if (Number.isFinite(eventId)) {
|
||||
cancelHostedEvent(eventId, currentUser.email);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (target.closest('a, button')) {
|
||||
return;
|
||||
}
|
||||
|
||||
const card = target.closest('[data-event-id]');
|
||||
if (!card) {
|
||||
return;
|
||||
}
|
||||
|
||||
const eventId = Number(card.getAttribute('data-event-id'));
|
||||
if (!Number.isFinite(eventId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.location.href = `event_detail.html?id=${eventId}`;
|
||||
}
|
||||
|
||||
// Schaltet den sichtbaren Profilbereich per Tabname um.
|
||||
function activateProfileTab(tabName) {
|
||||
profileTabButtons.forEach(button => {
|
||||
const isActive = button.getAttribute('data-profile-tab') === tabName;
|
||||
button.classList.toggle('is-active', isActive);
|
||||
button.setAttribute('aria-selected', isActive ? 'true' : 'false');
|
||||
});
|
||||
|
||||
profileTabPanels.forEach(panel => {
|
||||
const isActive = panel.getAttribute('data-profile-panel') === tabName;
|
||||
panel.classList.toggle('hidden', !isActive);
|
||||
});
|
||||
}
|
||||
|
||||
// Reagiert auf Aktionen in der Liste "Meine Anmeldungen" per Event Delegation.
|
||||
function handleRegistrationListClick(event) {
|
||||
const target = event.target;
|
||||
if (!(target instanceof HTMLElement)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const unregisterButton = target.closest('[data-unregister-id]');
|
||||
if (unregisterButton) {
|
||||
if (!currentUser?.email) {
|
||||
return;
|
||||
}
|
||||
|
||||
const eventId = Number(unregisterButton.getAttribute('data-unregister-id'));
|
||||
if (!Number.isFinite(eventId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
unregisterFromEvent(eventId, currentUser.email);
|
||||
return;
|
||||
}
|
||||
|
||||
if (target.closest('a, button')) {
|
||||
return;
|
||||
}
|
||||
|
||||
const card = target.closest('[data-event-id]');
|
||||
if (!card) {
|
||||
return;
|
||||
}
|
||||
|
||||
const eventId = Number(card.getAttribute('data-event-id'));
|
||||
if (!Number.isFinite(eventId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.location.href = `event_detail.html?id=${eventId}`;
|
||||
}
|
||||
|
||||
|
||||
// Sagt ein gehostetes Event ab (aus eigener Profilansicht entfernen).
|
||||
function cancelHostedEvent(eventId, userEmail) {
|
||||
// Lokal erstellte, eigene Events werden direkt aus dem Storage geloescht.
|
||||
const storedEvents = getStoredEvents();
|
||||
const nextStoredEvents = storedEvents.filter(event => {
|
||||
const isTargetEvent = Number(event.id) === eventId;
|
||||
const isOwnedByUser = normalizeText(event.hostEmail || '') === normalizeText(userEmail)
|
||||
|| normalizeText(event.host?.name || '') === normalizeText(currentUser?.vorname || '');
|
||||
|
||||
return !(isTargetEvent && isOwnedByUser);
|
||||
});
|
||||
setStoredEvents(nextStoredEvents);
|
||||
|
||||
// Event-ID fuer alle Benutzer aus den Anmeldungen entfernen.
|
||||
const registrationMap = getRegistrationMap();
|
||||
Object.keys(registrationMap).forEach(email => {
|
||||
const ids = Array.isArray(registrationMap[email])
|
||||
? registrationMap[email].map(id => Number(id)).filter(Number.isFinite)
|
||||
: [];
|
||||
|
||||
registrationMap[email] = ids.filter(id => id !== eventId);
|
||||
});
|
||||
setRegistrationMap(registrationMap);
|
||||
|
||||
allEvents = allEvents.filter(event => Number(event.id) !== eventId);
|
||||
|
||||
renderMyEvents(allEvents, currentUser);
|
||||
renderMyRegistrations(allEvents, currentUser);
|
||||
profileFeedback.textContent = 'Event wurde abgesagt und aus deinem Hosting entfernt.';
|
||||
}
|
||||
// Entfernt eine Event-ID aus der Benutzerliste und aktualisiert die UI sofort.
|
||||
function unregisterFromEvent(eventId, userEmail) {
|
||||
const registrationMap = getRegistrationMap();
|
||||
const currentIds = Array.isArray(registrationMap[userEmail]) ? registrationMap[userEmail] : [];
|
||||
const nextIds = currentIds
|
||||
.map(id => Number(id))
|
||||
.filter(id => Number.isFinite(id) && id !== eventId);
|
||||
|
||||
registrationMap[userEmail] = nextIds;
|
||||
setRegistrationMap(registrationMap);
|
||||
|
||||
renderMyRegistrations(allEvents, currentUser);
|
||||
profileFeedback.textContent = 'Du wurdest von dem Event abgemeldet.';
|
||||
}
|
||||
|
||||
// Validiert Profildaten konsistent und liefert true/false zur Submit-Steuerung.
|
||||
function validateProfileForm() {
|
||||
let isValid = true;
|
||||
|
||||
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
||||
|
||||
if (!vornameInput.value.trim()) {
|
||||
vornameInput.parentElement.classList.add('has-error');
|
||||
isValid = false;
|
||||
}
|
||||
|
||||
if (!nachnameInput.value.trim()) {
|
||||
nachnameInput.parentElement.classList.add('has-error');
|
||||
isValid = false;
|
||||
}
|
||||
|
||||
if (!emailRegex.test(emailInput.value.trim())) {
|
||||
emailInput.parentElement.classList.add('has-error');
|
||||
isValid = false;
|
||||
}
|
||||
|
||||
if (passwortInput.value && passwortInput.value.length < 6) {
|
||||
passwortInput.parentElement.classList.add('has-error');
|
||||
isValid = false;
|
||||
}
|
||||
|
||||
return isValid;
|
||||
}
|
||||
|
||||
// Speichert Profilaenderungen lokal und synchronisiert auch den Benutzerkatalog.
|
||||
function handleProfileSubmit(event) {
|
||||
event.preventDefault();
|
||||
|
||||
if (!validateProfileForm()) {
|
||||
profileFeedback.textContent = 'Bitte pruefe die markierten Felder.';
|
||||
return;
|
||||
}
|
||||
|
||||
const previousEmail = currentUser.email;
|
||||
const nextUser = {
|
||||
...currentUser,
|
||||
vorname: vornameInput.value.trim(),
|
||||
nachname: nachnameInput.value.trim(),
|
||||
email: emailInput.value.trim(),
|
||||
passwort: passwortInput.value ? passwortInput.value : currentUser.passwort,
|
||||
updatedAt: new Date().toISOString()
|
||||
};
|
||||
|
||||
currentUser = nextUser;
|
||||
localStorage.setItem(CURRENT_USER_KEY, JSON.stringify(nextUser));
|
||||
syncUserInUserStore(previousEmail, nextUser);
|
||||
|
||||
// Falls sich die E-Mail geaendert hat, verschieben wir bestehende Anmeldungen auf die neue E-Mail.
|
||||
migrateRegistrationEmail(previousEmail, nextUser.email);
|
||||
|
||||
passwortInput.value = '';
|
||||
profileHeadline.textContent = `Hallo ${nextUser.vorname}`;
|
||||
profileFeedback.textContent = 'Profil erfolgreich gespeichert.';
|
||||
}
|
||||
|
||||
// Synchronisiert einen Benutzer im zentralen User-Array.
|
||||
function syncUserInUserStore(previousEmail, nextUser) {
|
||||
let users = [];
|
||||
|
||||
try {
|
||||
const raw = localStorage.getItem(USERS_STORAGE_KEY);
|
||||
users = raw ? JSON.parse(raw) : [];
|
||||
} catch (error) {
|
||||
console.error('Benutzerdaten konnten nicht gelesen werden.', error);
|
||||
}
|
||||
|
||||
const nextUsers = users.filter(user => user.email !== previousEmail && user.email !== nextUser.email);
|
||||
nextUsers.unshift(nextUser);
|
||||
localStorage.setItem(USERS_STORAGE_KEY, JSON.stringify(nextUsers));
|
||||
}
|
||||
|
||||
// Migriert bestehende Registrierungen, falls die E-Mail aktualisiert wurde.
|
||||
function migrateRegistrationEmail(previousEmail, nextEmail) {
|
||||
if (!previousEmail || !nextEmail || previousEmail === nextEmail) {
|
||||
return;
|
||||
}
|
||||
|
||||
const map = getRegistrationMap();
|
||||
const existingRegistrations = Array.isArray(map[previousEmail]) ? map[previousEmail] : [];
|
||||
const alreadyPresent = Array.isArray(map[nextEmail]) ? map[nextEmail] : [];
|
||||
|
||||
map[nextEmail] = Array.from(new Set([...alreadyPresent, ...existingRegistrations]));
|
||||
delete map[previousEmail];
|
||||
|
||||
localStorage.setItem(REGISTRATION_STORAGE_KEY, JSON.stringify(map));
|
||||
}
|
||||
|
||||
// Ermittelt gehostete Events aus lokal erstellten Daten des aktuellen Benutzers.
|
||||
function getMyHostedEvents(events, user) {
|
||||
const userFirstName = normalizeText(user.vorname || '');
|
||||
const userEmail = normalizeText(user.email || '');
|
||||
|
||||
return events.filter(event => {
|
||||
if (event.source !== 'local') {
|
||||
return false;
|
||||
}
|
||||
|
||||
const hostEmail = normalizeText(event.hostEmail || '');
|
||||
const hostName = normalizeText(event.host?.name || '');
|
||||
|
||||
if (hostEmail && hostEmail === userEmail) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return userFirstName && hostName === userFirstName;
|
||||
});
|
||||
}
|
||||
|
||||
// Ermittelt angemeldete Events ueber die Registration-Map.
|
||||
function getMyRegisteredEvents(events, user) {
|
||||
const registrationMap = getRegistrationMap();
|
||||
const registeredIds = Array.isArray(registrationMap[user.email]) ? registrationMap[user.email] : [];
|
||||
const idSet = new Set(registeredIds.map(id => Number(id)));
|
||||
|
||||
return events.filter(event => idSet.has(Number(event.id)));
|
||||
}
|
||||
|
||||
// Rendert gehostete Events inkl. Zaehler.
|
||||
function renderMyEvents(events, user) {
|
||||
const hostedEvents = getMyHostedEvents(events, user);
|
||||
myEventsCount.textContent = String(hostedEvents.length);
|
||||
renderEventCards(myEventsList, hostedEvents, {
|
||||
title: 'Noch kein eigenes Event',
|
||||
text: 'Starte dein erstes Dinner und lade die Community an deinen Tisch ein.',
|
||||
buttonLabel: 'Event erstellen',
|
||||
href: 'event_create.html'
|
||||
}, 'hosting');
|
||||
}
|
||||
|
||||
// Rendert angemeldete Events inkl. Zaehler.
|
||||
function renderMyRegistrations(events, user) {
|
||||
const registeredEvents = getMyRegisteredEvents(events, user);
|
||||
myRegistrationsCount.textContent = String(registeredEvents.length);
|
||||
renderEventCards(myRegistrationsList, registeredEvents, {
|
||||
title: 'Noch keine Anmeldungen',
|
||||
text: 'Entdecke spannende Dinner in deiner Naehe und melde dich direkt an.',
|
||||
buttonLabel: 'Events entdecken',
|
||||
href: 'event_overview.html'
|
||||
}, 'registrations');
|
||||
}
|
||||
|
||||
// Baut die Eventkarten fuer beide Listen in einheitlichem Markup.
|
||||
function renderEventCards(container, events, emptyStateConfig, mode) {
|
||||
container.innerHTML = '';
|
||||
|
||||
if (events.length === 0) {
|
||||
const emptyElement = document.createElement('div');
|
||||
emptyElement.className = 'profile-empty-state';
|
||||
emptyElement.innerHTML = `
|
||||
<p class="profile-empty-kicker">Keine Treffer</p>
|
||||
<h3>${emptyStateConfig.title}</h3>
|
||||
<p>${emptyStateConfig.text}</p>
|
||||
<a class="button" href="${emptyStateConfig.href}">${emptyStateConfig.buttonLabel}</a>
|
||||
`;
|
||||
container.appendChild(emptyElement);
|
||||
return;
|
||||
}
|
||||
|
||||
events.forEach(event => {
|
||||
const card = document.createElement('article');
|
||||
card.className = 'profile-event-card profile-event-card-clickable';
|
||||
card.setAttribute('data-event-id', String(event.id));
|
||||
const addressMarkup = mode === 'registrations' && event.address && isAddressVisibleWindow(event)
|
||||
? `
|
||||
<div class="profile-event-address-block" aria-label="Event Adresse">
|
||||
<p class="profile-event-address-label">Adresse</p>
|
||||
<p class="profile-event-address">${event.address}</p>
|
||||
</div>
|
||||
`
|
||||
: '';
|
||||
|
||||
const actionMarkup = mode === 'registrations'
|
||||
? `
|
||||
<div class="profile-event-actions">
|
||||
<button class="profile-unregister-btn" type="button" data-unregister-id="${event.id}">Abmelden</button>
|
||||
</div>
|
||||
`
|
||||
: `
|
||||
<div class="profile-event-actions">
|
||||
<button class="profile-cancel-btn" type="button" data-cancel-event-id="${event.id}">Event absagen</button>
|
||||
</div>
|
||||
`;
|
||||
|
||||
card.innerHTML = `
|
||||
<div>
|
||||
<h3 class="profile-event-title">${event.title}</h3>
|
||||
<p class="profile-event-meta">${event.location} | ${formatEventDate(event.date)} | ${formatEventTime(event.time)}</p>
|
||||
${addressMarkup}
|
||||
</div>
|
||||
${actionMarkup}
|
||||
`;
|
||||
|
||||
container.appendChild(card);
|
||||
});
|
||||
}
|
||||
|
||||
// Gibt true zurueck, wenn ein Event innerhalb der naechsten 12 Stunden startet.
|
||||
function isAddressVisibleWindow(event) {
|
||||
const eventDateTime = parseEventDateTime(event);
|
||||
if (!eventDateTime || Number.isNaN(eventDateTime.getTime())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const msUntilStart = eventDateTime.getTime() - Date.now();
|
||||
const twelveHoursInMs = 12 * 60 * 60 * 1000;
|
||||
|
||||
return msUntilStart >= 0 && msUntilStart <= twelveHoursInMs;
|
||||
}
|
||||
|
||||
// Parse fuer ISO- und lokalisierte Datumsformate aus den Eventdaten.
|
||||
function parseEventDateTime(event) {
|
||||
if (!event?.date) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const dateValue = String(event.date).trim();
|
||||
const isoDateMatch = dateValue.match(/^(\d{4})-(\d{2})-(\d{2})$/);
|
||||
let year;
|
||||
let month;
|
||||
let day;
|
||||
|
||||
if (isoDateMatch) {
|
||||
year = Number(isoDateMatch[1]);
|
||||
month = Number(isoDateMatch[2]);
|
||||
day = Number(isoDateMatch[3]);
|
||||
} else {
|
||||
const monthMap = {
|
||||
JAN: 1,
|
||||
FEB: 2,
|
||||
'MÄR': 3,
|
||||
MRZ: 3,
|
||||
APR: 4,
|
||||
MAI: 5,
|
||||
JUN: 6,
|
||||
JUL: 7,
|
||||
AUG: 8,
|
||||
SEP: 9,
|
||||
OKT: 10,
|
||||
NOV: 11,
|
||||
DEZ: 12
|
||||
};
|
||||
const localizedMatch = dateValue.match(/^(\d{1,2})\.\s*([A-ZÄÖÜ]{3})\.\s*(\d{4})$/);
|
||||
|
||||
if (!localizedMatch) {
|
||||
return null;
|
||||
}
|
||||
|
||||
day = Number(localizedMatch[1]);
|
||||
month = monthMap[localizedMatch[2]];
|
||||
year = Number(localizedMatch[3]);
|
||||
|
||||
if (!month) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
const timeMatch = String(event.time || '').match(/(\d{1,2}):(\d{2})/);
|
||||
const hours = timeMatch ? Number(timeMatch[1]) : 0;
|
||||
const minutes = timeMatch ? Number(timeMatch[2]) : 0;
|
||||
|
||||
return new Date(year, month - 1, day, hours, minutes, 0, 0);
|
||||
}
|
||||
|
||||
// Formatiert ein Eventdatum konsistent fuer die Profilkarten.
|
||||
function formatEventDate(dateString) {
|
||||
if (!dateString) {
|
||||
return 'Kein Datum';
|
||||
}
|
||||
|
||||
if (/^\d{4}-\d{2}-\d{2}$/.test(dateString)) {
|
||||
const [year, month, day] = dateString.split('-');
|
||||
const monthLabel = ['Januar', 'Februar', 'Maerz', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'][Number(month) - 1];
|
||||
return `${Number(day)}. ${monthLabel} ${year}`;
|
||||
}
|
||||
|
||||
return dateString;
|
||||
}
|
||||
|
||||
// Vereinheitlicht die Zeitanzeige fuer die Profilseite.
|
||||
function formatEventTime(timeString) {
|
||||
if (!timeString) {
|
||||
return 'Keine Uhrzeit';
|
||||
}
|
||||
|
||||
return timeString.includes('UHR') ? timeString.replace('UHR', 'Uhr').trim() : timeString;
|
||||
}
|
||||
|
||||
// Normalisiert Vergleichswerte fuer robuste String-Matches.
|
||||
function normalizeText(value) {
|
||||
return String(value || '').trim().toLowerCase();
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,69 @@
|
||||
// =============================================
|
||||
// Dynamische Navigation
|
||||
// Je nach Login-Status wird die Kopfzeile fuer
|
||||
// alle Seiten mit passendem Markup aufgebaut.
|
||||
// =============================================
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const CURRENT_USER_KEY = 'socialCookingCurrentUser';
|
||||
const navContainers = document.querySelectorAll('.nav-tab-links');
|
||||
const currentPage = (window.location.pathname.split('/').pop() || 'index.html').toLowerCase();
|
||||
|
||||
// Beendet frueh, falls auf einer Seite keine Hauptnavigation vorhanden ist.
|
||||
if (!navContainers.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Liest den aktiven Benutzer robust aus localStorage.
|
||||
function getCurrentUser() {
|
||||
try {
|
||||
const stored = localStorage.getItem(CURRENT_USER_KEY);
|
||||
return stored ? JSON.parse(stored) : null;
|
||||
} catch (error) {
|
||||
console.error('Aktueller Benutzer konnte nicht gelesen werden.', error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Baut die Navigation fuer ausgeloggte Besucher.
|
||||
function buildLoggedOutNavigation() {
|
||||
const loginIsActive = currentPage === 'login.html';
|
||||
const signupIsActive = currentPage === 'signup.html';
|
||||
|
||||
return `
|
||||
<a
|
||||
class="button-small auth-nav-button ${loginIsActive ? 'auth-nav-button--active' : 'auth-nav-button--default'}"
|
||||
href="login.html"
|
||||
aria-label="Login"
|
||||
${loginIsActive ? 'aria-current="page"' : ''}
|
||||
>
|
||||
Login
|
||||
</a>
|
||||
<a
|
||||
class="button-small auth-nav-button ${signupIsActive ? 'auth-nav-button--active' : 'auth-nav-button--default'}"
|
||||
href="signup.html"
|
||||
aria-label="Signup"
|
||||
${signupIsActive ? 'aria-current="page"' : ''}
|
||||
>
|
||||
Signup
|
||||
</a>
|
||||
`;
|
||||
}
|
||||
|
||||
// Baut die Navigation fuer eingeloggte Benutzer.
|
||||
function buildLoggedInNavigation() {
|
||||
return `
|
||||
<a class="nav-tab" href="event_overview.html">Event finden</a>
|
||||
<a class="nav-tab" href="event_create.html">Event erstellen</a>
|
||||
<a class="button-small" href="my_profil.html" aria-label="Mein Profil">Mein Profil</a>
|
||||
`;
|
||||
}
|
||||
|
||||
const currentUser = getCurrentUser();
|
||||
const nextMarkup = currentUser ? buildLoggedInNavigation() : buildLoggedOutNavigation();
|
||||
|
||||
// Wendet das passende Markup auf alle vorhandenen Kopf-Navigationen an.
|
||||
navContainers.forEach(container => {
|
||||
container.innerHTML = nextMarkup;
|
||||
});
|
||||
});
|
||||
+61
-4
@@ -1,3 +1,10 @@
|
||||
// =============================================
|
||||
// Signup-Logik
|
||||
// Diese Datei validiert das Formular, speichert
|
||||
// neue Benutzer lokal und startet direkt die Session.
|
||||
// =============================================
|
||||
|
||||
// Formular und Felder aus dem HTML holen.
|
||||
const signupForm = document.getElementById('signupForm');
|
||||
const vornameInput = document.getElementById('vorname');
|
||||
const nachnameInput = document.getElementById('nachname');
|
||||
@@ -5,6 +12,30 @@ const emailInput = document.getElementById('email');
|
||||
const passwortInput = document.getElementById('passwort');
|
||||
const welcomeModal = document.getElementById('welcomeModal');
|
||||
|
||||
const USERS_STORAGE_KEY = 'socialCookingUsers';
|
||||
const CURRENT_USER_KEY = 'socialCookingCurrentUser';
|
||||
|
||||
// Liest bestehende Benutzerliste robust aus localStorage.
|
||||
function getStoredUsers() {
|
||||
try {
|
||||
const raw = localStorage.getItem(USERS_STORAGE_KEY);
|
||||
return raw ? JSON.parse(raw) : [];
|
||||
} catch (error) {
|
||||
console.error('Benutzerdaten konnten nicht gelesen werden.', error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
// Schreibt die komplette Benutzerliste in localStorage.
|
||||
function setStoredUsers(users) {
|
||||
localStorage.setItem(USERS_STORAGE_KEY, JSON.stringify(users));
|
||||
}
|
||||
|
||||
// Speichert den aktiven Benutzer fuer nachfolgende Seiten.
|
||||
function setCurrentUser(user) {
|
||||
localStorage.setItem(CURRENT_USER_KEY, JSON.stringify(user));
|
||||
}
|
||||
|
||||
// Funktion zum Öffnen des Welcome Modals
|
||||
function openWelcomeModal() {
|
||||
welcomeModal.classList.add('show');
|
||||
@@ -17,7 +48,7 @@ function closeWelcomeModal() {
|
||||
document.body.style.overflow = 'auto';
|
||||
}
|
||||
|
||||
// Validierungsfunktion
|
||||
// Hauptfunktion fuer Formularvalidierung und Speicherung.
|
||||
function validateForm(event) {
|
||||
event.preventDefault();
|
||||
|
||||
@@ -78,12 +109,38 @@ function validateForm(event) {
|
||||
passwortGroup.classList.remove('has-error');
|
||||
}
|
||||
|
||||
// Wenn alle Validierungen bestanden, Modal anzeigen
|
||||
// Wenn alles gueltig ist:
|
||||
// 1) auf doppelte E-Mail pruefen
|
||||
// 2) neuen Benutzer speichern
|
||||
// 3) als aktuellen Benutzer einloggen
|
||||
if (isValid) {
|
||||
const existingUsers = getStoredUsers();
|
||||
const emailLower = emailValue.toLowerCase();
|
||||
const emailAlreadyUsed = existingUsers.some(user => user.email?.toLowerCase() === emailLower);
|
||||
|
||||
if (emailAlreadyUsed) {
|
||||
emailGroup.classList.add('has-error');
|
||||
document.getElementById('emailError').textContent = 'Diese E-Mail ist bereits registriert. Bitte nutze den Login.';
|
||||
return;
|
||||
}
|
||||
|
||||
const newUser = {
|
||||
id: Date.now(),
|
||||
vorname: vornameValue,
|
||||
nachname: nachnameValue,
|
||||
email: emailValue,
|
||||
passwort: passwortValue,
|
||||
createdAt: new Date().toISOString(),
|
||||
source: 'signup'
|
||||
};
|
||||
|
||||
setStoredUsers([newUser, ...existingUsers]);
|
||||
setCurrentUser(newUser);
|
||||
|
||||
openWelcomeModal();
|
||||
// Hier würde später die Registrierung zum Backend gesendet
|
||||
// Hier koennte spaeter ein echter API-Call zum Backend stehen.
|
||||
|
||||
// Weiterleitung zur event overview Page
|
||||
// Weiterleitung zur Event-Overview-Seite.
|
||||
window.location.href = 'event_overview.html';
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -9,6 +9,7 @@
|
||||
<link rel="stylesheet" href="css/login_signup.css">
|
||||
<!-- Globales Stylesheet -->
|
||||
<link rel="stylesheet" href="css/stylesheet_global.css">
|
||||
<script src="js/navigation.js" defer></script>
|
||||
|
||||
|
||||
</head>
|
||||
@@ -20,9 +21,8 @@
|
||||
<img src="assets/logo_invite.svg" alt="Invite Logo">
|
||||
</a>
|
||||
<nav class="nav-tab-links" aria-label="Hauptnavigation">
|
||||
<a class="nav-tab" href="event_overview.html">Event finden</a>
|
||||
<a class="nav-tab" href="event_create.html">Event erstellen</a>
|
||||
<a class="button-small" href="login.html" aria-label="Profil">Login</a>
|
||||
<a class="button-small auth-nav-button auth-nav-button--active" href="login.html" aria-label="Login" aria-current="page">Login</a>
|
||||
<a class="button-small auth-nav-button auth-nav-button--default" href="signup.html" aria-label="Signup">Signup</a>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Mein Profil | Invité</title>
|
||||
|
||||
<!-- Stylesheet für diese Seite -->
|
||||
<link rel="stylesheet" href="css/my_profil.css">
|
||||
<!-- Globales Stylesheet -->
|
||||
<link rel="stylesheet" href="css/stylesheet_global.css">
|
||||
<script src="js/navigation.js" defer></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header class="top-nav-wrap">
|
||||
<div class="top-nav">
|
||||
<a class="brand" href="index.html" aria-label="Zur Startseite">
|
||||
<img src="assets/logo_invite.svg" alt="Invite Logo">
|
||||
</a>
|
||||
<nav class="nav-tab-links" aria-label="Hauptnavigation">
|
||||
<a class="button-small" href="login.html" aria-label="Login">Login</a>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="container profile-page">
|
||||
<section class="profile-hero" aria-label="Profilübersicht">
|
||||
<div>
|
||||
<p class="profile-kicker">Mein Bereich</p>
|
||||
<h1 id="profile-headline">Mein Profil</h1>
|
||||
<p id="profile-subline" class="profile-subline">Hier findest du deine Events, deine Anmeldungen und kannst deine Profildaten verwalten.</p>
|
||||
</div>
|
||||
<button id="logout-button" class="button-small profile-logout" type="button">Logout</button>
|
||||
</section>
|
||||
|
||||
<section id="logged-out-state" class="profile-panel hidden" aria-live="polite">
|
||||
<h2 class="panel-title">Du bist noch nicht eingeloggt</h2>
|
||||
<p>Melde dich an, damit wir deine Events und Anmeldungen anzeigen können.</p>
|
||||
<div class="profile-cta-row">
|
||||
<a class="button" href="login.html">Zum Login</a>
|
||||
<a class="button profile-button-secondary" href="signup.html">Konto erstellen</a>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="logged-in-content" class="profile-grid">
|
||||
<nav class="profile-tabs" aria-label="Profilbereiche">
|
||||
<button type="button" class="profile-tab is-active" data-profile-tab="hosting">Hosting</button>
|
||||
<button type="button" class="profile-tab" data-profile-tab="teilnehmen">Teilnehmen</button>
|
||||
<button type="button" class="profile-tab" data-profile-tab="einstellungen">Einstellungen</button>
|
||||
</nav>
|
||||
|
||||
<article class="profile-panel" data-profile-panel="hosting">
|
||||
<div class="panel-head">
|
||||
<h2 class="panel-title">Meine Events</h2>
|
||||
<span id="my-events-count" class="panel-count">0</span>
|
||||
</div>
|
||||
<div id="my-events-list" class="profile-card-list"></div>
|
||||
</article>
|
||||
|
||||
<article class="profile-panel hidden" data-profile-panel="teilnehmen">
|
||||
<div class="panel-head">
|
||||
<h2 class="panel-title">Meine Anmeldungen</h2>
|
||||
<span id="my-registrations-count" class="panel-count">0</span>
|
||||
</div>
|
||||
<div id="my-registrations-list" class="profile-card-list"></div>
|
||||
</article>
|
||||
|
||||
<article class="profile-panel profile-panel-form hidden" data-profile-panel="einstellungen">
|
||||
<h2 class="panel-title">Profil verwalten</h2>
|
||||
<form id="profile-form" novalidate>
|
||||
<div class="form-grid">
|
||||
<div class="form-group">
|
||||
<label for="vorname">Vorname</label>
|
||||
<input type="text" id="vorname" name="vorname" required>
|
||||
<p class="input-error" id="vorname-error">Bitte gib deinen Vornamen ein.</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="nachname">Nachname</label>
|
||||
<input type="text" id="nachname" name="nachname" required>
|
||||
<p class="input-error" id="nachname-error">Bitte gib deinen Nachnamen ein.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="email">E-Mail</label>
|
||||
<input type="email" id="email" name="email" required>
|
||||
<p class="input-error" id="email-error">Bitte gib eine gültige E-Mail-Adresse ein.</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="passwort">Passwort</label>
|
||||
<input type="password" id="passwort" name="passwort" minlength="6" placeholder="Mindestens 6 Zeichen">
|
||||
<p class="input-hint">Nur ausfüllen, wenn du dein Passwort ändern möchtest.</p>
|
||||
<p class="input-error" id="passwort-error">Das Passwort muss mindestens 6 Zeichen lang sein.</p>
|
||||
</div>
|
||||
|
||||
<button class="button" type="submit">Profil speichern</button>
|
||||
<p id="profile-feedback" class="profile-feedback" aria-live="polite"></p>
|
||||
</form>
|
||||
</article>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<script src="js/my_profil.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
+3
-3
@@ -9,6 +9,7 @@
|
||||
<link rel="stylesheet" href="css/login_signup.css">
|
||||
<!-- Globales Stylesheet -->
|
||||
<link rel="stylesheet" href="css/stylesheet_global.css">
|
||||
<script src="js/navigation.js" defer></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -19,9 +20,8 @@
|
||||
<img src="assets/logo_invite.svg" alt="Invite Logo">
|
||||
</a>
|
||||
<nav class="nav-tab-links" aria-label="Hauptnavigation">
|
||||
<a class="nav-tab" href="event_overview.html">Event finden</a>
|
||||
<a class="nav-tab" href="event_create.html">Event erstellen</a>
|
||||
<a class="button-small" href="login.html" aria-label="Profil">Login</a>
|
||||
<a class="button-small auth-nav-button auth-nav-button--default" href="login.html" aria-label="Login">Login</a>
|
||||
<a class="button-small auth-nav-button auth-nav-button--active" href="signup.html" aria-label="Signup" aria-current="page">Signup</a>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
Reference in new issue
Block a user