Dashboard: Lumipunkte as their own section

The points move out of the stat cards into their own panel below the
welcome panel. It shows the balance, your rank out of all members, your
open or approved-but-not-delivered Lumishop orders, and buttons to the
ranking and the shop. The stat card panel is hidden when there is
nothing to show in it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Maaxxs 2026-09-21 10:59:47 +02:00
parent 17dea6d41f
commit 667bf676c8
2 changed files with 58 additions and 18 deletions

View file

@ -2873,11 +2873,22 @@ input.shop-approve-quantity { width: 72px; padding: 0.3rem 0.45rem; font-size: 0
.shop-order-stock { color: var(--text-muted); } .shop-order-stock { color: var(--text-muted); }
.shop-order-stock.is-short { color: var(--danger); } .shop-order-stock.is-short { color: var(--danger); }
/* Dashboard: eigene Lumipunkte */ /* Dashboard: eigener Bereich fuer die Lumipunkte */
.stat-card-points { border-color: rgba(201, 162, 39, 0.45); background: linear-gradient(135deg, rgba(201, 162, 39, 0.14), var(--bg-panel) 70%); } .dashboard-points {
.stat-card-points img { flex-shrink: 0; filter: drop-shadow(0 3px 8px rgba(201, 162, 39, 0.35)); } display: flex;
.stat-card-points h3 { color: var(--gold); font-size: 1.35rem; } align-items: center;
.stat-card-links { margin-top: 0.2rem !important; font-size: 0.8rem; } flex-wrap: wrap;
gap: 1rem 1.5rem;
border-color: rgba(201, 162, 39, 0.45);
background: linear-gradient(135deg, rgba(201, 162, 39, 0.14), rgba(35, 35, 35, 0.92) 60%);
}
.dashboard-points-coin { flex-shrink: 0; filter: drop-shadow(0 4px 10px rgba(201, 162, 39, 0.4)); }
.dashboard-points-main { min-width: 160px; }
.dashboard-points-main h2 { margin: 0; font-size: 1rem; color: var(--text-muted); font-weight: 600; }
.dashboard-points-value { font-size: 2.2rem; font-weight: 700; line-height: 1.15; color: var(--gold); font-variant-numeric: tabular-nums; }
.dashboard-points-main p { margin: 0.1rem 0 0; font-size: 0.85rem; }
.dashboard-points-shop { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; }
.dashboard-points-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-left: auto; }
@media (max-width: 700px) { @media (max-width: 700px) {
.shop-order-actions { flex-wrap: wrap; justify-content: flex-end; width: 100%; } .shop-order-actions { flex-wrap: wrap; justify-content: flex-end; width: 100%; }
} }

View file

@ -59,6 +59,19 @@ if ($canViewContributions) {
); );
$rankStmt->execute([$myPoints]); $rankStmt->execute([$myPoints]);
$myRank = (int) $rankStmt->fetchColumn(); $myRank = (int) $rankStmt->fetchColumn();
$memberTotal = (int) db()->query("SELECT COUNT(*) FROM users WHERE status = 'active'")->fetchColumn();
}
// Eigene Lumishop-Antraege: offen bzw. bewilligt und noch nicht uebergeben.
$myShopOpen = 0;
$myShopReady = 0;
if ($canViewShop) {
$shopStmt = db()->prepare(
"SELECT COALESCE(SUM(status = 'pending'), 0), COALESCE(SUM(status = 'approved'), 0)
FROM shop_orders WHERE user_id = ?"
);
$shopStmt->execute([(int) $user['id']]);
[$myShopOpen, $myShopReady] = array_map('intval', $shopStmt->fetch(PDO::FETCH_NUM));
} }
$memberCount = $canViewUsers ? (int) db()->query("SELECT COUNT(*) FROM users WHERE status = 'active'")->fetchColumn() : null; $memberCount = $canViewUsers ? (int) db()->query("SELECT COUNT(*) FROM users WHERE status = 'active'")->fetchColumn() : null;
@ -120,21 +133,36 @@ include __DIR__ . '/includes/header.php';
</div> </div>
</div> </div>
<?php if ($myPoints !== null): ?>
<div class="panel dashboard-points">
<img class="dashboard-points-coin" src="/assets/images/lumipunkt.svg" alt="" width="64" height="64">
<div class="dashboard-points-main">
<h2>Lumipunkte</h2>
<div class="dashboard-points-value"><?= e(contribution_format($myPoints)) ?></div>
<p class="text-muted">Platz <?= (int) $myRank ?> von <?= (int) $memberTotal ?> in der Rangliste</p>
</div>
<?php if ($canViewShop && ($myShopOpen > 0 || $myShopReady > 0)): ?>
<div class="dashboard-points-shop">
<?php if ($myShopOpen > 0): ?>
<span class="badge badge-pending"><?= $myShopOpen ?> <?= $myShopOpen === 1 ? 'Antrag wartet' : 'Anträge warten' ?> auf Bewilligung</span>
<?php endif; ?>
<?php if ($myShopReady > 0): ?>
<span class="badge shop-badge-approved"><?= $myShopReady ?> bewilligt – Übergabe im Spiel ausstehend</span>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="dashboard-points-links">
<a class="button button-secondary" href="/contributions.php">Rangliste &amp; Verlauf</a>
<?php if ($canViewShop): ?>
<a class="button" href="/shop.php">Zum Lumishop</a>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<?php if ($canViewRaids || $canViewUsers || $canManageRoles): ?>
<div class="panel"> <div class="panel">
<div class="card-grid"> <div class="card-grid">
<?php if ($myPoints !== null): ?>
<div class="panel stat-card stat-card-points">
<img src="/assets/images/lumipunkt.svg" alt="" width="44" height="44">
<div>
<h3><?= e(contribution_format($myPoints)) ?></h3>
<p class="text-muted">Lumipunkte · Platz <?= (int) $myRank ?></p>
<p class="stat-card-links">
<a href="/contributions.php">Rangliste</a>
<?php if ($canViewShop): ?>· <a href="/shop.php">Lumishop</a><?php endif; ?>
</p>
</div>
</div>
<?php endif; ?>
<?php if ($canViewRaids): ?> <?php if ($canViewRaids): ?>
<div class="panel stat-card"> <div class="panel stat-card">
<div class="icon-badge"><?= icon('calendar') ?></div> <div class="icon-badge"><?= icon('calendar') ?></div>
@ -164,6 +192,7 @@ include __DIR__ . '/includes/header.php';
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>
<?php endif; ?>
<?php if ($canViewRaids): ?> <?php if ($canViewRaids): ?>
<div class="panel"> <div class="panel">