From 07b5f505f0c10bf552e6c0e76a1a16e5d9571ff7 Mon Sep 17 00:00:00 2001 From: Maaxxs <61059039+MaaxxsDev@users.noreply.github.com> Date: Wed, 14 Oct 2026 16:50:23 +0200 Subject: [PATCH] Raids: Raid-Leitung kann Raids als wichtig markieren (Faehnchen auf der Karte) - orange hervorgehoben auf der Raid-Seite und dem Dashboard Co-Authored-By: Claude Opus 5.5 --- assets/css/style.css | 5 +++++ dashboard.php | 12 +++++++++++- includes/patchnotes.php | 10 ++++++++++ includes/raid_attendance.php | 16 +++++++++++++-- includes/raid_card.php | 18 +++++++++++++++-- includes/schema.php | 3 +++ raid_important_action.php | 38 ++++++++++++++++++++++++++++++++++++ sql/schema.sql | 2 ++ 8 files changed, 99 insertions(+), 5 deletions(-) create mode 100644 raid_important_action.php diff --git a/assets/css/style.css b/assets/css/style.css index 053769f..a879c8d 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -2433,6 +2433,11 @@ input.role-weight-input { .badge-pending { border-color: var(--gold); color: var(--gold); } /* Raid seit dem letzten Besuch der Raid-Seite gepostet (includes/raid_card.php) */ .raid-new-badge { border-color: var(--gold); background: var(--gold); color: #1a1a1a; font-weight: 700; } +/* Von der Raid-Leitung als wichtig markiert (includes/raid_card.php, dashboard.php) */ +.raid-card-important { border-color: #e8912d; border-left: 4px solid #e8912d; box-shadow: 0 0 18px rgba(232, 145, 45, 0.18); } +.raid-important-badge { display: inline-flex; align-items: center; gap: 0.25rem; border-color: #e8912d; background: #e8912d; color: #1a1a1a; font-weight: 700; } +.raid-important-badge .icon { width: 12px; height: 12px; } +.raid-important-toggle.active { color: #e8912d; border-color: #e8912d; } /* Raid-Lead: Zeile unter dem Termin, Krone in der Anmeldeliste, Hinweis beim Anlegen */ .raid-lead-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: -0.5rem 0 0.9rem; font-size: 0.9rem; color: var(--text-muted); } .raid-lead-line a { color: var(--gold); font-weight: 600; } diff --git a/dashboard.php b/dashboard.php index 7284069..76ed4ff 100644 --- a/dashboard.php +++ b/dashboard.php @@ -1,6 +1,7 @@ ($a['timestamp'] ?? PHP_INT_MAX) <=> ($b['timestamp'] ?? PHP_INT_MAX)); + // Von der Raid-Leitung als wichtig markierte Raids (raid_settings.important) sind hervorgehoben + try { + $raidSettings = raid_settings_all(); + } catch (PDOException $e) { + $raidSettings = []; + } foreach ($upcomingRaids as &$raid) { + $raid['_important'] = !empty($raidSettings[(string) ($raid['raid_id'] ?? '')]['important']); $signups = is_array($raid['signups'] ?? null) ? $raid['signups'] : []; $raid['_my_signup'] = null; foreach ($signups as $signup) { @@ -308,7 +316,9 @@ include __DIR__ . '/includes/header.php'; ?> - > + > + Wichtig + diff --git a/includes/patchnotes.php b/includes/patchnotes.php index f01d4eb..e8d3f4b 100644 --- a/includes/patchnotes.php +++ b/includes/patchnotes.php @@ -19,6 +19,16 @@ const PATCHNOTE_TYPES = [ ]; const PATCHNOTES = [ + [ + 'id' => '2026-10-14-a', + 'date' => '2026-10-14', + 'title' => 'Wichtige Raids', + 'summary' => 'Die Raid-Leitung kann Raids als wichtig markieren – sie fallen auf der Raid-Seite und auf dem Dashboard sofort auf.', + 'changes' => [ + ['type' => 'neu', 'area' => 'Raids', 'text' => 'Als wichtig markierte Raids haben einen orangen Rahmen und das Abzeichen „Wichtig“ – auf der Raid-Seite und bei den nächsten Raids auf dem Dashboard.'], + ['type' => 'neu', 'area' => 'Raids', 'text' => 'Mit dem Fähnchen oben auf der Raid-Karte markiert die Raid-Leitung (raids.manage) einen Raid als wichtig oder nimmt die Markierung wieder weg. Raid-Leads ohne dieses Recht können es nicht.', 'audience' => 'leitung'], + ], + ], [ 'id' => '2026-10-13-b', 'date' => '2026-10-13', diff --git a/includes/raid_attendance.php b/includes/raid_attendance.php index e986952..9247136 100644 --- a/includes/raid_attendance.php +++ b/includes/raid_attendance.php @@ -140,13 +140,13 @@ function raid_settings_ensure_defaults(array $raidIds): void } } -/** @return array{points_present: int, points_absent: int, auto_processed_at: ?string, auto_result: ?string, attendance_checked_at: ?string, checked_by: ?string, lead_user_id: ?int, lead_name: ?string} */ +/** @return array{points_present: int, points_absent: int, auto_processed_at: ?string, auto_result: ?string, attendance_checked_at: ?string, checked_by: ?string, lead_user_id: ?int, lead_name: ?string, important: bool} */ function raid_settings_get(int $raidId): array { $stmt = db()->prepare( "SELECT s.points_present, s.points_absent, s.auto_processed_at, s.auto_result, s.attendance_checked_at, COALESCE(NULLIF(u.display_name, ''), u.username) AS checked_by, - s.lead_user_id, COALESCE(NULLIF(l.display_name, ''), l.username) AS lead_name + s.lead_user_id, COALESCE(NULLIF(l.display_name, ''), l.username) AS lead_name, s.important FROM raid_settings s LEFT JOIN users u ON u.id = s.attendance_checked_by LEFT JOIN users l ON l.id = s.lead_user_id @@ -164,6 +164,7 @@ function raid_settings_get(int $raidId): array 'checked_by' => $row['checked_by'] ?? null, 'lead_user_id' => isset($row['lead_user_id']) ? (int) $row['lead_user_id'] : null, 'lead_name' => $row['lead_name'] ?? null, + 'important' => !empty($row['important']), ]; } @@ -194,6 +195,17 @@ function raid_settings_save_points(int $raidId, int $present, int $absent): void )->execute([$raidId, $present, $absent]); } +/** + * Raid als wichtig markieren (oder nicht mehr) - nur die Raid-Leitung (raid_important_action.php). Legt fehlende + * Einstellungen vorher mit dem festen Punkt an, damit die neue Zeile die Lumipunkte nicht auf 0 setzt. + */ +function raid_settings_save_important(int $raidId, bool $important): void +{ + raid_settings_ensure_defaults([$raidId]); + db()->prepare('INSERT INTO raid_settings (raid_id, important) VALUES (?, ?) ON DUPLICATE KEY UPDATE important = VALUES(important)') + ->execute([$raidId, $important ? 1 : 0]); +} + /** * Was die Raid-Nachricht im Discord zusaetzlich zeigt und nur hier auf der Website liegt: den Raid-Lead * (Discord-ID, und der Name, falls er nicht auf dem Server ist) und die Lumipunkte als Text. diff --git a/includes/raid_card.php b/includes/raid_card.php index 8389977..28f92e5 100644 --- a/includes/raid_card.php +++ b/includes/raid_card.php @@ -62,7 +62,7 @@ function raid_card_started(array $raid): bool function raid_card_rev(array $raid, ?array $setting): string { $settingFields = []; - foreach (['points_present', 'points_absent', 'auto_processed_at', 'auto_result', 'attendance_checked_at', 'lead_user_id', 'lead_name'] as $key) { + foreach (['points_present', 'points_absent', 'auto_processed_at', 'auto_result', 'attendance_checked_at', 'lead_user_id', 'lead_name', 'important'] as $key) { $settingFields[$key] = isset($setting[$key]) ? (string) $setting[$key] : null; } return substr(md5((string) json_encode([$raid, $settingFields, raid_card_started($raid)], JSON_UNESCAPED_UNICODE)), 0, 16); @@ -146,6 +146,8 @@ function render_raid_card(array $raid, array $ctx): void // Raids des Consilium Elyseum bringen keine Lumipunkte - dort ist davon nirgends die Rede $isConsilium = raid_area($raid) === 'consilium'; $raidStarted = raid_card_started($raid); + // Von der Raid-Leitung als wichtig markiert - setzen darf es nur sie, nicht der Raid-Lead + $isImportant = !empty($raidSetting['important']); $isNew = !$isArchived && isset($ctx['new_since']) && raid_posted_at($raidId) > (int) $ctx['new_since']; // Suchtext fuer die Raid-Suche: Titel, Termin, Anforderungen, Gruppen, Spieler und Klassen @@ -158,7 +160,7 @@ function render_raid_card(array $raid, array $ctx): void $mySignupGroupNumber = $mySignup ? (int) ($mySignup['group'] ?? 0) : null; $mySignupGroupLabel = $mySignupGroupNumber === 0 ? 'Ersatzbank' : ($mySignupGroupNumber ? ($groupNames[$mySignupGroupNumber - 1] ?? ('#' . $mySignupGroupNumber)) : null); ?> -

+ + Wichtig + Neu @@ -177,6 +182,15 @@ function render_raid_card(array $raid, array $ctx): void Archiviert / angemeldet + +
+ + + + + +
+