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
|
|
@ -1,63 +1,71 @@
|
|||
<?php /** @var array $invites */ ?>
|
||||
<div class="page-head">
|
||||
<div>
|
||||
<h1>Verwaltung</h1>
|
||||
<p class="muted">Einladungen für die geschlossene Beta.</p>
|
||||
<h1><?= e(t('admin.title')) ?></h1>
|
||||
<p class="muted"><?= e(t('admin_invites.lede')) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<?php $active = 'invites'; require HUB_ROOT . '/views/_admin_nav.php'; ?>
|
||||
|
||||
<section class="panel">
|
||||
<h2>Neue Einladung</h2>
|
||||
<p class="muted">Der Code wird nach dem Anlegen genau einmal angezeigt. Er gilt für ein Konto.</p>
|
||||
<h2><?= e(t('admin_invites.new')) ?></h2>
|
||||
<p class="muted"><?= e(t('admin_invites.new_lede')) ?></p>
|
||||
<form method="post" action="<?= e(url('/admin/invites')) ?>" class="stack">
|
||||
<?= csrf_field() ?>
|
||||
<div class="grid-3">
|
||||
<label>
|
||||
Notiz (intern)
|
||||
<input type="text" name="note" maxlength="190" placeholder="z. B. Verein Nord">
|
||||
<?= e(t('admin_invites.note')) ?>
|
||||
<input type="text" name="note" maxlength="190" placeholder="<?= e_attr(t('admin_invites.note_placeholder')) ?>">
|
||||
</label>
|
||||
<label>
|
||||
E-Mail binden (optional)
|
||||
<?= e(t('admin_invites.email')) ?>
|
||||
<input type="email" name="email" maxlength="190">
|
||||
<span class="hint">Nur diese Adresse kann den Code nutzen.</span>
|
||||
<span class="hint"><?= e(t('admin_invites.email_hint')) ?></span>
|
||||
</label>
|
||||
<label>
|
||||
Gültig (Tage)
|
||||
<?= e(t('admin_invites.days')) ?>
|
||||
<input type="number" name="expires_days" min="0" max="365" value="30">
|
||||
<span class="hint">0 = unbegrenzt.</span>
|
||||
<span class="hint"><?= e(t('admin_invites.days_hint')) ?></span>
|
||||
</label>
|
||||
</div>
|
||||
<button class="primary" type="submit">Einladung erzeugen</button>
|
||||
<button class="primary" type="submit"><?= e(t('admin_invites.create')) ?></button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="panel">
|
||||
<h2>Einladungen</h2>
|
||||
<h2><?= e(t('admin_invites.list')) ?></h2>
|
||||
<?php if (!$invites): ?>
|
||||
<p class="muted">Noch keine Einladungen.</p>
|
||||
<p class="muted"><?= e(t('admin_invites.empty')) ?></p>
|
||||
<?php else: ?>
|
||||
<div class="table-wrap">
|
||||
<table class="list compact">
|
||||
<thead>
|
||||
<tr><th>Erstellt</th><th>Notiz</th><th>E-Mail</th><th>Status</th><th>Von / an</th><th>Gültig bis</th><th></th></tr>
|
||||
<tr>
|
||||
<th><?= e(t('table.created')) ?></th>
|
||||
<th><?= e(t('table.note')) ?></th>
|
||||
<th><?= e(t('table.email')) ?></th>
|
||||
<th><?= e(t('table.status')) ?></th>
|
||||
<th><?= e(t('table.from_to')) ?></th>
|
||||
<th><?= e(t('table.valid_until')) ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($invites as $invite): ?>
|
||||
<?php
|
||||
$status = invite_status($invite);
|
||||
$statusClass = [
|
||||
'offen' => 'open',
|
||||
'eingelöst' => 'used',
|
||||
'abgelaufen' => 'expired',
|
||||
'widerrufen' => 'revoked',
|
||||
'open' => 'open',
|
||||
'used' => 'used',
|
||||
'expired' => 'expired',
|
||||
'revoked' => 'revoked',
|
||||
][$status] ?? 'expired';
|
||||
?>
|
||||
<tr>
|
||||
<td><?= e(fmt_dt($invite['created_at'])) ?></td>
|
||||
<td><?= e($invite['note'] ?: '–') ?></td>
|
||||
<td><?= e($invite['email'] ?: '–') ?></td>
|
||||
<td><span class="status status-<?= e($statusClass) ?>"><?= e($status) ?></span></td>
|
||||
<td><span class="status status-<?= e($statusClass) ?>"><?= e(t('invite.status.' . $status)) ?></span></td>
|
||||
<td>
|
||||
<?= e($invite['creator_name'] ?: '–') ?>
|
||||
<?php if (!empty($invite['used_name'])): ?>
|
||||
|
|
@ -66,11 +74,11 @@
|
|||
</td>
|
||||
<td><?= e(fmt_dt($invite['expires_at'])) ?></td>
|
||||
<td>
|
||||
<?php if ($status === 'offen'): ?>
|
||||
<?php if ($status === 'open'): ?>
|
||||
<form class="inline" method="post" action="<?= e(url('/admin/invites/revoke')) ?>">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="invite_id" value="<?= (int) $invite['id'] ?>">
|
||||
<button class="link-button danger" type="submit">widerrufen</button>
|
||||
<button class="link-button danger" type="submit"><?= e(t('admin_invites.revoke')) ?></button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue