Premades: move class action out of member cards into own grid slot
The own class control no longer sits inside the lead/member card. It now renders as a dedicated 6th roster-grid tile (the cell left free next to slot 5) showing the current class icon and a Festlegen/Aendern label, opening the same class-picker popup as before. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
2d3a3562c2
commit
89ba2ebb35
3 changed files with 49 additions and 14 deletions
|
|
@ -840,20 +840,33 @@ input:focus, select:focus, textarea:focus {
|
||||||
|
|
||||||
.premade-slot-invite-btn:hover { color: var(--gold); }
|
.premade-slot-invite-btn:hover { color: var(--gold); }
|
||||||
|
|
||||||
.premade-class-btn {
|
/* Eigene Klassen-Aktion: sitzt als zusaetzliche Kachel im (bei 5 Slots stets
|
||||||
background: none;
|
freien) 6. Grid-Feld neben der Mitgliederliste statt in einer der Karten. */
|
||||||
|
.premade-slot-class-action:hover { background: var(--gold); }
|
||||||
|
|
||||||
|
.premade-class-action-btn {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
border: none;
|
border: none;
|
||||||
padding: 0;
|
border-radius: 0;
|
||||||
margin: 0;
|
color: inherit;
|
||||||
font: inherit;
|
|
||||||
font-size: 0.78rem;
|
|
||||||
font-weight: 600;
|
|
||||||
text-align: left;
|
text-align: left;
|
||||||
color: var(--gold);
|
font: inherit;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.premade-class-btn:hover { color: var(--gold-hover); text-decoration: underline; }
|
.premade-class-action-btn:hover { background: var(--bg-panel-alt); }
|
||||||
|
|
||||||
|
.premade-class-action-icon { color: var(--text-muted); }
|
||||||
|
|
||||||
|
.premade-class-action-label {
|
||||||
|
margin-left: auto;
|
||||||
|
flex-shrink: 0;
|
||||||
|
font-size: 0.75rem;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--gold);
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
.premade-invite-list {
|
.premade-invite-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@
|
||||||
|
|
||||||
wireModal(classModal);
|
wireModal(classModal);
|
||||||
|
|
||||||
document.querySelectorAll('.premade-class-btn').forEach(function (btn) {
|
document.querySelectorAll('.premade-class-action-btn').forEach(function (btn) {
|
||||||
btn.addEventListener('click', function () {
|
btn.addEventListener('click', function () {
|
||||||
classPremadeIdField.value = btn.getAttribute('data-premade-id') || '';
|
classPremadeIdField.value = btn.getAttribute('data-premade-id') || '';
|
||||||
var currentClass = btn.getAttribute('data-current-class') || '';
|
var currentClass = btn.getAttribute('data-current-class') || '';
|
||||||
|
|
|
||||||
30
premades.php
30
premades.php
|
|
@ -193,6 +193,8 @@ include __DIR__ . '/includes/header.php';
|
||||||
while (count($slots) < 5) {
|
while (count($slots) < 5) {
|
||||||
$slots[] = ['type' => 'empty'];
|
$slots[] = ['type' => 'empty'];
|
||||||
}
|
}
|
||||||
|
$isMemberHere = false;
|
||||||
|
$myClass = null;
|
||||||
?>
|
?>
|
||||||
<div class="premade-roster">
|
<div class="premade-roster">
|
||||||
<?php foreach ($slots as $slot): ?>
|
<?php foreach ($slots as $slot): ?>
|
||||||
|
|
@ -211,6 +213,10 @@ include __DIR__ . '/includes/header.php';
|
||||||
<?php
|
<?php
|
||||||
$slotUser = premade_avatar_user((int) $slot['id'], $linkedUsersByDiscordId, $slot['name']);
|
$slotUser = premade_avatar_user((int) $slot['id'], $linkedUsersByDiscordId, $slot['name']);
|
||||||
$isMe = $discordId !== null && (int) $slot['id'] === $discordId;
|
$isMe = $discordId !== null && (int) $slot['id'] === $discordId;
|
||||||
|
if ($isMe && $slot['type'] !== 'pending') {
|
||||||
|
$myClass = $slot['class'] ?? null;
|
||||||
|
$isMemberHere = true;
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<div class="premade-slot premade-slot-<?= e($slot['type']) ?>">
|
<div class="premade-slot premade-slot-<?= e($slot['type']) ?>">
|
||||||
<div class="premade-slot-inner">
|
<div class="premade-slot-inner">
|
||||||
|
|
@ -219,10 +225,6 @@ include __DIR__ . '/includes/header.php';
|
||||||
<strong><?= $slot['type'] === 'pending' ? '⏳ ' : '' ?><?= e($slot['name']) ?></strong>
|
<strong><?= $slot['type'] === 'pending' ? '⏳ ' : '' ?><?= e($slot['name']) ?></strong>
|
||||||
<?php if ($slot['type'] === 'pending'): ?>
|
<?php if ($slot['type'] === 'pending'): ?>
|
||||||
<span class="text-muted">Einladung offen</span>
|
<span class="text-muted">Einladung offen</span>
|
||||||
<?php elseif ($isMe): ?>
|
|
||||||
<button type="button" class="premade-class-btn" data-premade-id="<?= $premadeId ?>" data-current-class="<?= e((string) ($slot['class'] ?? '')) ?>">
|
|
||||||
<?= empty($slot['class']) ? 'Klasse festlegen' : 'Klasse ändern' ?>
|
|
||||||
</button>
|
|
||||||
<?php elseif (!empty($slot['class'])): ?>
|
<?php elseif (!empty($slot['class'])): ?>
|
||||||
<span class="text-muted"><?= e($slot['class']) ?></span>
|
<span class="text-muted"><?= e($slot['class']) ?></span>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
@ -242,6 +244,26 @@ include __DIR__ . '/includes/header.php';
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
<?php if ($isMemberHere): ?>
|
||||||
|
<?php $myClassIcon = !empty($myClass) ? class_icon_url($myClass) : null; ?>
|
||||||
|
<div class="premade-slot premade-slot-class-action">
|
||||||
|
<button type="button" class="premade-slot-inner premade-class-action-btn" data-premade-id="<?= $premadeId ?>" data-current-class="<?= e((string) ($myClass ?? '')) ?>">
|
||||||
|
<span class="class-icon-frame premade-class-action-icon">
|
||||||
|
<?php if ($myClassIcon): ?>
|
||||||
|
<img src="<?= e($myClassIcon) ?>" alt="">
|
||||||
|
<?php else: ?>
|
||||||
|
<?= icon('edit') ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</span>
|
||||||
|
<span class="premade-slot-name">
|
||||||
|
<strong>Deine Klasse</strong>
|
||||||
|
<span class="text-muted"><?= $myClass ? e($myClass) : 'Nicht festgelegt' ?></span>
|
||||||
|
</span>
|
||||||
|
<span class="premade-class-action-label"><?= $myClass ? 'Ändern' : 'Festlegen' ?></span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if ($canManageThis): ?>
|
<?php if ($canManageThis): ?>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue