Format der Button überarbeitet

This commit is contained in:
Borgal
2025-10-25 00:07:18 +02:00
parent 4ab4576ec8
commit 80360c0dfd
4 changed files with 34 additions and 31 deletions

View File

@@ -62,12 +62,4 @@ pre {
/* Optional: Kleiner Abstand für bessere Lesbarkeit */ /* Optional: Kleiner Abstand für bessere Lesbarkeit */
.collapse:not(.show) { .collapse:not(.show) {
display: none; display: none;
}
.meeting-actions {
max-width: 500px;
margin-left: auto;
margin-right: auto;
flex-direction: column;
align-items: center;
} }

View File

@@ -20,10 +20,10 @@
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined" rel="stylesheet">
<!-- Custom styles --> <!-- Custom styles -->
<link rel="stylesheet" href="../css/style.css"> <link rel="stylesheet" href="/css/style.css">
<!-- PWA Manifest --> <!-- PWA Manifest -->
<link rel="manifest" href="./manifest.json"> <link rel="manifest" href="./manifest.json?v=1">
<link rel="apple-touch-icon" href="../img/icon-192.png"> <link rel="apple-touch-icon" href="../img/icon-192.png">
</head> </head>

View File

@@ -37,10 +37,14 @@ function auto_decline_if_on_vacation($conn, $meeting_id, $user_id, $meeting_date
$existing = mysqli_fetch_assoc(mysqli_stmt_get_result($check_stmt)); $existing = mysqli_fetch_assoc(mysqli_stmt_get_result($check_stmt));
mysqli_stmt_close($check_stmt); mysqli_stmt_close($check_stmt);
if ($existing && $existing['rsvp_status'] === 'accepted') { $current_status = $existing ? $existing['rsvp_status'] : null;
return 'accepted';
// Wenn explizit "accepted" oder "maybe" gewählt wurde → NICHT überschreiben!
if ($current_status === 'accepted' || $current_status === 'maybe') {
return $current_status;
} }
// Nur wenn Status "declined" oder NULL → auf "declined" setzen
if ($existing) { if ($existing) {
$upd = mysqli_prepare($conn, "UPDATE meeting_teilnehmer SET rsvp_status = 'declined', attended = 0 WHERE meeting_id = ? AND user_id = ?"); $upd = mysqli_prepare($conn, "UPDATE meeting_teilnehmer SET rsvp_status = 'declined', attended = 0 WHERE meeting_id = ? AND user_id = ?");
mysqli_stmt_bind_param($upd, "ii", $meeting_id, $user_id); mysqli_stmt_bind_param($upd, "ii", $meeting_id, $user_id);
@@ -270,7 +274,7 @@ $german_weekdays = [
mysqli_stmt_execute($color_stmt); mysqli_stmt_execute($color_stmt);
$color_row = mysqli_fetch_assoc(mysqli_stmt_get_result($color_stmt)); $color_row = mysqli_fetch_assoc(mysqli_stmt_get_result($color_stmt));
?> ?>
<div class="card mx-auto bg-light shadow" style="max-width: 500px;"> <div class="card mx-auto bg-light shadow mb-4" style="max-width: 500px;">
<div class="card-body text-center"> <div class="card-body text-center">
<div class="rounded-4 mb-3 mx-auto d-flex flex-column justify-content-center align-items-center color-box" style="background-image: linear-gradient(135deg, <?= htmlspecialchars($color_row['hex_code']) ?>, <?= darken_color($color_row['hex_code']) ?>);"> <div class="rounded-4 mb-3 mx-auto d-flex flex-column justify-content-center align-items-center color-box" style="background-image: linear-gradient(135deg, <?= htmlspecialchars($color_row['hex_code']) ?>, <?= darken_color($color_row['hex_code']) ?>);">
<p class="fs-5 fw-semibold m-0" style="color: <?= get_readable_text_color($color_row['hex_code']) ?>;"><?= htmlspecialchars($color_row['name']) ?></p> <p class="fs-5 fw-semibold m-0" style="color: <?= get_readable_text_color($color_row['hex_code']) ?>;"><?= htmlspecialchars($color_row['name']) ?></p>
@@ -306,7 +310,10 @@ $german_weekdays = [
</div> </div>
</div> </div>
<div class="d-flex justify-content-center pt-2 pb-3 meeting-actions"> <?php if ($user_attendance_status === 'accepted'): ?> <!-- TODO: -->
<div class="d-flex justify-content-center pt-2 pb-3" style="max-width: 500px; margin-left: auto; margin-right: auto; flex-direction: column; align-items: center;" <!-- inline-css-ok -->
<?php if ($user_attendance_status === 'accepted'): ?>
<p class="text-success fw-bold mb-4">Du hast zugesagt!</p> <p class="text-success fw-bold mb-4">Du hast zugesagt!</p>
<div class="d-flex justify-content-center"> <div class="d-flex justify-content-center">
<a href="index.php?action=decline&meeting_id=<?= htmlspecialchars($meeting_id); ?>" class="btn btn-sm btn-outline-danger me-2">Absagen</a> <a href="index.php?action=decline&meeting_id=<?= htmlspecialchars($meeting_id); ?>" class="btn btn-sm btn-outline-danger me-2">Absagen</a>
@@ -455,24 +462,28 @@ $german_weekdays = [
</div> </div>
<div class="mt-2"> <div class="mt-2">
<?php if (!isset($user_votes[$p['id']])): ?> <div class="mt-2">
<form method="POST" class="d-inline"> <?php if (!isset($user_votes[$p['id']])): ?>
<input type="hidden" name="proposal_id" value="<?= $p['id'] ?>"> <form method="POST" class="d-inline">
<button type="submit" name="vote_proposal" value="yes" class="btn btn-sm btn-success">✅ Ja</button> <input type="hidden" name="proposal_id" value="<?= $p['id'] ?>">
<button type="submit" name="vote_proposal" value="no" class="btn btn-sm btn-danger">❌ Nein</button> <button type="submit" name="vote_proposal" value="yes" class="btn btn-sm btn-success">✅ Ja</button>
</form> <button type="submit" name="vote_proposal" value="no" class="btn btn-sm btn-danger">❌ Nein</button>
<?php else: ?> </form>
<span class="badge bg-secondary">Bereits abgestimmt: <?php else: ?>
<?= $user_votes[$p['id']] === 'yes' ? '✅ Ja' : '❌ Nein' ?> <span class="badge bg-secondary">Bereits abgestimmt:
</span> <?= $user_votes[$p['id']] === 'yes' ? '✅ Ja' : '❌ Nein' ?>
<?php endif; ?> </span>
<?php endif; ?>
</div>
<?php if (isset($_SESSION['role']) && $_SESSION['role'] === 'admin'): ?> <?php if (isset($_SESSION['role']) && $_SESSION['role'] === 'admin'): ?>
<form method="POST" class="d-inline ms-2"> <div class="mt-1">
<input type="hidden" name="proposal_id" value="<?= $p['id'] ?>"> <form method="POST" class="d-inline">
<button type="submit" name="accept_proposal" class="btn btn-sm btn-outline-success" onclick="return confirm('Vorschlag wirklich annehmen? Der Termin wird verschoben!')">Annehmen</button> <input type="hidden" name="proposal_id" value="<?= $p['id'] ?>">
<button type="submit" name="reject_proposal" class="btn btn-sm btn-outline-danger" onclick="return confirm('Vorschlag wirklich ablehnen?')">Ablehnen</button> <button type="submit" name="accept_proposal" class="btn btn-sm btn-outline-success" onclick="return confirm('Vorschlag wirklich annehmen? Der Termin wird verschoben!')">Annehmen</button>
</form> <button type="submit" name="reject_proposal" class="btn btn-sm btn-outline-danger" onclick="return confirm('Vorschlag wirklich ablehnen?')">Ablehnen</button>
</form>
</div>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>

2
sw.js
View File

@@ -1,4 +1,4 @@
const CACHE_NAME = 'domili-v' + new Date().getTime(); const CACHE_NAME = 'domili-v1' + new Date().getTime();
const urlsToCache = [ const urlsToCache = [
'/', '/',
//'/index.php', //'/index.php',