Profile page: symmetric boxes and buttons, character level limited to 45

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Maaxxs 2026-09-22 09:49:47 +02:00
parent 92cd48f478
commit 9c955af902
5 changed files with 37 additions and 12 deletions

View file

@ -1076,9 +1076,14 @@ input[type="datetime-local"]::-webkit-calendar-picker-indicator {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1.5rem;
align-items: start;
align-items: stretch;
}
/* Kaesten nebeneinander gleich hoch, der Button sitzt jeweils unten auf gleicher Hoehe */
.profile-card { display: flex; flex-direction: column; }
.profile-card-form { display: flex; flex-direction: column; flex: 1; }
.profile-card-button { margin-top: auto; width: 13rem; max-width: 100%; }
.discord-card {
border: 1px solid var(--discord);
background: linear-gradient(135deg, rgba(88, 101, 242, 0.16), var(--bg-panel) 65%);
@ -3283,6 +3288,19 @@ input.shop-approve-quantity { width: 72px; padding: 0.3rem 0.45rem; font-size: 0
}
.tour-restart > div { flex: 1; }
.tour-restart-panel .tour-restart { min-height: 4.5rem; }
/* Beide Buttons (Link und Formular-Knopf) gleich gross */
.tour-restart-button {
display: inline-flex;
align-items: center;
justify-content: center;
width: 15rem;
max-width: 100%;
min-height: 2.75rem;
padding: 0.6rem 1rem;
font-size: 1rem;
line-height: 1.2;
}
.tour-restart h2 { margin: 0 0 0.2rem; }
.tour-restart p { margin: 0; }

View file

@ -10,6 +10,8 @@ declare(strict_types=1);
const PROFILE_UPLOAD_DIR = __DIR__ . '/../assets/uploads/profiles/';
const PROFILE_UPLOAD_URL = '/assets/uploads/profiles/';
const PROFILE_MAX_CHARACTERS = 12;
// Hoechststufe eines Charakters in Aion 2
const PROFILE_MAX_LEVEL = 45;
const PROFILE_MAX_GALLERY = 30;
const PROFILE_MAX_BIO = 10000;
const PROFILE_MAX_UPLOAD = 8 * 1024 * 1024;

View file

@ -68,7 +68,12 @@ switch ($action) {
redirect($back);
}
$class = in_array($_POST['class_name'] ?? '', AION_CLASSES, true) ? $_POST['class_name'] : null;
$level = filter_var($_POST['level'] ?? '', FILTER_VALIDATE_INT, ['options' => ['min_range' => 1, 'max_range' => 999]]) ?: null;
$levelInput = trim((string) ($_POST['level'] ?? ''));
$level = filter_var($levelInput, FILTER_VALIDATE_INT, ['options' => ['min_range' => 1, 'max_range' => PROFILE_MAX_LEVEL]]) ?: null;
if ($levelInput !== '' && $level === null) {
set_flash('error', 'Die Stufe muss zwischen 1 und ' . PROFILE_MAX_LEVEL . ' liegen.');
redirect($back);
}
$note = mb_substr(trim((string) ($_POST['note'] ?? '')), 0, 255);
$isMain = !empty($_POST['is_main']) ? 1 : 0;

View file

@ -42,7 +42,7 @@ function character_fields(array $c, string $prefix): void
</div>
<div>
<label for="<?= $prefix ?>-level">Stufe (optional)</label>
<input type="number" id="<?= $prefix ?>-level" name="level" min="1" max="999" value="<?= e((string) ($c['level'] ?? '')) ?>">
<input type="number" id="<?= $prefix ?>-level" name="level" min="1" max="<?= PROFILE_MAX_LEVEL ?>" value="<?= e((string) ($c['level'] ?? '')) ?>">
</div>
<label class="character-main-toggle">
<input type="checkbox" name="is_main" value="1"<?= !empty($c['is_main']) ? ' checked' : '' ?>> Hauptcharakter

View file

@ -158,12 +158,12 @@ document.getElementById('avatar-upload-input').addEventListener('change', functi
</script>
<div class="profile-grid">
<div class="panel">
<div class="panel profile-card">
<h2>Anzeigename</h2>
<?php if ($profileError): ?>
<div class="flash flash-error"><?= e($profileError) ?></div>
<?php endif; ?>
<form method="post" action="/profile.php">
<form method="post" action="/profile.php" class="profile-card-form">
<?= csrf_field() ?>
<input type="hidden" name="action" value="update_profile">
<div>
@ -191,17 +191,17 @@ document.getElementById('avatar-upload-input').addEventListener('change', functi
<?php endif; ?>
</div>
</div>
<button type="submit">Speichern</button>
<button type="submit" class="profile-card-button">Speichern</button>
</form>
</div>
<?php if (!empty($user['password_login'])): ?>
<div class="panel">
<div class="panel profile-card">
<h2>Passwort ändern</h2>
<?php if ($passwordError): ?>
<div class="flash flash-error"><?= e($passwordError) ?></div>
<?php endif; ?>
<form method="post" action="/profile.php">
<form method="post" action="/profile.php" class="profile-card-form">
<?= csrf_field() ?>
<input type="hidden" name="action" value="change_password">
<div>
@ -213,11 +213,11 @@ document.getElementById('avatar-upload-input').addEventListener('change', functi
<label for="new_password_confirm">Neues Passwort wiederholen</label>
<input type="password" id="new_password_confirm" name="new_password_confirm" required>
</div>
<button type="submit">Passwort speichern</button>
<button type="submit" class="profile-card-button">Passwort speichern</button>
</form>
</div>
<?php else: ?>
<div class="panel">
<div class="panel profile-card">
<h2>Anmeldung</h2>
<p class="text-muted">Du meldest dich über Discord an. Die Anmeldung mit Benutzername und Passwort ist für dein Konto nicht freigeschaltet - das kann die Legionsleitung bei Bedarf ändern.</p>
</div>
@ -263,7 +263,7 @@ document.getElementById('avatar-upload-input').addEventListener('change', functi
<h2>Meine Profilseite</h2>
<p class="text-muted">Deine Seite in der Mitgliederliste: ein Text über dich, deine Charaktere mit Portrait und Bild und eine Bildergalerie.</p>
</div>
<a class="button button-secondary" href="/member_edit.php">Profilseite gestalten</a>
<a class="button button-secondary tour-restart-button" href="/member_edit.php">Profilseite gestalten</a>
</div>
</div>
<?php endif; ?>
@ -278,7 +278,7 @@ document.getElementById('avatar-upload-input').addEventListener('change', functi
<form method="post" action="/profile.php" class="inline-form">
<?= csrf_field() ?>
<input type="hidden" name="action" value="restart_tour">
<button type="submit" class="button-secondary">Einführung neu starten</button>
<button type="submit" class="button button-secondary tour-restart-button">Einführung neu starten</button>
</form>
</div>
</div>