Bearbeiten-Modus: Wuergel und Praxispunkte je Fertigkeit anzeigen und setzen

This commit is contained in:
torsten 2026-11-22 19:34:15 +01:00
parent 85fd24a0f0
commit 3795c517fb
2 changed files with 21 additions and 2 deletions

View file

@ -111,6 +111,8 @@ $base = url('/characters/' . $cid);
<th>Fertigkeit</th>
<th>Attribut</th>
<th class="num">MOD</th>
<th class="num">Würfel</th>
<th>PP</th>
<th>Stufe / Notiz</th>
</tr>
</thead>
@ -121,6 +123,20 @@ $base = url('/characters/' . $cid);
<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 die"><b><?= e(skill_die((int) $skill['bonus'])) ?></b></td>
<td class="pp-cell">
<?php $pp = max(0, min(WS_SKILL_PRACTICE_SLOTS, (int) ($skill['pp'] ?? 0))); ?>
<form method="post" action="<?= e($base . '/skills/' . (int) $skill['id'] . '/pp') ?>" class="pp-slots" data-pp-form aria-label="Praxispunkte <?= e((string) $skill['name']) ?>">
<?= csrf_field() ?>
<input type="hidden" name="back" value="edit">
<?php for ($slot = 1; $slot <= WS_SKILL_PRACTICE_SLOTS; $slot++): ?>
<button type="submit" name="pp" value="<?= $slot ?>"
class="pp-slot<?= $slot <= $pp ? ' is-filled' : '' ?>"
title="<?= $slot ?> Praxispunkt<?= $slot === 1 ? '' : 'e' ?>"
aria-pressed="<?= $slot <= $pp ? 'true' : 'false' ?>"></button>
<?php endfor; ?>
</form>
</td>
<td>
<div class="inline-form">
<form method="post" action="<?= e($base . '/skills/' . (int) $skill['id']) ?>" class="inline-form">