feat: Website und Hub zweisprachig (Deutsch/Englisch)
Website (rinkplanner.programmschmiede.de) liegt jetzt im Repo unter web/: Sprachweiche nach Accept-Language (der User-Agent enthält keine Sprache), /de/ und /en/ als eigene URLs mit hreflang, Cookie für die manuelle Wahl, Texte in web/i18n.php, Markup in web/template.php. Deployment über tools/deploy_web.sh (--sync, --check, --all); /index.html leitet weiter. Hub: optionale englische Oberfläche über den DE/EN-Umschalter, Cookie RHUB_LANG, Route /language. Alle Texte (Views, Meldungen, Validierung, API-messages) stehen in hub/app/i18n_strings.php und laufen über t(); Datum und Zahlen folgen der Sprache. Die API behält ihre code-Felder und antwortet ohne Cookie weiter deutsch. deploy_hub.sh --check prüft jetzt Schlüsselparität und fehlende t()-Schlüssel. Doku: docs/website.md neu, docs/hub.md und AGENTS.md ergänzt.
This commit is contained in:
parent
6c8dc942e8
commit
9819311403
41 changed files with 2801 additions and 326 deletions
|
|
@ -2,51 +2,58 @@
|
|||
<?php $user = auth_user(); ?>
|
||||
<section class="page-head">
|
||||
<div>
|
||||
<h1>Konto</h1>
|
||||
<p class="muted"><?= e($user['username']) ?> · <?= e($user['role'] === 'admin' ? 'Administrator' : 'Beta-Nutzer') ?></p>
|
||||
<h1><?= e(t('account.title')) ?></h1>
|
||||
<p class="muted"><?= e($user['username']) ?> · <?= e($user['role'] === 'admin' ? t('account.role_admin') : t('account.role_user')) ?></p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php if ($user['must_change_password'] === 1): ?>
|
||||
<div class="flash flash-info">Bitte ein neues Passwort setzen, bevor du den Hub weiter nutzt.</div>
|
||||
<div class="flash flash-info"><?= e(t('account.must_change')) ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="columns">
|
||||
<section class="panel">
|
||||
<h2>Passwort ändern</h2>
|
||||
<h2><?= e(t('account.change_password')) ?></h2>
|
||||
<form method="post" action="<?= e(url('/account/password')) ?>" class="stack">
|
||||
<?= csrf_field() ?>
|
||||
<label>
|
||||
Aktuelles Passwort
|
||||
<?= e(t('account.current_password')) ?>
|
||||
<input type="password" name="current_password" autocomplete="current-password" required>
|
||||
</label>
|
||||
<label>
|
||||
Neues Passwort
|
||||
<?= e(t('account.new_password')) ?>
|
||||
<input type="password" name="password" autocomplete="new-password" required>
|
||||
<span class="hint">Mindestens 10 Zeichen.</span>
|
||||
<span class="hint"><?= e(t('account.password_hint')) ?></span>
|
||||
</label>
|
||||
<label>
|
||||
Neues Passwort wiederholen
|
||||
<?= e(t('account.repeat_password')) ?>
|
||||
<input type="password" name="password_repeat" autocomplete="new-password" required>
|
||||
</label>
|
||||
<button class="primary" type="submit">Passwort speichern</button>
|
||||
<button class="primary" type="submit"><?= e(t('account.save_password')) ?></button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="panel">
|
||||
<h2>API-Tokens</h2>
|
||||
<p class="muted">Für die Godot-App. Ein Token ersetzt Benutzername und Passwort im Client und lässt sich jederzeit widerrufen.</p>
|
||||
<h2><?= e(t('account.tokens')) ?></h2>
|
||||
<p class="muted"><?= e(t('account.tokens_lede')) ?></p>
|
||||
<form method="post" action="<?= e(url('/account/tokens')) ?>" class="inline-form">
|
||||
<?= csrf_field() ?>
|
||||
<input type="text" name="name" maxlength="64" placeholder="Name, z. B. Büro-PC" required>
|
||||
<button type="submit">Token erzeugen</button>
|
||||
<input type="text" name="name" maxlength="64" placeholder="<?= e_attr(t('account.token_placeholder')) ?>" required>
|
||||
<button type="submit"><?= e(t('account.token_create')) ?></button>
|
||||
</form>
|
||||
|
||||
<?php if ($tokens): ?>
|
||||
<div class="table-wrap">
|
||||
<table class="list compact">
|
||||
<thead>
|
||||
<tr><th>Name</th><th>Prefix</th><th>Erstellt</th><th>Zuletzt</th><th>Status</th><th></th></tr>
|
||||
<tr>
|
||||
<th><?= e(t('table.name')) ?></th>
|
||||
<th><?= e(t('table.prefix')) ?></th>
|
||||
<th><?= e(t('table.created')) ?></th>
|
||||
<th><?= e(t('table.last_used')) ?></th>
|
||||
<th><?= e(t('table.status')) ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($tokens as $token): ?>
|
||||
|
|
@ -55,13 +62,13 @@
|
|||
<td><code><?= e($token['prefix']) ?>…</code></td>
|
||||
<td><?= e(fmt_dt($token['created_at'])) ?></td>
|
||||
<td><?= e(fmt_dt($token['last_used_at'])) ?></td>
|
||||
<td><?= $token['revoked_at'] !== null ? 'widerrufen' : 'aktiv' ?></td>
|
||||
<td><?= e($token['revoked_at'] !== null ? t('account.token_revoked') : t('account.token_active')) ?></td>
|
||||
<td>
|
||||
<?php if ($token['revoked_at'] === null): ?>
|
||||
<form class="inline" method="post" action="<?= e(url('/account/tokens/revoke')) ?>">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="token_id" value="<?= (int) $token['id'] ?>">
|
||||
<button class="link-button danger" type="submit">widerrufen</button>
|
||||
<button class="link-button danger" type="submit"><?= e(t('account.token_revoke')) ?></button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
|
|
@ -71,7 +78,7 @@
|
|||
</table>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<p class="muted small">Noch kein Token erzeugt.</p>
|
||||
<p class="muted small"><?= e(t('account.no_tokens')) ?></p>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue