From fea0cc3a91a51ce1f693932d636dd10ee755d54b Mon Sep 17 00:00:00 2001 From: Maaxxs <61059039+MaaxxsDev@users.noreply.github.com> Date: Fri, 18 Sep 2026 18:36:04 +0200 Subject: [PATCH] Overhaul raid signup/management to match the Discord bot's full feature set Signup is now a single "Anmelden" button that opens a class-icon picker + optional group choice. A new raid_wish_is_sensible() mirrors the bot's exact role-cap algorithm (Tank/Heal 1, DPS 3 per 5-player group, ROLE_MAPPING copied from teamplaner.py) to decide server-side whether the requested group is honored or the request falls back to the bot's own auto-assignment - with a message telling the member to ping the raid lead if they wanted something specific. Verified the cap logic with 7 synthetic cases (own-signup exclusion, full group, role caps, bench always allowed) before wiring it up. Admins get a per-raid edit-mode toggle (pencil icon) that reveals: inline raid editing (title/date/requirements/gearscore/groups/slots/ group locks) via PATCH, a premade-invite mini-form via the new premades endpoint, and native HTML5 drag-and-drop to move a signup between groups/bench via PATCH .../signup/{user_id}. New pieces: includes/raids_api.php gained move_signup(), update_raid(), invite_premade(), fetch_premades(), fetch_raid_by_id() and the wish- sensibility check; four new JSON action endpoints (raid_signup_action, raid_move_action, raid_edit_action, raid_premade_invite_action) reusing the session CSRF token via a new verify_csrf_token()/read_json_body()/ json_response() trio in functions.php; assets/js/raids.js drives the modal, edit-mode, and drag-and-drop with plain fetch() (no framework). Read-heavy parts (page render, class icons, signup-wish logic) verified against real data/live API. Edit, move and premade-invite are NOT tested against the live API yet since they'd mutate the real raid or send real Discord DMs to guild members - flagging this for a supervised live check before considering it fully verified. Co-Authored-By: Claude Sonnet 5 --- assets/css/style.css | 140 ++++++++++++++++++++ assets/js/raids.js | 235 +++++++++++++++++++++++++++++++++ includes/functions.php | 46 ++++++- includes/header.php | 1 + includes/raids_api.php | 148 ++++++++++++++++++++- raid_edit_action.php | 36 +++++ raid_move_action.php | 22 +++ raid_premade_invite_action.php | 22 +++ raid_signup_action.php | 73 ++++++++++ raids.php | 209 ++++++++++++++++++++++------- 10 files changed, 876 insertions(+), 56 deletions(-) create mode 100644 assets/js/raids.js create mode 100644 raid_edit_action.php create mode 100644 raid_move_action.php create mode 100644 raid_premade_invite_action.php create mode 100644 raid_signup_action.php diff --git a/assets/css/style.css b/assets/css/style.css index cf231f7..43a6faa 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -577,3 +577,143 @@ input:focus, select:focus, textarea:focus { .sidebar-user { display: none; } } + +/* --- Raid-Verwaltung: Icon-Buttons, Editor-Modus, Modal, Drag & Drop --- */ + +.icon-button { + display: inline-flex; + align-items: center; + justify-content: center; + width: 32px; + height: 32px; + padding: 0; + background: var(--bg-panel-alt); + border: 1px solid var(--border); + border-radius: 6px; + color: var(--text-muted); + cursor: pointer; +} + +.icon-button:hover { color: var(--gold); border-color: var(--gold); } + +.raid-card.editing .raid-edit-toggle { color: var(--gold); border-color: var(--gold); } + +.raid-edit-panel { + display: none; + margin-top: 1rem; + padding: 1rem; + background: var(--bg-panel-alt); + border: 1px dashed var(--border); + border-radius: 8px; +} + +.raid-card.editing .raid-edit-panel { display: block; } + +.raid-edit-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); + gap: 0.75rem; + margin-bottom: 1rem; +} + +.raid-edit-form .actions { align-items: center; } + +.raid-premade-form { + margin-top: 1rem; + padding-top: 1rem; + border-top: 1px solid var(--border); +} + +.raid-premade-row { + display: flex; + flex-wrap: wrap; + gap: 0.5rem; + align-items: center; +} + +.raid-premade-row select { width: auto; } + +.raid-empty-hint { margin: 0; } + +/* Drag & Drop nur optisch aktiv, wenn die Karte im Editor-Modus ist */ +.raid-card.editing .raid-signup-item { cursor: grab; } +.raid-signup-item.dragging { opacity: 0.4; } + +.raid-drop-zone { transition: background 0.15s ease, border-color 0.15s ease; } +.raid-card.editing .raid-drop-zone.drag-over { + background: rgba(201, 162, 39, 0.15); + border-color: var(--gold); +} + +/* --- Anmelde-Popup --- */ + +.modal-overlay { + position: fixed; + inset: 0; + background: rgba(0, 0, 0, 0.65); + display: flex; + align-items: center; + justify-content: center; + z-index: 1000; + padding: 1rem; +} + +.modal { + position: relative; + width: 100%; + max-width: 480px; + max-height: 90vh; + overflow-y: auto; + background: var(--bg-panel); + border: 1px solid var(--border); + border-radius: 10px; + padding: 2rem; + box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); +} + +.modal .modal-close { + position: absolute; + top: 1rem; + right: 1rem; +} + +.class-picker { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); + gap: 0.6rem; + margin: 1.25rem 0; +} + +.class-picker-option { + display: flex; + flex-direction: column; + align-items: center; + gap: 0.4rem; + padding: 0.75rem 0.5rem; + background: var(--bg-panel-alt); + border: 1px solid var(--border); + border-radius: 8px; + color: var(--text); + cursor: pointer; + font-size: 0.8rem; + text-align: center; +} + +.class-picker-option img { width: 32px; height: 32px; } + +.class-picker-option:hover { border-color: var(--gold); } + +.class-picker-option.selected { + border-color: var(--gold); + background: rgba(201, 162, 39, 0.15); + color: var(--gold); +} + +.raid-modal-feedback { + min-height: 1.2rem; + margin-bottom: 0.5rem; + font-size: 0.9rem; +} + +.raid-modal-feedback.success { color: var(--success); } +.raid-modal-feedback.error { color: var(--danger); } diff --git a/assets/js/raids.js b/assets/js/raids.js new file mode 100644 index 0000000..ee8fc08 --- /dev/null +++ b/assets/js/raids.js @@ -0,0 +1,235 @@ +(function () { + 'use strict'; + + var csrfToken = (document.querySelector('meta[name="csrf-token"]') || {}).content || ''; + + function postJson(url, data) { + data.csrf_token = csrfToken; + return fetch(url, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(data) + }).then(function (response) { + return response.json(); + }); + } + + // ---- Anmelde-Popup ---- + var modal = document.getElementById('raid-signup-modal'); + var groupSelect = document.getElementById('raid-signup-group'); + var feedbackEl = document.getElementById('raid-signup-feedback'); + var confirmBtn = document.getElementById('raid-signup-confirm'); + var currentRaidId = null; + var selectedClass = null; + + function openSignupModal(card) { + if (!modal) return; + currentRaidId = card.getAttribute('data-raid-id'); + selectedClass = card.getAttribute('data-my-class') || null; + + var groups = []; + try { + groups = JSON.parse(card.getAttribute('data-groups') || '[]'); + } catch (e) { + groups = []; + } + var myGroup = card.getAttribute('data-my-group') || ''; + + groupSelect.innerHTML = ''; + groups.forEach(function (name, index) { + var opt = document.createElement('option'); + opt.value = String(index + 1); + opt.textContent = name; + if (String(index + 1) === myGroup) opt.selected = true; + groupSelect.appendChild(opt); + }); + var benchOpt = document.createElement('option'); + benchOpt.value = '0'; + benchOpt.textContent = 'Ersatzbank'; + if (myGroup === '0') benchOpt.selected = true; + groupSelect.appendChild(benchOpt); + + modal.querySelectorAll('.class-picker-option').forEach(function (btn) { + btn.classList.toggle('selected', btn.getAttribute('data-class') === selectedClass); + }); + + feedbackEl.textContent = ''; + feedbackEl.className = 'raid-modal-feedback'; + modal.hidden = false; + } + + function closeSignupModal() { + if (modal) modal.hidden = true; + } + + document.querySelectorAll('.raid-open-signup').forEach(function (btn) { + btn.addEventListener('click', function () { + var card = btn.closest('.raid-card'); + if (card) openSignupModal(card); + }); + }); + + if (modal) { + modal.querySelector('.modal-close').addEventListener('click', closeSignupModal); + modal.addEventListener('click', function (e) { + if (e.target === modal) closeSignupModal(); + }); + + modal.querySelectorAll('.class-picker-option').forEach(function (btn) { + btn.addEventListener('click', function () { + selectedClass = btn.getAttribute('data-class'); + modal.querySelectorAll('.class-picker-option').forEach(function (b) { + b.classList.toggle('selected', b === btn); + }); + }); + }); + + confirmBtn.addEventListener('click', function () { + if (!selectedClass) { + feedbackEl.textContent = 'Bitte zuerst eine Klasse auswählen.'; + feedbackEl.className = 'raid-modal-feedback error'; + return; + } + confirmBtn.disabled = true; + feedbackEl.textContent = 'Wird gesendet …'; + feedbackEl.className = 'raid-modal-feedback'; + + postJson('/raid_signup_action.php', { + raid_id: currentRaidId, + class: selectedClass, + group: groupSelect.value === '' ? null : parseInt(groupSelect.value, 10) + }).then(function (result) { + feedbackEl.textContent = result.message || ''; + feedbackEl.className = 'raid-modal-feedback ' + (result.status === 'success' ? 'success' : 'error'); + if (result.status === 'success') { + setTimeout(function () { window.location.reload(); }, 1400); + } else { + confirmBtn.disabled = false; + } + }).catch(function () { + feedbackEl.textContent = 'Verbindung fehlgeschlagen. Bitte erneut versuchen.'; + feedbackEl.className = 'raid-modal-feedback error'; + confirmBtn.disabled = false; + }); + }); + } + + // ---- Editor-Modus ---- + document.querySelectorAll('.raid-edit-toggle').forEach(function (btn) { + btn.addEventListener('click', function () { + var card = btn.closest('.raid-card'); + if (card) card.classList.toggle('editing'); + }); + }); + + // ---- Raid bearbeiten (Formular) ---- + document.querySelectorAll('.raid-edit-form').forEach(function (form) { + form.addEventListener('submit', function (e) { + e.preventDefault(); + var feedback = form.querySelector('.raid-edit-feedback'); + var lockedGroups = Array.prototype.slice.call(form.querySelectorAll('input[name="locked_groups[]"]:checked')) + .map(function (cb) { return parseInt(cb.value, 10); }); + + feedback.textContent = 'Wird gespeichert …'; + postJson('/raid_edit_action.php', { + raid_id: form.getAttribute('data-raid-id'), + title: form.title.value, + date_raw: form.date_raw.value, + requirements: form.requirements.value, + gearscore: form.gearscore.value, + group_names: form.group_names.value, + max_slots: form.max_slots.value, + locked_groups: lockedGroups + }).then(function (result) { + feedback.textContent = result.message || ''; + if (result.status === 'success') { + setTimeout(function () { window.location.reload(); }, 900); + } + }).catch(function () { + feedback.textContent = 'Verbindung fehlgeschlagen.'; + }); + }); + }); + + // ---- Premade einladen ---- + document.querySelectorAll('.raid-premade-form').forEach(function (form) { + form.addEventListener('submit', function (e) { + e.preventDefault(); + var feedback = form.querySelector('.raid-premade-feedback'); + feedback.textContent = 'Wird eingeladen …'; + + postJson('/raid_premade_invite_action.php', { + raid_id: form.getAttribute('data-raid-id'), + premade_id: form.premade_id.value, + group: form.group.value + }).then(function (result) { + feedback.textContent = result.message || ''; + if (result.status === 'success') { + setTimeout(function () { window.location.reload(); }, 1200); + } + }).catch(function () { + feedback.textContent = 'Verbindung fehlgeschlagen.'; + }); + }); + }); + + // ---- Drag & Drop (nur im Editor-Modus) ---- + document.querySelectorAll('.raid-signup-item').forEach(function (item) { + item.addEventListener('dragstart', function (e) { + var card = item.closest('.raid-card'); + if (!card || !card.classList.contains('editing')) { + e.preventDefault(); + return; + } + e.dataTransfer.setData('text/plain', JSON.stringify({ + raidId: card.getAttribute('data-raid-id'), + userId: item.getAttribute('data-user-id') + })); + item.classList.add('dragging'); + }); + item.addEventListener('dragend', function () { + item.classList.remove('dragging'); + }); + }); + + document.querySelectorAll('.raid-drop-zone').forEach(function (zone) { + zone.addEventListener('dragover', function (e) { + var card = zone.closest('.raid-card'); + if (!card || !card.classList.contains('editing')) return; + e.preventDefault(); + zone.classList.add('drag-over'); + }); + zone.addEventListener('dragleave', function () { + zone.classList.remove('drag-over'); + }); + zone.addEventListener('drop', function (e) { + e.preventDefault(); + zone.classList.remove('drag-over'); + var card = zone.closest('.raid-card'); + if (!card || !card.classList.contains('editing')) return; + + var raw = e.dataTransfer.getData('text/plain'); + if (!raw) return; + var payload; + try { + payload = JSON.parse(raw); + } catch (err) { + return; + } + + postJson('/raid_move_action.php', { + raid_id: payload.raidId, + user_id: payload.userId, + group: zone.getAttribute('data-group') + }).then(function (result) { + if (result.status === 'success') { + window.location.reload(); + } else { + alert(result.message || 'Verschieben fehlgeschlagen.'); + } + }).catch(function () { + alert('Verbindung fehlgeschlagen.'); + }); + }); + }); +})(); diff --git a/includes/functions.php b/includes/functions.php index 5ba97b7..8d6272a 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -27,13 +27,52 @@ function csrf_field(): string function verify_csrf(): void { - $token = $_POST['csrf_token'] ?? ''; - if (!is_string($token) || !hash_equals($_SESSION['csrf_token'] ?? '', $token)) { + verify_csrf_token($_POST['csrf_token'] ?? ''); +} + +// Fuer JSON-Endpunkte (fetch()), die kein normales $_POST haben. +function verify_csrf_token($token): void +{ + if (!is_string($token) || $token === '' || !hash_equals($_SESSION['csrf_token'] ?? '', $token)) { http_response_code(400); exit('Ungültige Anfrage (CSRF-Token fehlt oder ist abgelaufen). Bitte Seite neu laden und erneut versuchen.'); } } +/** + * Liest einen JSON-Request-Body (fuer fetch()-Endpunkte). Bricht mit 400 ab, + * wenn der Body kein gueltiges JSON-Objekt ist. + * + * @return array + */ +function read_json_body(): array +{ + $raw = file_get_contents('php://input'); + $data = json_decode((string) $raw, true); + if (!is_array($data)) { + http_response_code(400); + header('Content-Type: application/json'); + echo json_encode(['status' => 'error', 'message' => 'Ungültiger Request-Body.']); + exit; + } + return $data; +} + +/** + * Beendet einen JSON-Endpunkt mit einer Erfolgs- oder Fehlerantwort. + * + * @param array $extra Zusaetzliche Felder fuer die JSON-Antwort. + */ +function json_response(bool $success, string $message = '', array $extra = []): void +{ + header('Content-Type: application/json'); + echo json_encode(array_merge([ + 'status' => $success ? 'success' : 'error', + 'message' => $message, + ], $extra), JSON_UNESCAPED_UNICODE); + exit; +} + function set_flash(string $type, string $message): void { $_SESSION['flash'][] = ['type' => $type, 'message' => $message]; @@ -73,6 +112,9 @@ function icon(string $name): string 'profile' => '', 'link' => '', 'list' => '', + 'edit' => '', + 'x' => '', + 'move' => '', ]; $path = $paths[$name] ?? ''; diff --git a/includes/header.php b/includes/header.php index 106d298..ba552c2 100644 --- a/includes/header.php +++ b/includes/header.php @@ -32,6 +32,7 @@ $pageBackgroundClass = $pageBackgrounds[$currentScript] ?? ''; + <?= e(($pageTitle ?? '') !== '' ? $pageTitle . ' - Aion2 Gilde' : 'Aion2 Gilde') ?> diff --git a/includes/raids_api.php b/includes/raids_api.php index 769b4d0..1fd4aa8 100644 --- a/includes/raids_api.php +++ b/includes/raids_api.php @@ -122,15 +122,22 @@ function restore_raid(int $raidId): void raids_api_request('POST', '/' . $raidId . '/restore'); } -/** @throws RuntimeException */ -function raid_signup(int $raidId, int $discordId, string $discordName, string $className, int $group): void +/** + * @param int|null $group Feste Zielgruppe (0 = Ersatzbank) oder null, damit der Bot + * automatisch nach Rollen-Caps zuteilt. + * @return array Die von der API zugewiesene Anmeldung (u.a. tatsaechliche "group"). + * @throws RuntimeException + */ +function raid_signup(int $raidId, int $discordId, string $discordName, string $className, ?int $group): array { - raids_api_request('POST', '/' . $raidId . '/signup', [], [ + $data = raids_api_request('POST', '/' . $raidId . '/signup', [], [ 'user_id' => $discordId, 'name' => $discordName, 'class' => $className, 'group' => $group, ]); + + return $data['signup'] ?? []; } /** @throws RuntimeException */ @@ -138,3 +145,138 @@ function raid_unsignup(int $raidId, int $discordId): void { raids_api_request('DELETE', '/' . $raidId . '/signup/' . $discordId); } + +/** @throws RuntimeException */ +function move_signup(int $raidId, int $discordId, int $group): void +{ + raids_api_request('PATCH', '/' . $raidId . '/signup/' . $discordId, [], ['group' => $group]); +} + +/** + * @param array $fields Nur die zu aendernden Felder, z.B. + * ['title' => ..., 'date_raw' => ..., 'requirements' => ..., 'gearscore' => ..., + * 'group_names' => ..., 'max_slots' => ..., 'locked_groups' => [1, 3]] + * @throws RuntimeException + */ +function update_raid(int $raidId, array $fields): void +{ + raids_api_request('PATCH', '/' . $raidId, [], $fields); +} + +/** @throws RuntimeException */ +function invite_premade(int $raidId, int $premadeId, int $group): int +{ + $data = raids_api_request('POST', '/' . $raidId . '/premades/' . $premadeId . '/invite', [], ['group' => $group]); + + return (int) ($data['invited_count'] ?? 0); +} + +/** + * @return array> + * @throws RuntimeException + */ +function fetch_premades(): array +{ + $configPath = __DIR__ . '/../config.php'; + if (!file_exists($configPath)) { + throw new RuntimeException('Konfigurationsdatei fehlt.'); + } + $config = require $configPath; + $apiUrl = $config['raids_api']['url'] ?? ''; + $apiKey = $config['raids_api']['key'] ?? ''; + if ($apiUrl === '' || $apiKey === '') { + throw new RuntimeException('Raid-API ist nicht konfiguriert.'); + } + + // /api/premades liegt eine Ebene ueber /api/raids. + $base = preg_replace('#/raids$#', '', rtrim($apiUrl, '/')); + + $ch = curl_init($base . '/premades'); + curl_setopt_array($ch, [ + CURLOPT_RETURNTRANSFER => true, + CURLOPT_HTTPHEADER => ['X-API-Key: ' . $apiKey], + CURLOPT_TIMEOUT => 10, + CURLOPT_SSL_VERIFYPEER => true, + ]); + $response = curl_exec($ch); + $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); + curl_close($ch); + + if ($response === false || $httpCode !== 200) { + throw new RuntimeException('Premades konnten nicht geladen werden.'); + } + + $data = json_decode($response, true); + if (!is_array($data) || ($data['status'] ?? '') !== 'success' || !is_array($data['premades'] ?? null)) { + throw new RuntimeException('Unerwartetes Antwortformat der Premades-API.'); + } + + return $data['premades']; +} + +/** + * Sucht einen einzelnen Raid (inkl. aktueller Signups) anhand seiner ID. + * + * @return array|null + * @throws RuntimeException + */ +function fetch_raid_by_id(int $raidId): ?array +{ + foreach (fetch_raids('all') as $raid) { + if ((int) ($raid['raid_id'] ?? 0) === $raidId) { + return $raid; + } + } + + return null; +} + +// Rollen-Zuordnung 1:1 aus ROLE_MAPPING in teamplaner.py uebernommen. +const RAID_ROLE_MAPPING = [ + 'Templer' => 'Tank', + 'Kleriker' => 'Heal', + 'Kantor' => 'Heal', + 'Gladiator' => 'DPS', + 'Assassine' => 'DPS', + 'Jäger' => 'DPS', + 'Magier' => 'DPS', + 'Beschwörer' => 'DPS', +]; +const RAID_GROUP_SIZE = 5; +const RAID_ROLE_CAPS = ['Tank' => 1, 'Heal' => 1, 'DPS' => 3]; + +/** + * Prueft, ob eine gewuenschte Gruppe fuer eine Klasse nach den gleichen Rollen-Caps + * Sinn ergeben wuerde wie der Smart-Sort-Algorithmus des Bots (Tank/Heal je max. 1, + * DPS max. 3 pro 5er-Gruppe). Die Ersatzbank (Gruppe 0) ist immer erlaubt. + * + * @param array> $signups Aktuelle Anmeldungen des Raids. + */ +function raid_wish_is_sensible(array $signups, int $discordId, string $className, int $desiredGroup): bool +{ + if ($desiredGroup <= 0) { + return true; + } + + $role = RAID_ROLE_MAPPING[$className] ?? 'DPS'; + $counts = ['Tank' => 0, 'Heal' => 0, 'DPS' => 0]; + $total = 0; + + foreach ($signups as $signup) { + if ((int) ($signup['user_id'] ?? 0) === $discordId) { + continue; // eigene bestehende Anmeldung nicht mitzaehlen + } + if ((int) ($signup['group'] ?? 0) !== $desiredGroup) { + continue; + } + $memberRole = RAID_ROLE_MAPPING[$signup['class'] ?? ''] ?? 'DPS'; + $counts[$memberRole]++; + $total++; + } + + if ($total >= RAID_GROUP_SIZE) { + return false; + } + + return $counts[$role] < RAID_ROLE_CAPS[$role]; +} diff --git a/raid_edit_action.php b/raid_edit_action.php new file mode 100644 index 0000000..e402b3d --- /dev/null +++ b/raid_edit_action.php @@ -0,0 +1,36 @@ +getMessage()); +} diff --git a/raid_move_action.php b/raid_move_action.php new file mode 100644 index 0000000..dd82c73 --- /dev/null +++ b/raid_move_action.php @@ -0,0 +1,22 @@ +getMessage()); +} diff --git a/raid_premade_invite_action.php b/raid_premade_invite_action.php new file mode 100644 index 0000000..25c9185 --- /dev/null +++ b/raid_premade_invite_action.php @@ -0,0 +1,22 @@ +getMessage()); +} diff --git a/raid_signup_action.php b/raid_signup_action.php new file mode 100644 index 0000000..faa4af8 --- /dev/null +++ b/raid_signup_action.php @@ -0,0 +1,73 @@ + $maxGroups) { + json_response(false, 'Ungültige Gruppe ausgewählt.'); + } + + if (raid_wish_is_sensible($signups, $discordId, $class, $desiredGroup)) { + $requestGroup = $desiredGroup; + } else { + $requestGroup = null; // Bot automatisch zuteilen lassen + $matchedWish = false; + } + } + + $assigned = raid_signup($raidId, $discordId, (string) $user['discord_username'], $class, $requestGroup); + $assignedGroup = (int) ($assigned['group'] ?? 0); + + $groupNames = array_values(array_filter(array_map('trim', explode(',', (string) ($raid['groups'] ?? ''))))); + $assignedGroupLabel = $assignedGroup === 0 ? 'Ersatzbank' : ($groupNames[$assignedGroup - 1] ?? ('Gruppe ' . $assignedGroup)); + + if ($matchedWish) { + json_response(true, 'Du bist angemeldet: ' . $class . ' in ' . $assignedGroupLabel . '.', [ + 'group' => $assignedGroup, + 'matched_wish' => true, + ]); + } else { + json_response(true, 'Deine Wunschgruppe war schon voll besetzt für diese Rolle, daher wurdest du automatisch zugeteilt: ' + . $assignedGroupLabel . '. Melde dich gerne beim Raid-Lead, falls du eine Anpassung möchtest.', [ + 'group' => $assignedGroup, + 'matched_wish' => false, + ]); + } +} catch (Throwable $e) { + json_response(false, 'Anmeldung fehlgeschlagen: ' . $e->getMessage()); +} diff --git a/raids.php b/raids.php index 46aa480..7b7ea93 100644 --- a/raids.php +++ b/raids.php @@ -3,18 +3,21 @@ require_once __DIR__ . '/includes/bootstrap.php'; require_once __DIR__ . '/includes/raids_api.php'; require_permission('raids.view'); -function render_signup_list(array $members): void +function render_signup_list(array $members, bool $draggable): void { ?> -
    +