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:
parent
92cd48f478
commit
9c955af902
5 changed files with 37 additions and 12 deletions
|
|
@ -1076,9 +1076,14 @@ input[type="datetime-local"]::-webkit-calendar-picker-indicator {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 1fr;
|
grid-template-columns: 1fr 1fr;
|
||||||
gap: 1.5rem;
|
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 {
|
.discord-card {
|
||||||
border: 1px solid var(--discord);
|
border: 1px solid var(--discord);
|
||||||
background: linear-gradient(135deg, rgba(88, 101, 242, 0.16), var(--bg-panel) 65%);
|
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 > 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 h2 { margin: 0 0 0.2rem; }
|
||||||
.tour-restart p { margin: 0; }
|
.tour-restart p { margin: 0; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,8 @@ declare(strict_types=1);
|
||||||
const PROFILE_UPLOAD_DIR = __DIR__ . '/../assets/uploads/profiles/';
|
const PROFILE_UPLOAD_DIR = __DIR__ . '/../assets/uploads/profiles/';
|
||||||
const PROFILE_UPLOAD_URL = '/assets/uploads/profiles/';
|
const PROFILE_UPLOAD_URL = '/assets/uploads/profiles/';
|
||||||
const PROFILE_MAX_CHARACTERS = 12;
|
const PROFILE_MAX_CHARACTERS = 12;
|
||||||
|
// Hoechststufe eines Charakters in Aion 2
|
||||||
|
const PROFILE_MAX_LEVEL = 45;
|
||||||
const PROFILE_MAX_GALLERY = 30;
|
const PROFILE_MAX_GALLERY = 30;
|
||||||
const PROFILE_MAX_BIO = 10000;
|
const PROFILE_MAX_BIO = 10000;
|
||||||
const PROFILE_MAX_UPLOAD = 8 * 1024 * 1024;
|
const PROFILE_MAX_UPLOAD = 8 * 1024 * 1024;
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,12 @@ switch ($action) {
|
||||||
redirect($back);
|
redirect($back);
|
||||||
}
|
}
|
||||||
$class = in_array($_POST['class_name'] ?? '', AION_CLASSES, true) ? $_POST['class_name'] : null;
|
$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);
|
$note = mb_substr(trim((string) ($_POST['note'] ?? '')), 0, 255);
|
||||||
$isMain = !empty($_POST['is_main']) ? 1 : 0;
|
$isMain = !empty($_POST['is_main']) ? 1 : 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ function character_fields(array $c, string $prefix): void
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label for="<?= $prefix ?>-level">Stufe (optional)</label>
|
<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>
|
</div>
|
||||||
<label class="character-main-toggle">
|
<label class="character-main-toggle">
|
||||||
<input type="checkbox" name="is_main" value="1"<?= !empty($c['is_main']) ? ' checked' : '' ?>> Hauptcharakter
|
<input type="checkbox" name="is_main" value="1"<?= !empty($c['is_main']) ? ' checked' : '' ?>> Hauptcharakter
|
||||||
|
|
|
||||||
18
profile.php
18
profile.php
|
|
@ -158,12 +158,12 @@ document.getElementById('avatar-upload-input').addEventListener('change', functi
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="profile-grid">
|
<div class="profile-grid">
|
||||||
<div class="panel">
|
<div class="panel profile-card">
|
||||||
<h2>Anzeigename</h2>
|
<h2>Anzeigename</h2>
|
||||||
<?php if ($profileError): ?>
|
<?php if ($profileError): ?>
|
||||||
<div class="flash flash-error"><?= e($profileError) ?></div>
|
<div class="flash flash-error"><?= e($profileError) ?></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<form method="post" action="/profile.php">
|
<form method="post" action="/profile.php" class="profile-card-form">
|
||||||
<?= csrf_field() ?>
|
<?= csrf_field() ?>
|
||||||
<input type="hidden" name="action" value="update_profile">
|
<input type="hidden" name="action" value="update_profile">
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -191,17 +191,17 @@ document.getElementById('avatar-upload-input').addEventListener('change', functi
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button type="submit">Speichern</button>
|
<button type="submit" class="profile-card-button">Speichern</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if (!empty($user['password_login'])): ?>
|
<?php if (!empty($user['password_login'])): ?>
|
||||||
<div class="panel">
|
<div class="panel profile-card">
|
||||||
<h2>Passwort ändern</h2>
|
<h2>Passwort ändern</h2>
|
||||||
<?php if ($passwordError): ?>
|
<?php if ($passwordError): ?>
|
||||||
<div class="flash flash-error"><?= e($passwordError) ?></div>
|
<div class="flash flash-error"><?= e($passwordError) ?></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<form method="post" action="/profile.php">
|
<form method="post" action="/profile.php" class="profile-card-form">
|
||||||
<?= csrf_field() ?>
|
<?= csrf_field() ?>
|
||||||
<input type="hidden" name="action" value="change_password">
|
<input type="hidden" name="action" value="change_password">
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -213,11 +213,11 @@ document.getElementById('avatar-upload-input').addEventListener('change', functi
|
||||||
<label for="new_password_confirm">Neues Passwort wiederholen</label>
|
<label for="new_password_confirm">Neues Passwort wiederholen</label>
|
||||||
<input type="password" id="new_password_confirm" name="new_password_confirm" required>
|
<input type="password" id="new_password_confirm" name="new_password_confirm" required>
|
||||||
</div>
|
</div>
|
||||||
<button type="submit">Passwort speichern</button>
|
<button type="submit" class="profile-card-button">Passwort speichern</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div class="panel">
|
<div class="panel profile-card">
|
||||||
<h2>Anmeldung</h2>
|
<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>
|
<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>
|
</div>
|
||||||
|
|
@ -263,7 +263,7 @@ document.getElementById('avatar-upload-input').addEventListener('change', functi
|
||||||
<h2>Meine Profilseite</h2>
|
<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>
|
<p class="text-muted">Deine Seite in der Mitgliederliste: ein Text über dich, deine Charaktere mit Portrait und Bild und eine Bildergalerie.</p>
|
||||||
</div>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
@ -278,7 +278,7 @@ document.getElementById('avatar-upload-input').addEventListener('change', functi
|
||||||
<form method="post" action="/profile.php" class="inline-form">
|
<form method="post" action="/profile.php" class="inline-form">
|
||||||
<?= csrf_field() ?>
|
<?= csrf_field() ?>
|
||||||
<input type="hidden" name="action" value="restart_tour">
|
<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>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue