472 lines
24 KiB
PHP
472 lines
24 KiB
PHP
|
|
<?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>
|