Charakterverwalter (westreiche_website) ergänzen, Website-Nav "Charaktere"
This commit is contained in:
parent
d107f90c93
commit
01dae01c7c
84 changed files with 8915 additions and 17 deletions
7
westreiche_website/views/.htaccess
Normal file
7
westreiche_website/views/.htaccess
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<IfModule mod_authz_core.c>
|
||||
Require all denied
|
||||
</IfModule>
|
||||
<IfModule !mod_authz_core.c>
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
</IfModule>
|
||||
149
westreiche_website/views/_fields.php
Normal file
149
westreiche_website/views/_fields.php
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
<?php
|
||||
/**
|
||||
* Gemeinsame Formularfelder für Charaktere.
|
||||
* @var array $values
|
||||
* @var array|null $character
|
||||
* @var array $owners
|
||||
*/
|
||||
?>
|
||||
<div class="grid-3">
|
||||
<label class="field" style="grid-column: span 2;">
|
||||
<span>Name des Charakters</span>
|
||||
<input type="text" name="name" value="<?= e((string) $values['name']) ?>" required maxlength="120" autofocus>
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Beiname / Titel</span>
|
||||
<input type="text" name="title" value="<?= e((string) $values['title']) ?>" maxlength="120">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="grid-4">
|
||||
<label class="field">
|
||||
<span>Klasse</span>
|
||||
<select name="class_name">
|
||||
<?php foreach (WS_CLASSES as $class): ?>
|
||||
<option value="<?= e($class) ?>"<?= $values['class_name'] === $class ? ' selected' : '' ?>><?= e($class) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Stufe</span>
|
||||
<input type="number" name="level" min="1" max="20" value="<?= (int) $values['level'] ?>">
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Erfahrungspunkte</span>
|
||||
<input type="number" name="xp" min="0" value="<?= (int) $values['xp'] ?>">
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Gesinnung</span>
|
||||
<select name="alignment">
|
||||
<?php foreach (WS_ALIGNMENTS as $alignment): ?>
|
||||
<option value="<?= e($alignment) ?>"<?= $values['alignment'] === $alignment ? ' selected' : '' ?>><?= e($alignment) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="grid-4">
|
||||
<label class="field">
|
||||
<span>TP aktuell</span>
|
||||
<input type="number" name="hp_current" value="<?= (int) $values['hp_current'] ?>">
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>TP maximal</span>
|
||||
<input type="number" name="hp_max" min="1" value="<?= (int) $values['hp_max'] ?>">
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Rüstungsklasse (leer = automatisch)</span>
|
||||
<input type="number" name="ac" value="<?= $values['ac'] === null ? '' : (int) $values['ac'] ?>"
|
||||
inputmode="numeric" placeholder="aus Rüstung">
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Angriffsbonus (Grundwert)</span>
|
||||
<input type="number" name="attack_bonus" value="<?= (int) $values['attack_bonus'] ?>">
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Goldmünzen</span>
|
||||
<input type="number" name="gold_coins" value="<?= (int) $values['gold_coins'] ?>">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<hr class="divider">
|
||||
<h2 style="font-size:1rem;">Attribute</h2>
|
||||
<div class="grid-3">
|
||||
<?php foreach (WS_ATTRIBUTES as $field => [$short, $label]): ?>
|
||||
<label class="field">
|
||||
<span><?= e($label) ?> (<?= e($short) ?>) · Bonus <b class="<?= bonus_class(attribute_bonus((int) $values[$field])) ?>" data-attr-bonus="<?= e($field) ?>"><?= e(signed(attribute_bonus((int) $values[$field]))) ?></b></span>
|
||||
<input type="number" name="<?= e($field) ?>" data-attr value="<?= (int) $values[$field] ?>" min="3" max="20">
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<hr class="divider">
|
||||
<h2 style="font-size:1rem;">Rettungswürfe <small class="muted">(leer lassen, wenn nicht geführt)</small></h2>
|
||||
<div class="grid-4">
|
||||
<?php foreach (WS_SAVES as $field => $label): ?>
|
||||
<label class="field">
|
||||
<span><?= e($label) ?></span>
|
||||
<input type="number" name="<?= e($field) ?>" value="<?= $values[$field] === null ? '' : (int) $values[$field] ?>" min="-10" max="30">
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<hr class="divider">
|
||||
<h2 style="font-size:1rem;">Person</h2>
|
||||
<div class="grid-4">
|
||||
<label class="field">
|
||||
<span>Gottheit / Patron</span>
|
||||
<input type="text" name="deity" value="<?= e((string) $values['deity']) ?>" maxlength="120" placeholder="z. B. Amaunator">
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Alter</span>
|
||||
<input type="text" name="age" value="<?= e((string) $values['age']) ?>" maxlength="40">
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Größe</span>
|
||||
<input type="text" name="height" value="<?= e((string) $values['height']) ?>" maxlength="40">
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Gewicht</span>
|
||||
<input type="text" name="weight" value="<?= e((string) $values['weight']) ?>" maxlength="40">
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Status</span>
|
||||
<select name="status">
|
||||
<?php foreach (WS_CHARACTER_STATUS as $key => $label): ?>
|
||||
<option value="<?= e($key) ?>"<?= $values['status'] === $key ? ' selected' : '' ?>><?= e($label) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</label>
|
||||
<?php if ($owners !== []): ?>
|
||||
<label class="field">
|
||||
<span>Gehört zu Konto</span>
|
||||
<select name="user_id">
|
||||
<?php foreach ($owners as $owner): ?>
|
||||
<option value="<?= (int) $owner['id'] ?>"<?= (int) ($character['user_id'] ?? 0) === (int) $owner['id'] ? ' selected' : '' ?>>
|
||||
<?= e((string) $owner['username']) ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<hr class="divider">
|
||||
<h2 style="font-size:1rem;">Erscheinung, Hintergrund, Notizen</h2>
|
||||
<div class="form-grid">
|
||||
<label class="field">
|
||||
<span>Erscheinung</span>
|
||||
<textarea name="appearance" rows="3" maxlength="4000"><?= e((string) $values['appearance']) ?></textarea>
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Hintergrund</span>
|
||||
<textarea name="background" rows="3" maxlength="4000"><?= e((string) $values['background']) ?></textarea>
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Notizen</span>
|
||||
<textarea name="notes" rows="3" maxlength="4000"><?= e((string) $values['notes']) ?></textarea>
|
||||
</label>
|
||||
</div>
|
||||
84
westreiche_website/views/_selector_skills.php
Normal file
84
westreiche_website/views/_selector_skills.php
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
<?php
|
||||
/**
|
||||
* Selektor-Schirm: Fertigkeit aus dem Katalog wählen.
|
||||
*
|
||||
* Wird aus views/character_edit.php eingebunden; erwartet $base, $skillCatalog
|
||||
* und $skills (bereits eingetragene Fertigkeiten des Charakters).
|
||||
*
|
||||
* @var string $base
|
||||
* @var array $skillCatalog
|
||||
* @var array $skills
|
||||
*/
|
||||
$existing = [];
|
||||
foreach ($skills as $row) {
|
||||
$existing[mb_strtolower(trim((string) $row['name']), 'UTF-8')] = true;
|
||||
}
|
||||
|
||||
$grouped = [];
|
||||
foreach ($skillCatalog as $entry) {
|
||||
$category = trim((string) ($entry['category'] ?? ''));
|
||||
if ($category === '') {
|
||||
$category = 'Sonstiges';
|
||||
}
|
||||
$grouped[$category][] = $entry;
|
||||
}
|
||||
$order = array_flip(WS_SKILL_GROUPS);
|
||||
uksort($grouped, static function (string $a, string $b) use ($order): int {
|
||||
return ($order[$a] ?? 99) <=> ($order[$b] ?? 99) ?: strcmp($a, $b);
|
||||
});
|
||||
?>
|
||||
<dialog class="selector" id="skill-selector" aria-labelledby="skill-selector-title">
|
||||
<div class="selector-head">
|
||||
<h2 id="skill-selector-title">Fertigkeit hinzufügen</h2>
|
||||
<button class="btn btn-small" type="button" data-dialog-close>Schließen</button>
|
||||
</div>
|
||||
<div class="selector-body">
|
||||
<form method="post" action="<?= e($base . '/skills/add') ?>">
|
||||
<?= csrf_field() ?>
|
||||
<div class="selector-filters">
|
||||
<label class="field">
|
||||
<span>Suche</span>
|
||||
<input type="search" data-selector-search placeholder="Name der Fertigkeit …" autocomplete="off">
|
||||
</label>
|
||||
</div>
|
||||
<div class="selector-groups">
|
||||
<?php foreach ($grouped as $category => $entries): ?>
|
||||
<p class="selector-group"><?= e($category) ?></p>
|
||||
<?php foreach ($entries as $entry): ?>
|
||||
<?php
|
||||
$key = mb_strtolower(trim((string) $entry['name']), 'UTF-8');
|
||||
$known = isset($existing[$key]);
|
||||
?>
|
||||
<button class="selector-item" type="submit" name="skill_id" value="<?= (int) $entry['id'] ?>"
|
||||
data-selector-item data-name="<?= e($key) ?>"
|
||||
<?= $known ? 'disabled' : '' ?>>
|
||||
<span><?= e((string) $entry['name']) ?><?= $known ? ' · <em>vorhanden</em>' : '' ?></span>
|
||||
<span class="meta"><?= e((string) ($entry['attribute'] ?? '')) ?></span>
|
||||
</button>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<p class="selector-empty" data-selector-empty hidden>Keine Fertigkeit passt zur Suche.</p>
|
||||
</form>
|
||||
|
||||
<details class="selector-custom">
|
||||
<summary>Eigene Fertigkeit eintragen</summary>
|
||||
<form method="post" action="<?= e($base . '/skills/add') ?>" class="inline-form">
|
||||
<?= csrf_field() ?>
|
||||
<label class="field grow">
|
||||
<span>Name</span>
|
||||
<input type="text" name="name" maxlength="80" placeholder="z. B. Kochen" required>
|
||||
</label>
|
||||
<label class="field" style="max-width:7rem">
|
||||
<span>Bonus</span>
|
||||
<input type="number" name="bonus" value="0" min="-10" max="20">
|
||||
</label>
|
||||
<label class="field grow">
|
||||
<span>Notiz</span>
|
||||
<input type="text" name="note" maxlength="255">
|
||||
</label>
|
||||
<button class="btn" type="submit">Eintragen</button>
|
||||
</form>
|
||||
</details>
|
||||
</div>
|
||||
</dialog>
|
||||
124
westreiche_website/views/_selector_spells.php
Normal file
124
westreiche_website/views/_selector_spells.php
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
<?php
|
||||
/**
|
||||
* Selektor-Schirm: Zauber oder Liturgie aus dem Katalog wählen.
|
||||
*
|
||||
* Wird aus views/character_edit.php eingebunden; erwartet $base, $spellCatalog
|
||||
* und $spells (bereits gelernte Zauber, nach Schule getrennt).
|
||||
*
|
||||
* @var string $base
|
||||
* @var array $spellCatalog
|
||||
* @var array $spells
|
||||
*/
|
||||
$existing = [];
|
||||
foreach (['arkan', 'klerikal'] as $schoolKey) {
|
||||
foreach (($spells[$schoolKey] ?? []) as $row) {
|
||||
$existing[$schoolKey . '|' . mb_strtolower(trim((string) $row['name']), 'UTF-8')] = true;
|
||||
}
|
||||
}
|
||||
|
||||
$bySchool = ['arkan' => [], 'klerikal' => []];
|
||||
foreach ($spellCatalog as $entry) {
|
||||
$schoolKey = (string) ($entry['school'] ?? 'arkan') === 'klerikal' ? 'klerikal' : 'arkan';
|
||||
$bySchool[$schoolKey][] = $entry;
|
||||
}
|
||||
?>
|
||||
<dialog class="selector" id="spell-selector" aria-labelledby="spell-selector-title">
|
||||
<div class="selector-head">
|
||||
<h2 id="spell-selector-title">Zauber oder Liturgie hinzufügen</h2>
|
||||
<button class="btn btn-small" type="button" data-dialog-close>Schließen</button>
|
||||
</div>
|
||||
<div class="selector-body">
|
||||
<form method="post" action="<?= e($base . '/spells/add') ?>" data-spell-selector>
|
||||
<?= csrf_field() ?>
|
||||
<div class="selector-filters">
|
||||
<label class="field">
|
||||
<span>Suche</span>
|
||||
<input type="search" data-selector-search placeholder="Name des Zaubers …" autocomplete="off">
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Schule</span>
|
||||
<select data-selector-school>
|
||||
<option value="">alle</option>
|
||||
<option value="arkan">Arkan</option>
|
||||
<option value="klerikal">Klerikal</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="field" style="max-width:8rem">
|
||||
<span>Grad</span>
|
||||
<select data-selector-grade>
|
||||
<option value="">alle</option>
|
||||
<?php for ($grade = 1; $grade <= 9; $grade++): ?>
|
||||
<option value="<?= $grade ?>"><?= $grade ?></option>
|
||||
<?php endfor; ?>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
<div class="selector-groups">
|
||||
<?php foreach (['arkan' => 'Arkane Zauber', 'klerikal' => 'Göttliche Liturgien'] as $schoolKey => $schoolLabel): ?>
|
||||
<?php if ($bySchool[$schoolKey] === []) {
|
||||
continue;
|
||||
} ?>
|
||||
<p class="selector-group"><?= e($schoolLabel) ?></p>
|
||||
<?php
|
||||
$byGrade = [];
|
||||
foreach ($bySchool[$schoolKey] as $entry) {
|
||||
$byGrade[(int) $entry['grade']][] = $entry;
|
||||
}
|
||||
ksort($byGrade);
|
||||
?>
|
||||
<?php foreach ($byGrade as $grade => $entries): ?>
|
||||
<?php foreach ($entries as $entry): ?>
|
||||
<?php
|
||||
$key = mb_strtolower(trim((string) $entry['name']), 'UTF-8');
|
||||
$known = isset($existing[$schoolKey . '|' . $key]);
|
||||
?>
|
||||
<button class="selector-item" type="submit" name="spell_id" value="<?= (int) $entry['id'] ?>"
|
||||
data-selector-item data-name="<?= e($key) ?>"
|
||||
data-school="<?= e($schoolKey) ?>" data-grade="<?= (int) $grade ?>"
|
||||
<?= $known ? 'disabled' : '' ?>>
|
||||
<span><?= e((string) $entry['name']) ?><?= $known ? ' · <em>gelernt</em>' : '' ?></span>
|
||||
<span class="meta"><?= e($schoolKey === 'arkan' ? 'Arkan' : 'Klerikal') ?> · Grad <?= (int) $grade ?></span>
|
||||
</button>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<p class="selector-empty" data-selector-empty hidden>Kein Zauber passt zu Suche und Filtern.</p>
|
||||
|
||||
<div class="inline-form" style="margin-top:.8rem">
|
||||
<label class="field grow" style="margin-bottom:0">
|
||||
<span>Notiz zum gewählten Zauber (optional)</span>
|
||||
<input type="text" name="note" maxlength="255">
|
||||
</label>
|
||||
</div>
|
||||
<p class="muted" style="margin:.4rem 0 0">Einen Namen anklicken – der Eintrag landet sofort im Bogen.</p>
|
||||
</form>
|
||||
|
||||
<details class="selector-custom">
|
||||
<summary>Eigenen Zauber eintragen (nicht im Katalog)</summary>
|
||||
<form method="post" action="<?= e($base . '/spells/add') ?>" class="inline-form">
|
||||
<?= csrf_field() ?>
|
||||
<label class="field grow">
|
||||
<span>Name</span>
|
||||
<input type="text" name="name" maxlength="120" required>
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Schule</span>
|
||||
<select name="school">
|
||||
<option value="arkan">Arkan</option>
|
||||
<option value="klerikal">Klerikal</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="field" style="max-width:6rem">
|
||||
<span>Grad</span>
|
||||
<input type="number" name="grade" value="1" min="1" max="9">
|
||||
</label>
|
||||
<label class="field grow">
|
||||
<span>Notiz</span>
|
||||
<input type="text" name="note" maxlength="255">
|
||||
</label>
|
||||
<button class="btn" type="submit">Eintragen</button>
|
||||
</form>
|
||||
</details>
|
||||
</div>
|
||||
</dialog>
|
||||
66
westreiche_website/views/account.php
Normal file
66
westreiche_website/views/account.php
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<?php
|
||||
/** @var array $account */
|
||||
/** @var string $error */
|
||||
?>
|
||||
<div class="page-head">
|
||||
<div>
|
||||
<h1>Mein Konto</h1>
|
||||
<p class="lede">Benutzername <b><?= e((string) $account['username']) ?></b> · Rolle
|
||||
<?= $account['role'] === 'admin' ? 'Spielleiter (alle Rechte)' : 'Spieler' ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($error !== ''): ?>
|
||||
<p class="alert alert-error"><?= e($error) ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ((int) $account['must_change_password'] === 1): ?>
|
||||
<p class="alert alert-info">Bitte vergib zuerst ein eigenes Passwort, bevor du Charaktere pflegst.</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<section class="panel">
|
||||
<h2>Profil</h2>
|
||||
<form method="post" action="<?= e(url('/account')) ?>" class="form-grid">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="action" value="profile">
|
||||
<div class="grid-2">
|
||||
<label class="field">
|
||||
<span>Anzeigename</span>
|
||||
<input type="text" name="display_name" value="<?= e((string) $account['display_name']) ?>" maxlength="120">
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>E-Mail (auch als Login möglich)</span>
|
||||
<input type="email" name="email" value="<?= e((string) ($account['email'] ?? '')) ?>" maxlength="190">
|
||||
</label>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button class="btn" type="submit">Profil speichern</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="panel">
|
||||
<h2>Passwort ändern</h2>
|
||||
<form method="post" action="<?= e(url('/account')) ?>" class="form-grid">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="action" value="password">
|
||||
<div class="grid-3">
|
||||
<label class="field">
|
||||
<span>Aktuelles Passwort</span>
|
||||
<input type="password" name="current_password" required autocomplete="current-password">
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Neues Passwort</span>
|
||||
<input type="password" name="new_password" required minlength="8" autocomplete="new-password">
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Neues Passwort wiederholen</span>
|
||||
<input type="password" name="new_password_repeat" required minlength="8" autocomplete="new-password">
|
||||
</label>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button class="btn btn-primary" type="submit">Passwort ändern</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
48
westreiche_website/views/admin_equipment.php
Normal file
48
westreiche_website/views/admin_equipment.php
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
/** @var array $weapons */
|
||||
/** @var array $armors */
|
||||
?>
|
||||
<div class="page-head">
|
||||
<div>
|
||||
<h1>Waffen & Rüstungen</h1>
|
||||
<p class="lede">Der Katalog füllt die Auswahllisten im Bogen. Werte sind Startpunkte – im Bogen bleibt jeder Eintrag änderbar.</p>
|
||||
</div>
|
||||
<a class="btn btn-ghost" href="<?= e(url('/admin/users')) ?>">Zurück</a>
|
||||
</div>
|
||||
|
||||
<section class="panel">
|
||||
<h2>Waffen</h2>
|
||||
<table class="data">
|
||||
<thead><tr><th>Name</th><th>Schaden</th><th class="num">Bonus</th><th>Art</th><th>Gewicht</th><th>Preis</th></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($weapons as $weapon): ?>
|
||||
<tr>
|
||||
<td><?= e((string) $weapon['name']) ?></td>
|
||||
<td><?= e((string) $weapon['damage']) ?></td>
|
||||
<td class="num"><?= e(signed((int) $weapon['attack_bonus'])) ?></td>
|
||||
<td class="muted"><?= e((string) $weapon['category']) ?></td>
|
||||
<td class="muted"><?= e((string) $weapon['weight']) ?></td>
|
||||
<td class="muted"><?= e((string) $weapon['value']) ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section class="panel">
|
||||
<h2>Rüstungen & Schilde</h2>
|
||||
<table class="data">
|
||||
<thead><tr><th>Name</th><th class="num">RK-Bonus</th><th>Art</th><th>Gewicht</th><th>Preis</th></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($armors as $armor): ?>
|
||||
<tr>
|
||||
<td><?= e((string) $armor['name']) ?></td>
|
||||
<td class="num"><?= e(signed((int) $armor['ac_bonus'])) ?></td>
|
||||
<td class="muted"><?= e((string) $armor['kind']) ?></td>
|
||||
<td class="muted"><?= e((string) $armor['weight']) ?></td>
|
||||
<td class="muted"><?= e((string) $armor['value']) ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
65
westreiche_website/views/admin_skills.php
Normal file
65
westreiche_website/views/admin_skills.php
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
/** @var array $skills */
|
||||
/** @var string $error */
|
||||
?>
|
||||
<div class="page-head">
|
||||
<div>
|
||||
<h1>Fertigkeiten-Katalog</h1>
|
||||
<p class="lede">Der Katalog entspricht dem Charakterbogen (Körper, Wildnis, Sozial, Wissen). Eigene Fertigkeiten lassen sich zusätzlich im Bogen eintragen.</p>
|
||||
</div>
|
||||
<a class="btn btn-ghost" href="<?= e(url('/admin/users')) ?>">Zurück</a>
|
||||
</div>
|
||||
|
||||
<?php if ($error !== ''): ?>
|
||||
<p class="alert alert-error"><?= e($error) ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<section class="panel">
|
||||
<h2>Neue Fertigkeit</h2>
|
||||
<form method="post" action="<?= e(url('/admin/skills')) ?>" class="inline-form">
|
||||
<?= csrf_field() ?>
|
||||
<label class="field grow">
|
||||
<span>Name</span>
|
||||
<input type="text" name="name" required maxlength="80">
|
||||
</label>
|
||||
<label class="field" style="max-width:9rem">
|
||||
<span>Attribut</span>
|
||||
<select name="attribute">
|
||||
<option value="">–</option>
|
||||
<?php foreach (['STR', 'DEX', 'CON', 'INT', 'WIS', 'CHA'] as $attribute): ?>
|
||||
<option value="<?= e($attribute) ?>"><?= e($attribute) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</label>
|
||||
<label class="field" style="max-width:12rem">
|
||||
<span>Kategorie</span>
|
||||
<select name="category">
|
||||
<?php foreach (WS_SKILL_CATEGORIES as $category): ?>
|
||||
<option value="<?= e($category) ?>"><?= e($category) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</label>
|
||||
<button class="btn" type="submit">Hinzufügen</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="panel">
|
||||
<table class="data">
|
||||
<thead><tr><th>Fertigkeit</th><th>Attribut</th><th>Kategorie</th><th></th></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($skills as $skill): ?>
|
||||
<tr>
|
||||
<td><?= e((string) $skill['name']) ?></td>
|
||||
<td class="muted"><?= e((string) $skill['attribute']) ?></td>
|
||||
<td class="muted"><?= e((string) $skill['category']) ?></td>
|
||||
<td class="num">
|
||||
<form method="post" action="<?= e(url('/admin/skills/' . (int) $skill['id'] . '/delete')) ?>">
|
||||
<?= csrf_field() ?>
|
||||
<button class="btn btn-small btn-danger" type="submit" data-confirm="Katalog-Eintrag entfernen? Bereits eingetragene Bögen behalten den Namen.">×</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
57
westreiche_website/views/admin_spells.php
Normal file
57
westreiche_website/views/admin_spells.php
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
/** @var string $school */
|
||||
/** @var int $grade */
|
||||
/** @var string $needle */
|
||||
/** @var array $spells */
|
||||
?>
|
||||
<div class="page-head">
|
||||
<div>
|
||||
<h1>Zauber & Liturgien</h1>
|
||||
<p class="lede">Aus dem Vault übernommen (Arkan und Klerikal). Spieler wählen daraus beim Bogen aus.</p>
|
||||
</div>
|
||||
<a class="btn btn-ghost" href="<?= e(url('/admin/users')) ?>">Zurück</a>
|
||||
</div>
|
||||
|
||||
<section class="panel">
|
||||
<form method="get" action="<?= e(url('/admin/spells')) ?>" class="inline-form">
|
||||
<label class="field">
|
||||
<span>Schule</span>
|
||||
<select name="school">
|
||||
<option value="arkan"<?= $school === 'arkan' ? ' selected' : '' ?>>Arkan</option>
|
||||
<option value="klerikal"<?= $school === 'klerikal' ? ' selected' : '' ?>>Klerikal</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="field" style="max-width:8rem">
|
||||
<span>Grad</span>
|
||||
<select name="grade">
|
||||
<option value="0">alle</option>
|
||||
<?php for ($g = 1; $g <= 9; $g++): ?>
|
||||
<option value="<?= $g ?>"<?= $grade === $g ? ' selected' : '' ?>><?= $g ?></option>
|
||||
<?php endfor; ?>
|
||||
</select>
|
||||
</label>
|
||||
<label class="field grow">
|
||||
<span>Suche</span>
|
||||
<input type="search" name="q" value="<?= e($needle) ?>" maxlength="60">
|
||||
</label>
|
||||
<button class="btn" type="submit">Filtern</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="panel">
|
||||
<p class="muted"><?= count($spells) ?> Einträge</p>
|
||||
<table class="data">
|
||||
<thead><tr><th>Grad</th><th>Name</th><th>Klasse</th><th>Dauer</th><th>Reichweite</th></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($spells as $spell): ?>
|
||||
<tr>
|
||||
<td class="num"><?= (int) $spell['grade'] ?></td>
|
||||
<td><?= e((string) $spell['name']) ?></td>
|
||||
<td class="muted"><?= e((string) $spell['classes']) ?></td>
|
||||
<td class="muted"><?= e((string) $spell['duration']) ?></td>
|
||||
<td class="muted"><?= e((string) $spell['range_text']) ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
104
westreiche_website/views/admin_user_form.php
Normal file
104
westreiche_website/views/admin_user_form.php
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
<?php
|
||||
/** @var array|null $target */
|
||||
/** @var array $values */
|
||||
/** @var string $error */
|
||||
/** @var array|null $lastInvite */
|
||||
/** @var array|null $activeInvite */
|
||||
$isNew = $target === null;
|
||||
$action = $isNew ? url('/admin/users/new') : url('/admin/users/' . (int) $target['id']);
|
||||
?>
|
||||
<div class="page-head">
|
||||
<div>
|
||||
<h1><?= $isNew ? 'Konto anlegen' : 'Konto: ' . e((string) $target['username']) ?></h1>
|
||||
<p class="lede">
|
||||
Entweder ein Startpasswort vergeben oder eine Einladung erzeugen – dann setzt die Person
|
||||
ihr Passwort selbst über den Link.
|
||||
</p>
|
||||
</div>
|
||||
<a class="btn btn-ghost" href="<?= e(url('/admin/users')) ?>">Zur Übersicht</a>
|
||||
</div>
|
||||
|
||||
<?php if ($error !== ''): ?>
|
||||
<p class="alert alert-error"><?= e($error) ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<section class="panel">
|
||||
<form method="post" action="<?= e($action) ?>" class="form-grid">
|
||||
<?= csrf_field() ?>
|
||||
<div class="grid-3">
|
||||
<label class="field">
|
||||
<span>Benutzername</span>
|
||||
<input type="text" name="username" value="<?= e((string) $values['username']) ?>" required minlength="3" maxlength="60" autocomplete="off">
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>E-Mail (optional, auch Login)</span>
|
||||
<input type="email" name="email" value="<?= e((string) $values['email']) ?>" maxlength="190" autocomplete="off">
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Anzeigename</span>
|
||||
<input type="text" name="display_name" value="<?= e((string) $values['display_name']) ?>" maxlength="120">
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Rolle</span>
|
||||
<select name="role">
|
||||
<option value="user"<?= $values['role'] === 'user' ? ' selected' : '' ?>>Spieler</option>
|
||||
<option value="admin"<?= $values['role'] === 'admin' ? ' selected' : '' ?>>Spielleiter (alle Rechte)</option>
|
||||
</select>
|
||||
</label>
|
||||
<?php if (!$isNew): ?>
|
||||
<label class="field">
|
||||
<span>Status</span>
|
||||
<select name="status">
|
||||
<option value="active"<?= ($values['status'] ?? 'active') === 'active' ? ' selected' : '' ?>>aktiv</option>
|
||||
<option value="disabled"<?= ($values['status'] ?? '') === 'disabled' ? ' selected' : '' ?>>deaktiviert</option>
|
||||
</select>
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
<label class="field">
|
||||
<span><?= $isNew ? 'Startpasswort (optional)' : 'Neues Passwort (optional)' ?></span>
|
||||
<input type="password" name="password" minlength="8" autocomplete="new-password">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<?php if ($isNew): ?>
|
||||
<label class="field" style="grid-auto-flow:column; align-items:center; gap:.5rem; justify-content:start">
|
||||
<input type="checkbox" name="send_invite" value="1" checked>
|
||||
<span style="margin:0">Statt Passwort eine Einladung erzeugen (empfohlen)</span>
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="actions">
|
||||
<button class="btn btn-primary" type="submit"><?= $isNew ? 'Konto anlegen' : 'Speichern' ?></button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<?php if (!$isNew): ?>
|
||||
<section class="panel">
|
||||
<h2>Einladung / Passwort zurücksetzen</h2>
|
||||
<?php if (is_array($lastInvite)): ?>
|
||||
<p class="muted"><?php if (!empty($lastInvite['sent'])): ?>Per E-Mail an <strong><?= e((string) $lastInvite['to']) ?></strong> gesendet – <?php else: ?>Neuer Link<?php endif; ?>gültig bis
|
||||
<?= e((new DateTimeImmutable((string) $lastInvite['expires_at'], new DateTimeZone('UTC')))->setTimezone(new DateTimeZone('Europe/Berlin'))->format('d.m.Y H:i')) ?> Uhr:</p>
|
||||
<div class="copy-box"><span id="invite-url"><?= e((string) $lastInvite['url']) ?></span>
|
||||
<button class="btn btn-small" type="button" data-copy="#invite-url">Kopieren</button>
|
||||
</div>
|
||||
<?php elseif (is_array($activeInvite ?? null)): ?>
|
||||
<p class="muted">Es ist bereits ein Einladungslink offen (bis
|
||||
<?= e((new DateTimeImmutable((string) $activeInvite['expires_at'], new DateTimeZone('UTC')))->setTimezone(new DateTimeZone('Europe/Berlin'))->format('d.m.Y H:i')) ?> Uhr).
|
||||
Der Link selbst ist aus Sicherheitsgründen nicht gespeichert – ein neuer macht den alten ungültig.</p>
|
||||
<?php endif; ?>
|
||||
<form method="post" action="<?= e(url('/admin/users/' . (int) $target['id'] . '/invite')) ?>">
|
||||
<?= csrf_field() ?>
|
||||
<button class="btn" type="submit" data-confirm="Neuen Einladungslink erzeugen? Das bisherige Passwort wird ungültig.">
|
||||
Einladungslink erzeugen
|
||||
</button>
|
||||
</form>
|
||||
<?php if (auth_user() !== null && (int) auth_user()['id'] !== (int) $target['id']): ?>
|
||||
<hr class="divider">
|
||||
<form method="post" action="<?= e(url('/admin/users/' . (int) $target['id'] . '/delete')) ?>">
|
||||
<?= csrf_field() ?>
|
||||
<button class="btn btn-danger" type="submit" data-confirm="Konto samt Charakteren löschen?">Konto löschen</button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
76
westreiche_website/views/admin_users.php
Normal file
76
westreiche_website/views/admin_users.php
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
<?php
|
||||
/** @var array $users */
|
||||
/** @var array|null $lastInvite */
|
||||
?>
|
||||
<div class="page-head">
|
||||
<div>
|
||||
<h1>Benutzer der Runde</h1>
|
||||
<p class="lede">Konten entstehen nur durch Einladung. Ein Einladungslink ist sieben Tage gültig und einmal verwendbar.</p>
|
||||
</div>
|
||||
<a class="btn btn-primary" href="<?= e(url('/admin/users/new')) ?>">Konto anlegen</a>
|
||||
</div>
|
||||
|
||||
<?php if (is_array($lastInvite)): ?>
|
||||
<section class="panel">
|
||||
<h2>Einladungslink</h2>
|
||||
<?php if (!empty($lastInvite['sent'])): ?>
|
||||
<p class="muted">Die Einladung ging per E-Mail an <strong><?= e((string) $lastInvite['to']) ?></strong> und gilt bis
|
||||
<?= e((new DateTimeImmutable((string) $lastInvite['expires_at'], new DateTimeZone('UTC')))->setTimezone(new DateTimeZone('Europe/Berlin'))->format('d.m.Y H:i')) ?> Uhr.</p>
|
||||
<?php else: ?>
|
||||
<p class="muted">Diesen Link an die Person weitergeben – er ersetzt das Passwort und verfällt am
|
||||
<?= e((new DateTimeImmutable((string) $lastInvite['expires_at'], new DateTimeZone('UTC')))->setTimezone(new DateTimeZone('Europe/Berlin'))->format('d.m.Y H:i')) ?> Uhr.</p>
|
||||
<?php endif; ?>
|
||||
<div class="copy-box"><span id="invite-url"><?= e((string) $lastInvite['url']) ?></span>
|
||||
<button class="btn btn-small" type="button" data-copy="#invite-url">Kopieren</button>
|
||||
</div>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<section class="panel">
|
||||
<table class="data">
|
||||
<thead>
|
||||
<tr><th>Benutzer</th><th>E-Mail</th><th>Rolle</th><th class="num">Charaktere</th><th>Zuletzt</th><th></th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($users as $row): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="<?= e(url('/admin/users/' . (int) $row['id'])) ?>"><?= e((string) $row['username']) ?></a>
|
||||
<?php if ((string) $row['display_name'] !== '' && $row['display_name'] !== $row['username']): ?>
|
||||
<span class="muted">· <?= e((string) $row['display_name']) ?></span>
|
||||
<?php endif; ?>
|
||||
<?php if ($row['status'] !== 'active'): ?>
|
||||
<span class="badge badge-retired" style="font-size:.6rem">deaktiviert</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="muted"><?= e((string) ($row['email'] ?? '–')) ?></td>
|
||||
<td>
|
||||
<?php if ($row['role'] === 'admin'): ?>
|
||||
<span class="badge badge-admin">Spielleiter</span>
|
||||
<?php else: ?>
|
||||
<span class="muted">Spieler</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="num"><?= (int) $row['character_count'] ?></td>
|
||||
<td class="muted">
|
||||
<?= $row['last_login_at'] !== null
|
||||
? e((new DateTimeImmutable((string) $row['last_login_at'], new DateTimeZone('UTC')))->setTimezone(new DateTimeZone('Europe/Berlin'))->format('d.m.Y H:i'))
|
||||
: '–' ?>
|
||||
</td>
|
||||
<td class="num">
|
||||
<a class="btn btn-small" href="<?= e(url('/admin/users/' . (int) $row['id'])) ?>">bearbeiten</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section class="panel">
|
||||
<h2>Kataloge</h2>
|
||||
<p class="muted">
|
||||
<a class="btn btn-small" href="<?= e(url('/admin/skills')) ?>">Fertigkeiten pflegen</a>
|
||||
<a class="btn btn-small" href="<?= e(url('/admin/spells')) ?>">Zauber & Liturgien ansehen</a>
|
||||
<a class="btn btn-small" href="<?= e(url('/admin/equipment')) ?>">Waffen & Rüstungen</a>
|
||||
</p>
|
||||
</section>
|
||||
471
westreiche_website/views/character_edit.php
Normal file
471
westreiche_website/views/character_edit.php
Normal file
|
|
@ -0,0 +1,471 @@
|
|||
<?php
|
||||
/** @var array $character */
|
||||
/** @var array $skills */
|
||||
/** @var array $skillCatalog */
|
||||
/** @var array $spells */
|
||||
/** @var array $spellCatalog */
|
||||
/** @var array $items */
|
||||
/** @var array $weapons */
|
||||
/** @var array $armors */
|
||||
/** @var array $weaponCatalog */
|
||||
/** @var array $armorCatalog */
|
||||
/** @var array $acInfo */
|
||||
$values = character_form_values($character);
|
||||
$cid = (int) $character['id'];
|
||||
$base = url('/characters/' . $cid);
|
||||
?>
|
||||
<div class="page-head">
|
||||
<div>
|
||||
<p class="muted" style="margin:0; letter-spacing:.16em; text-transform:uppercase; font-size:.72rem;">
|
||||
Bogen von <?= e((string) $character['owner_name']) ?>
|
||||
</p>
|
||||
<h1><?= e((string) $character['name']) ?></h1>
|
||||
<p class="lede"><?= e((string) $character['class_name']) ?> · Stufe <?= (int) $character['level'] ?></p>
|
||||
</div>
|
||||
<div class="actions" style="margin:0">
|
||||
<a class="btn" href="<?= e($base) ?>">Bogen ansehen</a>
|
||||
<a class="btn" href="<?= e($base . '/pdf') ?>">PDF</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<nav class="tabs" aria-label="Abschnitte">
|
||||
<a href="#portraet">Porträt</a>
|
||||
<a href="#stammdaten">Stammdaten</a>
|
||||
<a href="#fertigkeiten">Fertigkeiten (<?= count($skills) ?>)</a>
|
||||
<a href="#bewaffnung">Bewaffnung (<?= count($weapons) ?>)</a>
|
||||
<a href="#ruestung">Rüstung (<?= count($armors) ?>)</a>
|
||||
<a href="#zauber">Zauber & Liturgien (<?= count($spells['arkan']) + count($spells['klerikal']) ?>)</a>
|
||||
<a href="#inventar">Inventar (<?= count($items) ?>)</a>
|
||||
<a href="#gefahr">Löschen</a>
|
||||
</nav>
|
||||
|
||||
<?php $portraitSrc = portrait_url($character); ?>
|
||||
<section class="panel" id="portraet">
|
||||
<h2>Porträt</h2>
|
||||
<div class="portrait-editor">
|
||||
<?php if ($portraitSrc !== ''): ?>
|
||||
<img class="portrait-thumb" src="<?= e($portraitSrc) ?>" alt="Porträt von <?= e((string) $character['name']) ?>">
|
||||
<?php endif; ?>
|
||||
<div class="form-grid">
|
||||
<form method="post" action="<?= e($base . '/portrait') ?>" enctype="multipart/form-data" class="form-grid">
|
||||
<?= csrf_field() ?>
|
||||
<label class="field">
|
||||
<span>Bild wählen (JPEG, PNG, WebP · max. 5 MB)</span>
|
||||
<input type="file" name="portrait" accept="image/jpeg,image/png,image/webp" required>
|
||||
</label>
|
||||
<div class="actions">
|
||||
<button class="btn" type="submit">Porträt hochladen</button>
|
||||
</div>
|
||||
</form>
|
||||
<?php if ((string) $character['portrait'] !== ''): ?>
|
||||
<form method="post" action="<?= e($base . '/portrait/delete') ?>">
|
||||
<?= csrf_field() ?>
|
||||
<button class="btn btn-small btn-danger" type="submit" data-confirm="Eigenes Porträt entfernen?">Eigenes Bild entfernen</button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
<p class="muted" style="margin:0">Ohne eigenes Bild zeigt der Bogen ein gemaltes Platzhalterporträt der Klasse
|
||||
(<?= e((string) $character['class_name']) ?>).</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="panel" id="stammdaten">
|
||||
<h2>Stammdaten</h2>
|
||||
<form method="post" action="<?= e($base . '/edit') ?>" class="form-grid">
|
||||
<?= csrf_field() ?>
|
||||
<?php
|
||||
$owners = auth_can_manage(auth_user()) ? db()->query('SELECT id, username FROM users ORDER BY username')->fetchAll() : [];
|
||||
require WS_ROOT . '/views/_fields.php';
|
||||
?>
|
||||
<div class="actions">
|
||||
<button class="btn btn-primary" type="submit">Speichern</button>
|
||||
<a class="btn btn-ghost" href="<?= e($base) ?>">Zurück zum Bogen</a>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="panel" id="fertigkeiten">
|
||||
<h2>Fertigkeiten</h2>
|
||||
<p class="muted">
|
||||
Startwert jeder Fertigkeit ist der Attributsbonus (Fertigkeitsstufe, Hausregel V1.1);
|
||||
Steigerungen trägst du rechts ein. Eigene Fertigkeiten sind zusätzlich erlaubt.
|
||||
</p>
|
||||
<form method="post" action="<?= e($base . '/skills/reset') ?>" class="inline-form" style="margin-bottom:.8rem">
|
||||
<?= csrf_field() ?>
|
||||
<button class="btn btn-small" type="submit">Startwerte aus Attributen auffrischen</button>
|
||||
<label class="field" style="grid-auto-flow:column; align-items:center; gap:.4rem">
|
||||
<input type="checkbox" name="force" value="1">
|
||||
<span style="margin:0">auch gesteigerte Werte zurücksetzen</span>
|
||||
</label>
|
||||
</form>
|
||||
|
||||
<?php if ($skills === []): ?>
|
||||
<p class="muted">Noch keine Fertigkeit eingetragen. <a href="<?= e($base . '/skills/reset') ?>">Startwerte anlegen</a></p>
|
||||
<?php else: ?>
|
||||
<?php foreach (skills_grouped($skills) as $group => $groupSkills): ?>
|
||||
<h3 class="skill-group"><?= e($group) ?></h3>
|
||||
<table class="data skill-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Fertigkeit</th>
|
||||
<th>Attribut</th>
|
||||
<th class="num">MOD</th>
|
||||
<th>Stufe / Notiz</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($groupSkills as $skill): ?>
|
||||
<?php $mod = skill_attribute_modifier($character, $skill); ?>
|
||||
<tr>
|
||||
<td class="skill-name"><?= e((string) $skill['name']) ?></td>
|
||||
<td class="muted"><?= e((string) ($skill['attribute'] ?? '')) ?></td>
|
||||
<td class="num <?= $mod === null ? 'muted' : bonus_class($mod) ?>"><?= $mod === null ? '–' : e(signed($mod)) ?></td>
|
||||
<td>
|
||||
<div class="inline-form">
|
||||
<form method="post" action="<?= e($base . '/skills/' . (int) $skill['id']) ?>" class="inline-form">
|
||||
<?= csrf_field() ?>
|
||||
<label class="field" style="max-width:6rem">
|
||||
<span class="visually-quiet">Stufe</span>
|
||||
<input type="number" name="bonus" value="<?= (int) $skill['bonus'] ?>" min="-10" max="30">
|
||||
</label>
|
||||
<label class="field grow">
|
||||
<span class="visually-quiet">Notiz</span>
|
||||
<input type="text" name="note" value="<?= e((string) $skill['note']) ?>" maxlength="255">
|
||||
</label>
|
||||
<button class="btn btn-small" type="submit">speichern</button>
|
||||
</form>
|
||||
<form method="post" action="<?= e($base . '/skills/' . (int) $skill['id'] . '/delete') ?>">
|
||||
<?= csrf_field() ?>
|
||||
<button class="btn btn-small btn-danger" type="submit" data-confirm="Fertigkeit entfernen?">×</button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<hr class="divider">
|
||||
<div class="selector-actions">
|
||||
<button class="btn btn-primary" type="button" data-dialog-open="#skill-selector">Fertigkeit hinzufügen</button>
|
||||
<span class="muted">Öffnet den Katalog (33 Fertigkeiten in vier Gruppen) mit Suche.</span>
|
||||
</div>
|
||||
<?php require WS_ROOT . '/views/_selector_skills.php'; ?>
|
||||
</section>
|
||||
|
||||
<section class="panel" id="zauber">
|
||||
<h2>Zauber & Liturgien</h2>
|
||||
<p class="muted">Die Liste stammt aus dem Regelwerk der Westreiche (147 arkane Zauber, 74 Liturgien).</p>
|
||||
|
||||
<div class="grid-2">
|
||||
<?php foreach (['arkan' => 'Arkane Zauber', 'klerikal' => 'Göttliche Liturgien'] as $school => $label): ?>
|
||||
<div>
|
||||
<h3><?= e($label) ?></h3>
|
||||
<?php if ($spells[$school] === []): ?>
|
||||
<p class="muted">Noch nichts gelernt.</p>
|
||||
<?php else: ?>
|
||||
<?php
|
||||
$byGrade = [];
|
||||
foreach ($spells[$school] as $spell) {
|
||||
$byGrade[(int) $spell['grade']][] = $spell;
|
||||
}
|
||||
ksort($byGrade);
|
||||
?>
|
||||
<?php foreach ($byGrade as $grade => $entries): ?>
|
||||
<div class="grade-block">
|
||||
<h4>Grad <?= (int) $grade ?></h4>
|
||||
<div class="pill-list">
|
||||
<?php foreach ($entries as $entry): ?>
|
||||
<span class="pill">
|
||||
<?= e((string) $entry['name']) ?>
|
||||
<form method="post" action="<?= e($base . '/spells/' . (int) $entry['id'] . '/delete') ?>">
|
||||
<?= csrf_field() ?>
|
||||
<button type="submit" title="entfernen" aria-label="<?= e((string) $entry['name']) ?> entfernen" data-confirm="Zauber entfernen?">×</button>
|
||||
</form>
|
||||
</span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<hr class="divider">
|
||||
<div class="selector-actions">
|
||||
<button class="btn btn-primary" type="button" data-dialog-open="#spell-selector">Zauber oder Liturgie hinzufügen</button>
|
||||
<span class="muted">Katalog mit Suche, Schule und Grad – der Treffer landet direkt im Bogen.</span>
|
||||
</div>
|
||||
<?php require WS_ROOT . '/views/_selector_spells.php'; ?>
|
||||
</section>
|
||||
|
||||
<section class="panel" id="bewaffnung">
|
||||
<h2>Bewaffnung</h2>
|
||||
<p class="muted">
|
||||
Trefferwurf = Grundangriff (<?= e(signed((int) $character['attack_bonus'])) ?>) + Attributsbonus
|
||||
(Nahkampf Stärke <?= e(signed(attribute_bonus((int) $character['attr_str']))) ?>,
|
||||
Fernkampf Geschick <?= e(signed(attribute_bonus((int) $character['attr_dex']))) ?>) + Waffenbonus.
|
||||
</p>
|
||||
<?php if ($weapons === []): ?>
|
||||
<p class="muted">Noch keine Waffe geführt.</p>
|
||||
<?php else: ?>
|
||||
<table class="data">
|
||||
<thead>
|
||||
<tr><th>Waffe</th><th class="num">Trefferwurf</th><th class="num">Schaden</th><th>Hand</th><th>Bearbeiten</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($weapons as $weapon): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?= e((string) $weapon['name']) ?>
|
||||
<span class="muted" style="font-size:.78rem">· <?= e((string) $weapon['category']) ?></span>
|
||||
</td>
|
||||
<td class="num"><b><?= e(signed(weapon_attack_total($character, $weapon))) ?></b></td>
|
||||
<td class="num"><?= e(weapon_damage_total($character, $weapon)) ?></td>
|
||||
<td class="muted"><?= (int) $weapon['equipped'] === 1 ? 'geführt' : 'weggelegt' ?></td>
|
||||
<td>
|
||||
<form method="post" action="<?= e($base . '/weapons/' . (int) $weapon['id']) ?>" class="inline-form">
|
||||
<?= csrf_field() ?>
|
||||
<label class="field" style="max-width:11rem">
|
||||
<span class="visually-quiet">Name</span>
|
||||
<input type="text" name="name" value="<?= e((string) $weapon['name']) ?>" maxlength="80">
|
||||
</label>
|
||||
<label class="field" style="max-width:5.5rem">
|
||||
<span class="visually-quiet">Schaden</span>
|
||||
<input type="text" name="damage" value="<?= e((string) $weapon['damage']) ?>" maxlength="20">
|
||||
</label>
|
||||
<label class="field" style="max-width:5rem">
|
||||
<span class="visually-quiet">Bonus</span>
|
||||
<input type="number" name="attack_bonus" value="<?= (int) $weapon['attack_bonus'] ?>" min="-10" max="10">
|
||||
</label>
|
||||
<label class="field" style="max-width:7.5rem">
|
||||
<span class="visually-quiet">Art</span>
|
||||
<select name="category">
|
||||
<option value="Nahkampf"<?= $weapon['category'] === 'Nahkampf' ? ' selected' : '' ?>>Nahkampf</option>
|
||||
<option value="Fernkampf"<?= $weapon['category'] === 'Fernkampf' ? ' selected' : '' ?>>Fernkampf</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="field grow">
|
||||
<span class="visually-quiet">Notiz</span>
|
||||
<input type="text" name="note" value="<?= e((string) $weapon['note']) ?>" maxlength="255">
|
||||
</label>
|
||||
<label class="field" style="grid-auto-flow:column; align-items:center; gap:.35rem">
|
||||
<input type="checkbox" name="equipped" value="1"<?= (int) $weapon['equipped'] === 1 ? ' checked' : '' ?>>
|
||||
<span style="margin:0">geführt</span>
|
||||
</label>
|
||||
<button class="btn btn-small" type="submit">speichern</button>
|
||||
</form>
|
||||
<form method="post" action="<?= e($base . '/weapons/' . (int) $weapon['id'] . '/delete') ?>" style="margin-top:.35rem">
|
||||
<?= csrf_field() ?>
|
||||
<button class="btn btn-small btn-danger" type="submit" data-confirm="Waffe entfernen?">entfernen</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
|
||||
<hr class="divider">
|
||||
<form method="post" action="<?= e($base . '/weapons/add') ?>" class="inline-form">
|
||||
<?= csrf_field() ?>
|
||||
<label class="field grow">
|
||||
<span>Aus dem Katalog</span>
|
||||
<select name="weapon_id">
|
||||
<option value="0">– eigene Waffe –</option>
|
||||
<?php foreach ($weaponCatalog as $entry): ?>
|
||||
<option value="<?= (int) $entry['id'] ?>">
|
||||
<?= e((string) $entry['name']) ?> · <?= e((string) $entry['damage']) ?> · <?= e((string) $entry['category']) ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</label>
|
||||
<label class="field grow">
|
||||
<span>oder eigener Name</span>
|
||||
<input type="text" name="name" maxlength="80">
|
||||
</label>
|
||||
<label class="field" style="max-width:6rem">
|
||||
<span>Schaden</span>
|
||||
<input type="text" name="damage" placeholder="1W8" maxlength="20">
|
||||
</label>
|
||||
<label class="field" style="max-width:5.5rem">
|
||||
<span>Bonus</span>
|
||||
<input type="number" name="attack_bonus" value="0" min="-10" max="10">
|
||||
</label>
|
||||
<button class="btn" type="submit">Hinzufügen</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="panel" id="ruestung">
|
||||
<h2>Rüstung</h2>
|
||||
<p class="muted">
|
||||
Rüstungsklasse = 10 + Geschick (<?= e(signed((int) $acInfo['dexterity'])) ?>)
|
||||
+ Rüstung (<?= e(signed((int) $acInfo['armor'])) ?>) = <b><?= (int) $acInfo['total'] ?></b>
|
||||
<?php if ($acInfo['manual_active']): ?>
|
||||
<span class="badge">manuell überschrieben: <?= (int) $acInfo['manual'] ?> (Feld „Rüstungsklasse“)</span>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
<?php if ($armors === []): ?>
|
||||
<p class="muted">Noch kein Rüstungsteil eingetragen.</p>
|
||||
<?php else: ?>
|
||||
<table class="data">
|
||||
<thead><tr><th>Teil</th><th class="num">RK-Bonus</th><th>Art</th><th>Status</th><th>Bearbeiten</th></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($armors as $armor): ?>
|
||||
<tr>
|
||||
<td><?= e((string) $armor['name']) ?></td>
|
||||
<td class="num"><b><?= e(signed((int) $armor['ac_bonus'])) ?></b></td>
|
||||
<td class="muted"><?= e((string) $armor['kind']) ?></td>
|
||||
<td class="muted"><?= (int) $armor['equipped'] === 1 ? 'angelegt' : 'abgelegt' ?></td>
|
||||
<td>
|
||||
<form method="post" action="<?= e($base . '/armors/' . (int) $armor['id']) ?>" class="inline-form">
|
||||
<?= csrf_field() ?>
|
||||
<label class="field" style="max-width:11rem">
|
||||
<span class="visually-quiet">Name</span>
|
||||
<input type="text" name="name" value="<?= e((string) $armor['name']) ?>" maxlength="80">
|
||||
</label>
|
||||
<label class="field" style="max-width:5.5rem">
|
||||
<span class="visually-quiet">RK-Bonus</span>
|
||||
<input type="number" name="ac_bonus" value="<?= (int) $armor['ac_bonus'] ?>" min="-5" max="15">
|
||||
</label>
|
||||
<label class="field" style="max-width:7.5rem">
|
||||
<span class="visually-quiet">Art</span>
|
||||
<select name="kind">
|
||||
<option value="Rüstung"<?= $armor['kind'] === 'Rüstung' ? ' selected' : '' ?>>Rüstung</option>
|
||||
<option value="Schild"<?= $armor['kind'] === 'Schild' ? ' selected' : '' ?>>Schild</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="field grow">
|
||||
<span class="visually-quiet">Notiz</span>
|
||||
<input type="text" name="note" value="<?= e((string) $armor['note']) ?>" maxlength="255">
|
||||
</label>
|
||||
<label class="field" style="grid-auto-flow:column; align-items:center; gap:.35rem">
|
||||
<input type="checkbox" name="equipped" value="1"<?= (int) $armor['equipped'] === 1 ? ' checked' : '' ?>>
|
||||
<span style="margin:0">angelegt</span>
|
||||
</label>
|
||||
<button class="btn btn-small" type="submit">speichern</button>
|
||||
</form>
|
||||
<form method="post" action="<?= e($base . '/armors/' . (int) $armor['id'] . '/delete') ?>" style="margin-top:.35rem">
|
||||
<?= csrf_field() ?>
|
||||
<button class="btn btn-small btn-danger" type="submit" data-confirm="Rüstungsteil entfernen?">entfernen</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
|
||||
<hr class="divider">
|
||||
<form method="post" action="<?= e($base . '/armors/add') ?>" class="inline-form">
|
||||
<?= csrf_field() ?>
|
||||
<label class="field grow">
|
||||
<span>Aus dem Katalog</span>
|
||||
<select name="armor_id">
|
||||
<option value="0">– eigenes Teil –</option>
|
||||
<?php foreach ($armorCatalog as $entry): ?>
|
||||
<option value="<?= (int) $entry['id'] ?>">
|
||||
<?= e((string) $entry['name']) ?> · RK <?= e(signed((int) $entry['ac_bonus'])) ?> · <?= e((string) $entry['kind']) ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</label>
|
||||
<label class="field grow">
|
||||
<span>oder eigener Name</span>
|
||||
<input type="text" name="name" maxlength="80">
|
||||
</label>
|
||||
<label class="field" style="max-width:6rem">
|
||||
<span>RK-Bonus</span>
|
||||
<input type="number" name="ac_bonus" value="" placeholder="4" min="-5" max="15">
|
||||
</label>
|
||||
<button class="btn" type="submit">Hinzufügen</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="panel" id="inventar">
|
||||
<h2>Inventar</h2>
|
||||
<?php if ($items === []): ?>
|
||||
<p class="muted">Noch nichts im Gepäck.</p>
|
||||
<?php else: ?>
|
||||
<table class="data">
|
||||
<thead>
|
||||
<tr><th>Anzahl</th><th>Gegenstand</th><th>Art</th><th>Gewicht</th><th>Wert</th><th>Notiz</th><th></th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($items as $item): ?>
|
||||
<tr>
|
||||
<td><?= (int) $item['qty'] ?>×</td>
|
||||
<td>
|
||||
<?= e((string) $item['name']) ?>
|
||||
<?php if ((int) $item['equipped'] === 1): ?>
|
||||
<span class="badge" style="font-size:.6rem">angelegt</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="muted"><?= e((string) $item['category']) ?></td>
|
||||
<td class="muted"><?= e((string) $item['weight']) ?></td>
|
||||
<td class="muted"><?= e((string) $item['value']) ?></td>
|
||||
<td class="muted"><?= e((string) $item['note']) ?></td>
|
||||
<td class="num" style="white-space:nowrap">
|
||||
<form method="post" action="<?= e($base . '/items/' . (int) $item['id'] . '/toggle') ?>" style="display:inline">
|
||||
<?= csrf_field() ?>
|
||||
<button class="btn btn-small" type="submit"><?= (int) $item['equipped'] === 1 ? 'ablegen' : 'anlegen' ?></button>
|
||||
</form>
|
||||
<form method="post" action="<?= e($base . '/items/' . (int) $item['id'] . '/delete') ?>" style="display:inline">
|
||||
<?= csrf_field() ?>
|
||||
<button class="btn btn-small btn-danger" type="submit" data-confirm="Gegenstand entfernen?">×</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
|
||||
<hr class="divider">
|
||||
<form method="post" action="<?= e($base . '/items/add') ?>" class="inline-form">
|
||||
<?= csrf_field() ?>
|
||||
<label class="field grow">
|
||||
<span>Gegenstand</span>
|
||||
<input type="text" name="name" required maxlength="120">
|
||||
</label>
|
||||
<label class="field" style="max-width:6rem">
|
||||
<span>Anzahl</span>
|
||||
<input type="number" name="qty" value="1" min="1" max="999">
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Art</span>
|
||||
<select name="category">
|
||||
<?php foreach (WS_ITEM_CATEGORIES as $category): ?>
|
||||
<option value="<?= e($category) ?>"><?= e($category) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</label>
|
||||
<label class="field" style="max-width:8rem">
|
||||
<span>Gewicht</span>
|
||||
<input type="text" name="weight" maxlength="40">
|
||||
</label>
|
||||
<label class="field" style="max-width:8rem">
|
||||
<span>Wert</span>
|
||||
<input type="text" name="value" maxlength="40">
|
||||
</label>
|
||||
<label class="field" style="grid-auto-flow:column; align-items:center; gap:.4rem">
|
||||
<input type="checkbox" name="equipped" value="1">
|
||||
<span style="margin:0">angelegt</span>
|
||||
</label>
|
||||
<button class="btn" type="submit">Eintragen</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="panel" id="gefahr">
|
||||
<h2>Bogen löschen</h2>
|
||||
<p class="muted">Der Bogen verschwindet mit allen Fertigkeiten, Zaubern und Gegenständen. Das lässt sich nicht rückgängig machen.</p>
|
||||
<form method="post" action="<?= e($base . '/delete') ?>">
|
||||
<?= csrf_field() ?>
|
||||
<button class="btn btn-danger" type="submit" data-confirm="„<?= e((string) $character['name']) ?>“ endgültig löschen?">
|
||||
Charakter löschen
|
||||
</button>
|
||||
</form>
|
||||
</section>
|
||||
30
westreiche_website/views/character_form.php
Normal file
30
westreiche_website/views/character_form.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
/** @var array $values */
|
||||
/** @var array|null $character */
|
||||
/** @var array $owners */
|
||||
/** @var string $error */
|
||||
?>
|
||||
<div class="page-head">
|
||||
<div>
|
||||
<h1>Charakter erschaffen</h1>
|
||||
<p class="lede">
|
||||
Nach der Hausregel V1.1 werden die Werte 14, 12, 11, 10, 9 und 7 auf Stärke, Konstitution,
|
||||
Geschicklichkeit, Intelligenz, Weisheit und Charisma verteilt. Die Rasse entfällt – in der
|
||||
Westreiche spielen Menschen.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="panel">
|
||||
<?php if ($error !== ''): ?>
|
||||
<p class="alert alert-error"><?= e($error) ?></p>
|
||||
<?php endif; ?>
|
||||
<form method="post" action="<?= e(url('/characters/new')) ?>" class="form-grid">
|
||||
<?= csrf_field() ?>
|
||||
<?php require WS_ROOT . '/views/_fields.php'; ?>
|
||||
<div class="actions">
|
||||
<button class="btn btn-primary" type="submit">Bogen anlegen</button>
|
||||
<a class="btn btn-ghost" href="<?= e(url('/')) ?>">Abbrechen</a>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
295
westreiche_website/views/character_sheet.php
Normal file
295
westreiche_website/views/character_sheet.php
Normal file
|
|
@ -0,0 +1,295 @@
|
|||
<?php
|
||||
/** @var array $character */
|
||||
/** @var array $derived */
|
||||
/** @var array $skills */
|
||||
/** @var array $spells */
|
||||
/** @var array $items */
|
||||
/** @var array $weapons */
|
||||
/** @var array $armors */
|
||||
/** @var array $acInfo */
|
||||
$base = url('/characters/' . (int) $character['id']);
|
||||
$monogram = mb_strtoupper(mb_substr((string) $character['name'], 0, 1), 'UTF-8');
|
||||
$status = (string) $character['status'];
|
||||
$bonuses = $derived['bonuses'];
|
||||
$equipped = array_values(array_filter($items, static fn ($item) => (int) $item['equipped'] === 1));
|
||||
?>
|
||||
<div class="page-head">
|
||||
<div>
|
||||
<p class="muted" style="margin:0; letter-spacing:.16em; text-transform:uppercase; font-size:.72rem;">
|
||||
Bogen von <?= e((string) $character['owner_name']) ?>
|
||||
</p>
|
||||
<h1><?= e((string) $character['name']) ?><?php if ((string) $character['title'] !== ''): ?>
|
||||
<small class="muted" style="font-size:.55em;">· <?= e((string) $character['title']) ?></small>
|
||||
<?php endif; ?></h1>
|
||||
<p class="lede">
|
||||
<?= e((string) $character['class_name']) ?> · Stufe <?= (int) $character['level'] ?>
|
||||
· <?= (int) $character['xp'] ?> EP
|
||||
<?php if ((string) $character['alignment'] !== '' && (string) $character['alignment'] !== '–'): ?>
|
||||
· <?= e((string) $character['alignment']) ?>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="actions" style="margin:0">
|
||||
<a class="btn btn-primary" href="<?= e($base . '/edit') ?>">Bearbeiten</a>
|
||||
<a class="btn" href="<?= e($base . '/pdf') ?>">Als PDF</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="panel">
|
||||
<div class="sheet-head">
|
||||
<div class="stat-row">
|
||||
<?php foreach (WS_ATTRIBUTES as $field => [$short, $label]): ?>
|
||||
<div class="stat">
|
||||
<span class="k"><?= e($short) ?></span>
|
||||
<span class="v"><?= (int) $character[$field] ?></span>
|
||||
<span class="b <?= bonus_class((int) $bonuses[$field]) ?>"><?= e(signed($bonuses[$field])) ?></span>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php $portraitSrc = portrait_url($character); ?>
|
||||
<?php if ($portraitSrc !== ''): ?>
|
||||
<img class="portrait-frame" src="<?= e($portraitSrc) ?>" alt="Porträt von <?= e((string) $character['name']) ?>">
|
||||
<?php else: ?>
|
||||
<div class="monogram" aria-hidden="true"><?= e($monogram) ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<hr class="divider">
|
||||
|
||||
<div class="stat-row">
|
||||
<div class="stat">
|
||||
<span class="k">Trefferpunkte</span>
|
||||
<span class="v"><?= (int) $character['hp_current'] ?> / <?= (int) $character['hp_max'] ?></span>
|
||||
</div>
|
||||
<div class="stat">
|
||||
<span class="k">Rüstungsklasse</span>
|
||||
<span class="v"><?= (int) $acInfo['total'] ?></span>
|
||||
<span class="b" style="color:var(--parchment-dim)"><?= $acInfo['manual_active']
|
||||
? 'manuell gesetzt'
|
||||
: '10 Basis · Geschick ' . e(signed((int) $acInfo['dexterity'])) . ' · Rüstung ' . e(signed((int) $acInfo['armor'])) ?></span>
|
||||
</div>
|
||||
<div class="stat"><span class="k">Angriff</span><span class="v"><?= e(signed((int) $character['attack_bonus'])) ?></span></div>
|
||||
<div class="stat"><span class="k">Gold</span><span class="v"><?= (int) $character['gold_coins'] ?></span></div>
|
||||
<div class="stat">
|
||||
<span class="k">Status</span>
|
||||
<span class="v" style="font-size:1rem;">
|
||||
<span class="badge badge-<?= e($status === 'active' ? 'active' : $status) ?>">
|
||||
<?= e(character_status_label($status)) ?>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="hp-bar" style="margin-top:1rem;height:9px;border-radius:99px;background:rgba(0,0,0,.55);overflow:hidden;border:1px solid rgba(201,162,39,.25)">
|
||||
<span style="display:block;height:100%;width:<?= (int) round($derived['hp_ratio'] * 100) ?>%;
|
||||
background: linear-gradient(90deg, <?= $derived['hp_state'] === 'healthy' ? 'var(--moss), var(--gold-bright)' : 'var(--blood), var(--ember)' ?>);"></span>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$saves = [];
|
||||
foreach (WS_SAVES as $field => $label) {
|
||||
if ($character[$field] !== null && $character[$field] !== '') {
|
||||
$saves[$label] = (int) $character[$field];
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php if ($saves !== []): ?>
|
||||
<hr class="divider">
|
||||
<h2 style="font-size:1rem;">Rettungswürfe</h2>
|
||||
<div class="stat-row">
|
||||
<?php foreach ($saves as $label => $value): ?>
|
||||
<div class="stat"><span class="k"><?= e($label) ?></span><span class="v"><?= $value ?></span></div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
<section class="panel">
|
||||
<h2>Bewaffnung</h2>
|
||||
<?php if ($weapons === []): ?>
|
||||
<p class="muted">Keine Waffe eingetragen. <a href="<?= e($base . '/edit#bewaffnung') ?>">Waffe wählen</a></p>
|
||||
<?php else: ?>
|
||||
<table class="data">
|
||||
<thead><tr><th>Waffe</th><th class="num">Trefferwurf</th><th class="num">Schaden</th><th>Status</th></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($weapons as $weapon): ?>
|
||||
<tr>
|
||||
<td><?= e((string) $weapon['name']) ?> <span class="muted" style="font-size:.78rem">· <?= e((string) $weapon['category']) ?></span></td>
|
||||
<td class="num"><b><?= e(signed(weapon_attack_total($character, $weapon))) ?></b></td>
|
||||
<td class="num"><?= e(weapon_damage_total($character, $weapon)) ?></td>
|
||||
<td class="muted"><?= (int) $weapon['equipped'] === 1 ? 'geführt' : 'weggelegt' ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
<section class="panel">
|
||||
<h2>Rüstung</h2>
|
||||
<?php if ($armors === []): ?>
|
||||
<p class="muted">Nichts am Körper. <a href="<?= e($base . '/edit#ruestung') ?>">Rüstung wählen</a></p>
|
||||
<?php else: ?>
|
||||
<table class="data">
|
||||
<thead><tr><th>Teil</th><th class="num">RK-Bonus</th><th>Art</th><th>Status</th></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($armors as $armor): ?>
|
||||
<tr>
|
||||
<td><?= e((string) $armor['name']) ?></td>
|
||||
<td class="num"><?= e(signed((int) $armor['ac_bonus'])) ?></td>
|
||||
<td class="muted"><?= e((string) $armor['kind']) ?></td>
|
||||
<td class="muted"><?= (int) $armor['equipped'] === 1 ? 'angelegt' : 'abgelegt' ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="muted" style="margin-top:.6rem">
|
||||
Gesamt: 10 + Geschick <?= e(signed((int) $acInfo['dexterity'])) ?>
|
||||
+ Rüstung <?= e(signed((int) $acInfo['armor'])) ?> = <b><?= (int) $acInfo['total'] ?></b>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
<section class="panel">
|
||||
<h2>Fertigkeiten</h2>
|
||||
<?php if ($skills === []): ?>
|
||||
<p class="muted">Noch keine Fertigkeiten eingetragen. <a href="<?= e($base . '/edit#fertigkeiten') ?>">Ergänzen</a></p>
|
||||
<?php else: ?>
|
||||
<?php foreach (skills_grouped($skills) as $group => $groupSkills): ?>
|
||||
<h3 class="skill-group"><?= e($group) ?></h3>
|
||||
<table class="data skill-table">
|
||||
<thead><tr><th>Fertigkeit</th><th>Attribut</th><th class="num">MOD</th><th class="num">Stufe</th><th>Notiz</th></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($groupSkills as $skill): ?>
|
||||
<?php $mod = skill_attribute_modifier($character, $skill); ?>
|
||||
<tr>
|
||||
<td class="skill-name"><?= e((string) $skill['name']) ?></td>
|
||||
<td class="muted"><?= e((string) ($skill['attribute'] ?? '')) ?></td>
|
||||
<td class="num <?= $mod === null ? 'muted' : bonus_class($mod) ?>"><?= $mod === null ? '–' : e(signed($mod)) ?></td>
|
||||
<td class="num <?= bonus_class((int) $skill['bonus']) ?>"><b><?= e(signed((int) $skill['bonus'])) ?></b></td>
|
||||
<td class="muted"><?= e((string) $skill['note']) ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
<?php foreach (['arkan' => 'Arkane Zauber', 'klerikal' => 'Göttliche Liturgien'] as $school => $label): ?>
|
||||
<?php if ($spells[$school] !== []): ?>
|
||||
<section class="panel">
|
||||
<h2><?= e($label) ?></h2>
|
||||
<?php
|
||||
$byGrade = [];
|
||||
foreach ($spells[$school] as $spell) {
|
||||
$byGrade[(int) $spell['grade']][] = $spell;
|
||||
}
|
||||
ksort($byGrade);
|
||||
?>
|
||||
<?php foreach ($byGrade as $grade => $entries): ?>
|
||||
<div class="grade-block">
|
||||
<h4>Grad <?= (int) $grade ?></h4>
|
||||
<div class="pill-list">
|
||||
<?php foreach ($entries as $entry): ?>
|
||||
<?php
|
||||
$note = trim((string) ($entry['note'] ?? ''));
|
||||
$summary = trim((string) ($entry['summary'] ?? ''));
|
||||
$classes = trim((string) ($entry['classes'] ?? ''));
|
||||
$duration = trim((string) ($entry['duration'] ?? ''));
|
||||
$range = trim((string) ($entry['range_text'] ?? ''));
|
||||
?>
|
||||
<button type="button" class="pill pill-detail"
|
||||
data-spell-detail
|
||||
data-name="<?= e((string) $entry['name']) ?>"
|
||||
data-line="<?= e(($school === 'arkan' ? 'Arkan' : 'Klerikal') . ' · Grad ' . (int) $entry['grade']) ?>"
|
||||
data-classes="<?= e($classes) ?>"
|
||||
data-duration="<?= e($duration) ?>"
|
||||
data-range="<?= e($range) ?>"
|
||||
data-note="<?= e($note) ?>"
|
||||
data-summary="<?= e($summary) ?>"
|
||||
data-body="<?= e(trim((string) ($entry['body'] ?? ''))) ?>"
|
||||
title="Details anzeigen">
|
||||
<?= e((string) $entry['name']) ?>
|
||||
</button>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<p class="muted" style="font-size:.82rem">Namen anklicken für Wirkung, Wirkungsdauer und Reichweite.</p>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<section class="panel">
|
||||
<h2>Inventar</h2>
|
||||
<?php if ($items === []): ?>
|
||||
<p class="muted">Nichts im Gepäck. <a href="<?= e($base . '/edit#inventar') ?>">Ausrüstung ergänzen</a></p>
|
||||
<?php else: ?>
|
||||
<?php if ($equipped !== []): ?>
|
||||
<p class="muted" style="margin-bottom:.6rem">Am Körper:
|
||||
<?= e(implode(', ', array_map(static fn ($item) => (string) $item['name'], $equipped))) ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<table class="data">
|
||||
<thead><tr><th>Anzahl</th><th>Gegenstand</th><th>Art</th><th>Wert</th><th>Notiz</th></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($items as $item): ?>
|
||||
<tr>
|
||||
<td><?= (int) $item['qty'] ?>×</td>
|
||||
<td><?= e((string) $item['name']) ?><?= (int) $item['equipped'] === 1 ? ' <span class="badge" style="font-size:.6rem">angelegt</span>' : '' ?></td>
|
||||
<td class="muted"><?= e((string) $item['category']) ?></td>
|
||||
<td class="muted"><?= e((string) $item['value']) ?></td>
|
||||
<td class="muted"><?= e((string) $item['note']) ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
<?php
|
||||
$facts = [];
|
||||
foreach (['deity' => 'Gottheit', 'age' => 'Alter', 'height' => 'Größe', 'weight' => 'Gewicht'] as $field => $label) {
|
||||
if ((string) $character[$field] !== '') {
|
||||
$facts[] = $label . ': ' . $character[$field];
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php if ($facts !== [] || (string) $character['appearance'] !== '' || (string) $character['background'] !== '' || (string) $character['notes'] !== ''): ?>
|
||||
<section class="panel">
|
||||
<h2>Person & Notizen</h2>
|
||||
<?php if ($facts !== []): ?>
|
||||
<p class="muted"><?= e(implode(' · ', $facts)) ?></p>
|
||||
<?php endif; ?>
|
||||
<?php foreach (['appearance' => 'Erscheinung', 'background' => 'Hintergrund', 'notes' => 'Notizen'] as $field => $label): ?>
|
||||
<?php if (trim((string) $character[$field]) !== ''): ?>
|
||||
<h3><?= e($label) ?></h3>
|
||||
<p style="white-space:pre-wrap"><?= e((string) $character[$field]) ?></p>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<dialog class="selector spell-detail" id="spell-detail" aria-labelledby="spell-detail-title">
|
||||
<div class="selector-head">
|
||||
<h2 id="spell-detail-title" data-spell-field="name">Zauber</h2>
|
||||
<button class="btn btn-small" type="button" data-dialog-close>Schließen</button>
|
||||
</div>
|
||||
<div class="selector-body">
|
||||
<p class="muted" style="margin-top:0" data-spell-field="line">–</p>
|
||||
<dl class="detail-list">
|
||||
<dt>Klassen</dt>
|
||||
<dd data-spell-field="classes">–</dd>
|
||||
<dt>Wirkungsdauer</dt>
|
||||
<dd data-spell-field="duration">–</dd>
|
||||
<dt>Reichweite</dt>
|
||||
<dd data-spell-field="range">–</dd>
|
||||
<dt>Notiz</dt>
|
||||
<dd data-spell-field="note">–</dd>
|
||||
</dl>
|
||||
<p data-spell-field="summary" style="margin-top:0"></p>
|
||||
<div class="spell-body" data-spell-field="body"></div>
|
||||
<p class="muted" data-spell-field="empty" hidden>Eigener Eintrag – im Katalog steht keine Beschreibung.</p>
|
||||
</div>
|
||||
</dialog>
|
||||
74
westreiche_website/views/characters.php
Normal file
74
westreiche_website/views/characters.php
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
<?php
|
||||
/** @var array $characters */
|
||||
$isAdmin = auth_can_manage($user ?? null);
|
||||
$grouped = [];
|
||||
foreach ($characters as $character) {
|
||||
$grouped[(string) $character['owner_name']][] = $character;
|
||||
}
|
||||
?>
|
||||
<div class="page-head">
|
||||
<div>
|
||||
<h1><?= $isAdmin ? 'Alle Charaktere' : 'Deine Charaktere' ?></h1>
|
||||
<p class="lede">
|
||||
Jeder Bogen sammelt Werte, Fertigkeiten, Zauber und Liturgien, Inventar und Notizen –
|
||||
und lässt sich als PDF mitnehmen an den Spieltisch.
|
||||
</p>
|
||||
</div>
|
||||
<a class="btn btn-primary" href="<?= e(url('/characters/new')) ?>">Charakter erschaffen</a>
|
||||
</div>
|
||||
|
||||
<?php if ($characters === []): ?>
|
||||
<section class="panel empty-state">
|
||||
<span class="rune" aria-hidden="true">✦</span>
|
||||
<h2>Noch kein Bogen</h2>
|
||||
<p>Die Westreiche wartet auf ihren ersten Helden. Erschaffe einen Charakter – Name, Klasse, Attribute, fertig.</p>
|
||||
<p><a class="btn btn-primary" href="<?= e(url('/characters/new')) ?>">Ersten Charakter anlegen</a></p>
|
||||
</section>
|
||||
<?php else: ?>
|
||||
<?php foreach ($grouped as $owner => $rows): ?>
|
||||
<section class="panel">
|
||||
<?php if ($isAdmin): ?>
|
||||
<h2 style="font-size:1rem; letter-spacing:.16em; text-transform:uppercase; color:var(--parchment-dim);">
|
||||
<?= e($owner) ?>
|
||||
</h2>
|
||||
<?php endif; ?>
|
||||
<div class="card-grid">
|
||||
<?php foreach ($rows as $character): ?>
|
||||
<?php
|
||||
$derived = character_derived($character);
|
||||
$status = (string) $character['status'];
|
||||
?>
|
||||
<a class="hero-card" href="<?= e(url('/characters/' . (int) $character['id'])) ?>">
|
||||
<?php $thumb = portrait_url($character); ?>
|
||||
<div style="display:flex; justify-content:space-between; gap:.5rem; align-items:flex-start;">
|
||||
<span style="display:flex; gap:.7rem; align-items:center;">
|
||||
<?php if ($thumb !== ''): ?>
|
||||
<img class="hero-thumb" src="<?= e($thumb) ?>" alt="" aria-hidden="true" loading="lazy">
|
||||
<?php endif; ?>
|
||||
<span class="name"><?= e((string) $character['name']) ?></span>
|
||||
</span>
|
||||
<?php if ($status !== 'active'): ?>
|
||||
<span class="badge badge-<?= e($status) ?>"><?= e(character_status_label($status)) ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="meta">
|
||||
<?= e((string) $character['class_name']) ?> · Stufe <?= (int) $character['level'] ?>
|
||||
<?php if ((string) $character['title'] !== ''): ?>
|
||||
· <?= e((string) $character['title']) ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="hp-bar <?= e($derived['hp_state']) ?>" role="img"
|
||||
aria-label="<?= (int) $character['hp_current'] ?> von <?= (int) $character['hp_max'] ?> Trefferpunkten">
|
||||
<span style="width: <?= (int) round($derived['hp_ratio'] * 100) ?>%"></span>
|
||||
</div>
|
||||
<div class="meta" style="margin-top:.4rem;">
|
||||
TP <?= (int) $character['hp_current'] ?>/<?= (int) $character['hp_max'] ?>
|
||||
· RK <?= (int) $character['ac'] ?>
|
||||
· <?= (int) $character['xp'] ?> EP
|
||||
</div>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
48
westreiche_website/views/invite.php
Normal file
48
westreiche_website/views/invite.php
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
/** @var array|null $invite */
|
||||
/** @var string $error */
|
||||
/** @var string $token */
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="theme-color" content="#0a0d16">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<title>Einladung · Westreiche</title>
|
||||
<link rel="icon" href="<?= e(asset('crest.svg')) ?>" type="image/svg+xml">
|
||||
<link rel="stylesheet" href="<?= e(asset('app.css')) ?>">
|
||||
<script src="<?= e(asset('app.js')) ?>" defer></script>
|
||||
</head>
|
||||
<body class="auth-shell">
|
||||
<div class="auth-stars" aria-hidden="true"></div>
|
||||
<main class="auth-card">
|
||||
<p class="brand-kicker">Westreiche</p>
|
||||
<h1>Einladung</h1>
|
||||
|
||||
<?php if ($error !== ''): ?>
|
||||
<p class="alert alert-error"><?= e($error) ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($invite === null): ?>
|
||||
<p>Dieser Einladungslink ist ungültig oder abgelaufen. Bitte den Spielleiter um einen neuen Link.</p>
|
||||
<p><a class="btn" href="<?= e(url('/login')) ?>">Zur Anmeldung</a></p>
|
||||
<?php else: ?>
|
||||
<p>Willkommen, <strong><?= e((string) $invite['username']) ?></strong>. Vergib jetzt dein Passwort – danach ist der Link verbraucht.</p>
|
||||
<form method="post" action="<?= e(url('/invite/' . $token)) ?>" class="form-grid">
|
||||
<?= csrf_field() ?>
|
||||
<label class="field">
|
||||
<span>Passwort (mindestens 8 Zeichen)</span>
|
||||
<input type="password" name="password" required minlength="8" autocomplete="new-password" autofocus>
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Passwort wiederholen</span>
|
||||
<input type="password" name="password_repeat" required minlength="8" autocomplete="new-password">
|
||||
</label>
|
||||
<button class="btn btn-primary" type="submit">Beitreten</button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
91
westreiche_website/views/layout.php
Normal file
91
westreiche_website/views/layout.php
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
<?php
|
||||
/** @var string $title */
|
||||
/** @var string $content */
|
||||
/** @var array|null $user */
|
||||
$flashes = flash_pull();
|
||||
$path = current_path();
|
||||
$isAdmin = ($user['role'] ?? '') === 'admin';
|
||||
$navCurrent = static function (string $area) use ($path): string {
|
||||
$active = match ($area) {
|
||||
'home' => $path === '/',
|
||||
'new' => $path === '/characters/new',
|
||||
'admin' => str_starts_with($path, '/admin'),
|
||||
'account' => $path === '/account',
|
||||
default => false,
|
||||
};
|
||||
return $active ? ' aria-current="page"' : '';
|
||||
};
|
||||
$displayName = (string) ($user['display_name'] ?? '');
|
||||
if ($displayName === '') {
|
||||
$displayName = (string) ($user['username'] ?? '');
|
||||
}
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
||||
<meta name="theme-color" content="#0a0d16">
|
||||
<meta name="csrf-token" content="<?= e(csrf_token()) ?>">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<title><?= e($title) ?> · Westreiche</title>
|
||||
<link rel="icon" href="<?= e(asset('crest.svg')) ?>" type="image/svg+xml">
|
||||
<link rel="stylesheet" href="<?= e(asset('app.css')) ?>">
|
||||
<script src="<?= e(asset('app.js')) ?>" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<a class="skip-link" href="#main">Zum Inhalt springen</a>
|
||||
<div class="embers" aria-hidden="true">
|
||||
<span></span><span></span><span></span><span></span>
|
||||
<span></span><span></span><span></span><span></span>
|
||||
</div>
|
||||
|
||||
<header class="topbar">
|
||||
<div class="topbar-inner">
|
||||
<a class="brand" href="<?= e(url('/')) ?>">
|
||||
<svg class="brand-crest" viewBox="0 0 40 44" aria-hidden="true" focusable="false">
|
||||
<path d="M20 1.5 37 8v14c0 10-7.4 17.6-17 20.5C10.4 39.6 3 32 3 22V8z"
|
||||
fill="none" stroke="#e8c766" stroke-width="1.6"/>
|
||||
<path d="M20 5.5 33.5 10.6v11.4c0 8-5.7 14.3-13.5 17-7.8-2.7-13.5-9-13.5-17V10.6z"
|
||||
fill="rgba(201,162,39,0.10)" stroke="#7a6320" stroke-width="0.8"/>
|
||||
<path d="M12 15.5h3l2.6 9 2.9-11 3 11 2.6-9h3" fill="none" stroke="#e8c766" stroke-width="1.4"
|
||||
stroke-linejoin="round" stroke-linecap="round"/>
|
||||
</svg>
|
||||
<span>Westreiche
|
||||
<small>Charakterverwalter</small>
|
||||
</span>
|
||||
</a>
|
||||
<?php if ($user !== null): ?>
|
||||
<nav class="nav" aria-label="Hauptnavigation">
|
||||
<a href="<?= e(url('/')) ?>"<?= $navCurrent('home') ?>>Charaktere</a>
|
||||
<a href="<?= e(url('/characters/new')) ?>"<?= $navCurrent('new') ?>>Neu</a>
|
||||
<?php if ($isAdmin): ?>
|
||||
<a href="<?= e(url('/admin/users')) ?>"<?= $navCurrent('admin') ?>>Leitung</a>
|
||||
<?php endif; ?>
|
||||
<a href="<?= e(url('/account')) ?>"<?= $navCurrent('account') ?>><?= e($displayName) ?></a>
|
||||
<form method="post" action="<?= e(url('/logout')) ?>">
|
||||
<?= csrf_field() ?>
|
||||
<button type="submit" class="btn-ghost">Abmelden</button>
|
||||
</form>
|
||||
</nav>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="shell">
|
||||
<main id="main">
|
||||
<?php foreach ($flashes as $flashItem): ?>
|
||||
<p class="alert alert-<?= e($flashItem['type'] === 'success' ? 'success' : ($flashItem['type'] === 'info' ? 'info' : 'error')) ?>">
|
||||
<?= e($flashItem['message']) ?>
|
||||
</p>
|
||||
<?php endforeach; ?>
|
||||
<?= $content ?>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<p>Westreiche · Chronik am Zauberturm · <a href="https://zauberturm.de/">zauberturm.de</a></p>
|
||||
<p class="muted">Geschlossene Runde. Keine Registrierung – Konten vergibt der Spielleiter.</p>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
54
westreiche_website/views/login.php
Normal file
54
westreiche_website/views/login.php
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
/** @var string $error */
|
||||
/** @var string $identifier */
|
||||
/** @var string $next */
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="theme-color" content="#0a0d16">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<title>Anmelden · Westreiche</title>
|
||||
<link rel="icon" href="<?= e(asset('crest.svg')) ?>" type="image/svg+xml">
|
||||
<link rel="stylesheet" href="<?= e(asset('app.css')) ?>">
|
||||
<script src="<?= e(asset('app.js')) ?>" defer></script>
|
||||
</head>
|
||||
<body class="auth-shell">
|
||||
<div class="auth-stars" aria-hidden="true"></div>
|
||||
<div class="embers" aria-hidden="true">
|
||||
<span></span><span></span><span></span><span></span>
|
||||
<span></span><span></span><span></span><span></span>
|
||||
</div>
|
||||
<main class="auth-card">
|
||||
<p class="brand-kicker">Zauberturm · Westreiche</p>
|
||||
<h1>Charakterverwalter</h1>
|
||||
<p class="muted">Geschlossene Runde. Anmeldung mit Benutzername oder E-Mail.</p>
|
||||
|
||||
<?php if ($error !== ''): ?>
|
||||
<p class="alert alert-error"><?= e($error) ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<form method="post" action="<?= e(url('/login')) ?>" class="form-grid">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="next" value="<?= e($next) ?>">
|
||||
<label class="field">
|
||||
<span>Benutzername oder E-Mail</span>
|
||||
<input type="text" name="identifier" value="<?= e($identifier) ?>" required autocomplete="username" autofocus>
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Passwort</span>
|
||||
<input type="password" name="password" required autocomplete="current-password">
|
||||
</label>
|
||||
<label class="field" style="grid-auto-flow: column; justify-content: start; align-items: center; gap: .5rem;">
|
||||
<input type="checkbox" name="remember" value="1">
|
||||
<span style="margin:0">Angemeldet bleiben</span>
|
||||
</label>
|
||||
<button class="btn btn-primary" type="submit">Einlass gewähren</button>
|
||||
</form>
|
||||
|
||||
<p class="auth-links">Kein Konto? Der Spielleiter verschickt Einladungen – ohne Einladung ist kein Beitritt möglich.</p>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue