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
20
AGENTS.md
20
AGENTS.md
|
|
@ -12,15 +12,29 @@
|
|||
Benutzer als Admin. `storage/.installed` verhindert einen zweiten Lauf.
|
||||
- Uploads liegen in `storage/uploads/` (gesperrt); nur `web/` ist öffentlich.
|
||||
- API v1 mit Bearer-Tokens für die App; Web-UI nutzt Session + CSRF.
|
||||
- Web-UI ist zweisprachig (Deutsch Standard, Englisch optional): Texte in
|
||||
`hub/app/i18n_strings.php`, Zugriff über `t('schlüssel')`, Sprache im Cookie
|
||||
`RHUB_LANG` über den DE/EN-Umschalter (`/language`). Keine Texte direkt in
|
||||
Views oder Meldungen – `./tools/deploy_hub.sh --check` meldet fehlende
|
||||
Schlüssel.
|
||||
- App-Anbindung: `src/core/hub/` (`HubSettings`, `HubClient`, `HubJob`);
|
||||
Token liegt getrennt von `sync.cfg` unter `user://hub.cfg`. Der Menüpunkt
|
||||
`Datei → Kür-Hub…` erscheint nur bei geprüfter Verbindung.
|
||||
|
||||
## Website und Downloads
|
||||
|
||||
- Die Rinkplanner-Seite liegt nur noch unter
|
||||
`rinkplanner.programmschmiede.de/index.html`. `programmschmiede.de/rinkplanner.html`
|
||||
leitet per Root-`.htaccess` (301) dorthin um; keine zweite Kopie anlegen.
|
||||
- Die Rinkplanner-Seite liegt unter `rinkplanner.programmschmiede.de/`,
|
||||
Quelle im Repo unter `web/`. `programmschmiede.de/rinkplanner.html` leitet
|
||||
per Root-`.htaccess` (301) dorthin um; keine zweite Kopie anlegen.
|
||||
- Deployment mit `./tools/deploy_web.sh` (`--sync`, `--check`, `--all`).
|
||||
Nicht direkt per FTP editieren – der nächste Sync überschreibt es. Nur
|
||||
`web/` wird hochgeladen; `media/`, `fonts/` und `version.json` liegen
|
||||
weiterhin nur auf dem Server.
|
||||
- Zweisprachig: `/de/` und `/en/`, `/` leitet anhand von `Accept-Language`
|
||||
weiter (der User-Agent enthält keine Sprache). Die Wahl aus dem DE/EN-
|
||||
Umschalter merkt sich das Cookie `lang`. Texte: `web/i18n.php`, Markup:
|
||||
`web/template.php`, Stile: `web/assets/site.css`.
|
||||
- Details und Host-Eigenheiten: `docs/website.md`.
|
||||
- Builds liegen unter `programmschmiede.de/rinkplanner/download/`.
|
||||
Die Download-Links in der Subdomain-Seite sind absolut
|
||||
(`https://programmschmiede.de/rinkplanner/download/...`).
|
||||
|
|
|
|||
|
|
@ -14,4 +14,5 @@ Planner for Figure Skating free skate
|
|||
- **Kür-Sync (Dropbox):** [`docs/sync.md`](docs/sync.md)
|
||||
- **Cloud-Sync einrichten:** [`docs/cloud-setup.md`](docs/cloud-setup.md)
|
||||
- **Kür-Hub:** [`docs/hub.md`](docs/hub.md)
|
||||
- **Website:** [`docs/website.md`](docs/website.md)
|
||||
- **Updates und Versions-Endpunkt:** [`docs/updates.md`](docs/updates.md)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@
|
|||
# Format: KEY=WERT, eine Zuweisung pro Zeile. '#' startet einen Kommentar.
|
||||
#
|
||||
# ---------------------------------------------------------------------------
|
||||
# FTP: nur noch für tools/sync_assets.sh --publish (Asset-Verteilung).
|
||||
# FTP: für tools/sync_assets.sh --publish (Asset-Verteilung) und
|
||||
# tools/deploy_web.sh (Website rinkplanner.programmschmiede.de).
|
||||
# Der Kür-Sync der App nutzt FTP nicht mehr.
|
||||
# ---------------------------------------------------------------------------
|
||||
# FTP_URL: Hostname oder URL des FTP-Servers, z. B. ftp.example.org
|
||||
|
|
|
|||
28
docs/hub.md
28
docs/hub.md
|
|
@ -207,6 +207,34 @@ Statuscodes: `401` Token fehlt/ungültig, `403` keine Berechtigung oder
|
|||
Passwortwechsel nötig, `404`, `409` Duplikat, `422` Validierung,
|
||||
`429` Limit.
|
||||
|
||||
### Sprache der API-Meldungen
|
||||
|
||||
Die `message`-Felder sind übersetzt, das `code`-Feld bleibt maschinenlesbar
|
||||
und unverändert. Die Sprache folgt dem Cookie `RHUB_LANG`; ohne Cookie
|
||||
antwortet die API deutsch. Die App sollte sich auf `code` verlassen, nicht auf
|
||||
den Text.
|
||||
|
||||
## Sprache der Web-Oberfläche
|
||||
|
||||
Die Oberfläche ist deutsch und englisch. Standard ist Deutsch; umgeschaltet
|
||||
wird ausschließlich über den DE/EN-Umschalter in der Kopfzeile, der das
|
||||
Cookie `RHUB_LANG` (ein Jahr, `SameSite=Lax`) setzt. Es gibt keine
|
||||
automatische Erkennung – der Hub ist eine geschlossene Beta, und die
|
||||
Deutschfassung bleibt die Vorgabe.
|
||||
|
||||
- Alle Texte stehen in `hub/app/i18n_strings.php` unter `de` und `en`,
|
||||
Zugriff über `t('schlüssel', ['platzhalter' => …])`.
|
||||
- `hub_locale()` liest das Cookie, `hub_locale_set()` schreibt es; die Route
|
||||
`/language?lang=de|en&next=…` setzt es und leitet zurück.
|
||||
- Datum und Zahlen folgen der Sprache: deutsch `12.11.2026 10:30` und
|
||||
`5,0 MB`, englisch `2026-11-12 10:30` und `5.0 MB`.
|
||||
- In den Texten steht kein HTML; sie werden an der Ausgabestelle mit `e()`
|
||||
maskiert.
|
||||
- `./tools/deploy_hub.sh --check` prüft, dass beide Sprachblöcke dieselben
|
||||
Schlüssel haben und dass jeder in `t()` verwendete Schlüssel existiert.
|
||||
- Neuer Text gehört immer in beide Blöcke; fehlt eine Übersetzung, zeigt
|
||||
`t()` den Schlüssel an, und der Check schlägt an.
|
||||
|
||||
## Deployment
|
||||
|
||||
`tools/deploy_hub.sh` liest die Zugänge aus `docs/credentials.txt`
|
||||
|
|
|
|||
|
|
@ -218,18 +218,20 @@ kein Netzwerkzugriff statt.
|
|||
|
||||
## „Was ist neu“ auf der Website
|
||||
|
||||
Die Rinkplanner-Seite (`https://rinkplanner.programmschmiede.de/index.html`)
|
||||
hat seit dem 2026-11-12 einen Abschnitt **Was ist neu** mit den letzten
|
||||
Releases. Es gibt bewusst keine zweite Kopie im Repo: Die Seite liegt nur auf
|
||||
dem Webserver (siehe `AGENTS.md`). Für eine neue Version:
|
||||
Die Rinkplanner-Seite (`https://rinkplanner.programmschmiede.de/`) hat seit
|
||||
dem 2026-11-12 einen Abschnitt **Was ist neu** mit den letzten Releases. Sie
|
||||
ist zweisprachig (`/de/`, `/en/`), Quelle im Repo unter `web/` (siehe
|
||||
`docs/website.md`). Für eine neue Version:
|
||||
|
||||
1. `index.html` per FTP holen, den Block `.release-list` ergänzen (neue
|
||||
`article.release-card` oben, Badge „Aktuell“ wandert mit) und wieder
|
||||
hochladen.
|
||||
2. Download-Texte mitziehen: Datum in `.hero-meta` und `.section-lede`,
|
||||
Dateigröße in der Windows-/macOS-Karte.
|
||||
1. In `web/i18n.php` einen neuen Block `release.N.*` oben einfügen (beide
|
||||
Sprachen!), die Zähler der bestehenden Blöcke nach unten verschieben und
|
||||
das Badge „Aktuell“/„Current“ zum neuen Block wandern lassen.
|
||||
2. Download-Texte mitziehen: Datum in `hero.meta` und `downloads.lede`,
|
||||
Dateigröße in der Windows-/macOS-Karte (steht direkt in
|
||||
`web/template.php`).
|
||||
3. Stichpunkte knapp halten und nur belegen, was wirklich drin ist – die
|
||||
Formulierungen sollen zur `notes`-Zeile in `version.json` passen.
|
||||
4. `./tools/deploy_web.sh --sync` und danach `--check` laufen lassen.
|
||||
|
||||
## Checkliste für das nächste Release
|
||||
|
||||
|
|
|
|||
87
docs/website.md
Normal file
87
docs/website.md
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
# Website
|
||||
|
||||
Die Rinkplanner-Seite liegt unter <https://rinkplanner.programmschmiede.de>.
|
||||
Die Quelle steht im Repo unter `web/`, hochgeladen wird mit
|
||||
`./tools/deploy_web.sh`. Sie ist zweisprachig: Deutsch unter `/de/`, Englisch
|
||||
unter `/en/`.
|
||||
|
||||
## Aufbau
|
||||
|
||||
```
|
||||
web/
|
||||
├── index.php # Sprachweiche: leitet auf /de/ oder /en/ weiter
|
||||
├── index.html # Weiterleitung für die alte Adresse /index.html
|
||||
├── bootstrap.php # Spracherkennung, Cookie, Rendern
|
||||
├── i18n.php # alle Texte, de und en
|
||||
├── template.php # gemeinsames Markup
|
||||
├── assets/site.css # Stile
|
||||
├── de/index.php # rendert die deutsche Seite
|
||||
└── en/index.php # rendert die englische Seite
|
||||
```
|
||||
|
||||
Nicht im Repo, weil nur auf dem Server: `media/` (Hero-Video und Poster),
|
||||
`fonts/` und `version.json` (schreibt `tools/publish_version.sh`).
|
||||
|
||||
## Spracherkennung
|
||||
|
||||
Der User-Agent enthält keine Sprachinformation, deshalb entscheidet
|
||||
`Accept-Language`. Reihenfolge in `bootstrap.php`:
|
||||
|
||||
1. `?lang=de|en` – explizite Wahl, wird ein Jahr lang als Cookie `lang`
|
||||
gespeichert.
|
||||
2. Cookie `lang` – frühere Wahl über den DE/EN-Umschalter. Der Umschalter
|
||||
verlinkt auf `/index.php?lang=…`, damit die Wahl auch bei späteren
|
||||
Aufrufen von `/` gilt.
|
||||
3. `Accept-Language` mit q-Werten; nicht unterstützte Sprachen fallen auf
|
||||
Deutsch zurück.
|
||||
4. `DEFAULT_LANG` (`de`).
|
||||
|
||||
`/` antwortet mit `302` und `Vary: Accept-Language, Cookie`. Wichtig: kein
|
||||
`301`, sonst würden Browser und Proxys die Weiterleitung dauerhaft cachen und
|
||||
die Sprachwahl wäre nicht mehr änderbar.
|
||||
|
||||
## URLs und Suchmaschinen
|
||||
|
||||
- Kanonisch ist je Sprache `/de/` bzw. `/en/`, gesetzt per `rel="canonical"`.
|
||||
- `hreflang` verweist auf beide Fassungen und `x-default` auf `/`.
|
||||
- `/index.html` ist nur noch eine Weiterleitungsseite auf `/` (siehe unten).
|
||||
|
||||
## Texte ändern
|
||||
|
||||
Alle Texte stehen in `web/i18n.php` unter `'de'` und `'en'`. Beide Blöcke
|
||||
müssen dieselben Schlüssel haben; `./tools/deploy_web.sh --check` meldet
|
||||
Abweichungen. Mehrere Releases im Abschnitt „Was ist neu“ sind durchnummeriert
|
||||
(`release.0.*`, `release.1.*`, …) – das Template liest sie, bis der nächste
|
||||
Schlüssel fehlt.
|
||||
|
||||
Markup und Struktur stehen in `web/template.php`, Stile in
|
||||
`web/assets/site.css`. Beide Sprachen teilen sich beides, Abweichungen gibt es
|
||||
nur im Text.
|
||||
|
||||
## Deployment
|
||||
|
||||
```bash
|
||||
./tools/deploy_web.sh --sync # web/ per FTPS hochladen
|
||||
./tools/deploy_web.sh --check # Texte und Live-Seite prüfen
|
||||
./tools/deploy_web.sh --all # beides
|
||||
```
|
||||
|
||||
Der Docroot der Subdomain ist das FTP-Verzeichnis
|
||||
`rinkplanner.programmschmiede.de`. Zugangsdaten kommen aus
|
||||
`docs/credentials.txt`. `--check` prüft die Schlüsselparität, die
|
||||
Sprachweiche (`de-DE`, `en-US`, Fallback, q-Werte), beide Seiten, die Assets
|
||||
und ob leere Überschriften auf fehlende Textschlüssel hindeuten.
|
||||
|
||||
## Eigenheiten des Hosts
|
||||
|
||||
Geprüft am 2026-11-12:
|
||||
|
||||
- PHP 8.5.12 läuft im Docroot der Subdomain.
|
||||
- `.htaccess` wird gelesen (`AddType` wirkt), aber weder `mod_alias` noch
|
||||
`mod_rewrite` stehen zur Verfügung: `RedirectMatch` und `RewriteRule` haben
|
||||
keine Wirkung. Die Weiterleitung von `/index.html` macht deshalb die
|
||||
statische Seite `web/index.html` per `meta refresh`.
|
||||
- `DirectoryIndex index.php index.html` in `web/.htaccess` sorgt dafür, dass
|
||||
`/` die Sprachweiche ausführt und nicht die Weiterleitungsseite ausliefert.
|
||||
- Die Website nutzt absolute Pfade (`/assets/…`, `/media/…`), weil die Seiten
|
||||
eine Ebene tiefer unter `/de/` und `/en/` liegen.
|
||||
|
|
@ -90,7 +90,7 @@ function api_handle(string $method, string $path): void
|
|||
|
||||
if ($path === '/api/v1/tokens') {
|
||||
if ($method !== 'POST') {
|
||||
abort_api(405, 'method_not_allowed', 'Nur POST ist erlaubt.');
|
||||
abort_api(405, 'method_not_allowed', t('api.post_only'));
|
||||
}
|
||||
api_create_token();
|
||||
return;
|
||||
|
|
@ -100,7 +100,7 @@ function api_handle(string $method, string $path): void
|
|||
|
||||
if ($path === '/api/v1/me') {
|
||||
if ($method !== 'GET') {
|
||||
abort_api(405, 'method_not_allowed', 'Nur GET ist erlaubt.');
|
||||
abort_api(405, 'method_not_allowed', t('api.get_only'));
|
||||
}
|
||||
json_response([
|
||||
'id' => (int) $user['id'],
|
||||
|
|
@ -128,7 +128,7 @@ function api_handle(string $method, string $path): void
|
|||
if ($method === 'POST') {
|
||||
api_upload($user, null);
|
||||
}
|
||||
abort_api(405, 'method_not_allowed', 'Nur GET oder POST ist erlaubt.');
|
||||
abort_api(405, 'method_not_allowed', t('api.get_or_post'));
|
||||
}
|
||||
|
||||
if (preg_match('#^/api/v1/routines/(\d+)$#', $path, $matches) === 1) {
|
||||
|
|
@ -137,20 +137,20 @@ function api_handle(string $method, string $path): void
|
|||
}
|
||||
if (preg_match('#^/api/v1/routines/(\d+)/(download|audio)$#', $path, $matches) === 1) {
|
||||
if ($method !== 'GET') {
|
||||
abort_api(405, 'method_not_allowed', 'Nur GET ist erlaubt.');
|
||||
abort_api(405, 'method_not_allowed', t('api.get_only'));
|
||||
}
|
||||
$routine = api_fetch_visible((int) $matches[1], $user);
|
||||
routine_send_file($routine, (string) $matches[2], $user, true);
|
||||
}
|
||||
if (preg_match('#^/api/v1/routines/(\d+)/revisions$#', $path, $matches) === 1) {
|
||||
if ($method !== 'POST') {
|
||||
abort_api(405, 'method_not_allowed', 'Nur POST ist erlaubt.');
|
||||
abort_api(405, 'method_not_allowed', t('api.post_only'));
|
||||
}
|
||||
api_upload($user, (int) $matches[1]);
|
||||
return;
|
||||
}
|
||||
|
||||
abort_api(404, 'not_found', 'Unbekannter API-Pfad.');
|
||||
abort_api(404, 'not_found', t('api.unknown_path'));
|
||||
}
|
||||
|
||||
function api_create_token(): void
|
||||
|
|
@ -160,7 +160,7 @@ function api_create_token(): void
|
|||
$password = (string) ($input['password'] ?? '');
|
||||
$name = trim((string) ($input['name'] ?? 'App'));
|
||||
if ($login === '' || $password === '') {
|
||||
abort_api(422, 'invalid_credentials', 'Benutzername und Passwort sind erforderlich.');
|
||||
abort_api(422, 'invalid_credentials', t('api.credentials_required'));
|
||||
}
|
||||
$result = auth_attempt($login, $password);
|
||||
if (!$result['ok']) {
|
||||
|
|
@ -172,7 +172,7 @@ function api_create_token(): void
|
|||
}
|
||||
$user = $result['user'];
|
||||
if ((int) ($user['must_change_password'] ?? 0) === 1) {
|
||||
abort_api(403, 'password_change_required', 'Bitte zuerst im Web das Passwort ändern.');
|
||||
abort_api(403, 'password_change_required', t('api.change_password_web'));
|
||||
}
|
||||
$created = token_create((int) $user['id'], $name);
|
||||
json_response([
|
||||
|
|
@ -191,10 +191,10 @@ function api_fetch_visible(int $id, array $user): array
|
|||
{
|
||||
$routine = routine_fetch($id);
|
||||
if ($routine === null) {
|
||||
abort_api(404, 'not_found', 'Kür nicht gefunden.');
|
||||
abort_api(404, 'not_found', t('routine.not_found_short'));
|
||||
}
|
||||
if (!routine_can_view($routine, $user)) {
|
||||
abort_api(403, 'forbidden', 'Diese Kür ist nicht freigegeben.');
|
||||
abort_api(403, 'forbidden', t('routine.forbidden'));
|
||||
}
|
||||
return $routine;
|
||||
}
|
||||
|
|
@ -207,26 +207,26 @@ function api_routine(int $id, string $method, array $user): void
|
|||
}
|
||||
if ($method === 'DELETE') {
|
||||
if (!routine_can_edit($routine, $user)) {
|
||||
abort_api(403, 'forbidden', 'Nur der Eigentümer oder ein Admin darf die Kür ändern.');
|
||||
abort_api(403, 'forbidden', t('api.edit_forbidden'));
|
||||
}
|
||||
routine_set_status($id, 'hidden');
|
||||
json_response(['id' => $id, 'status' => 'hidden']);
|
||||
}
|
||||
abort_api(405, 'method_not_allowed', 'Nur GET oder DELETE ist erlaubt.');
|
||||
abort_api(405, 'method_not_allowed', t('api.get_or_delete'));
|
||||
}
|
||||
|
||||
function api_upload(array $user, ?int $routineId): void
|
||||
{
|
||||
if (!api_truthy($_POST['rights'] ?? null)) {
|
||||
abort_api(422, 'rights_required', 'Bitte bestätigen, dass Kür und Musik geteilt werden dürfen.');
|
||||
abort_api(422, 'rights_required', t('api.rights_required'));
|
||||
}
|
||||
if (!routine_upload_quota_ok((int) $user['id'])) {
|
||||
abort_api(429, 'upload_limit', 'Stündliches Upload-Limit erreicht.');
|
||||
abort_api(429, 'upload_limit', t('api.upload_limit'));
|
||||
}
|
||||
$package = routine_validate_package($_POST);
|
||||
if (!$package['ok']) {
|
||||
json_response([
|
||||
'error' => ['code' => 'validation_failed', 'message' => 'Die Dateien sind nicht gültig.'],
|
||||
'error' => ['code' => 'validation_failed', 'message' => t('api.invalid_files')],
|
||||
'errors' => $package['errors'],
|
||||
], 422);
|
||||
}
|
||||
|
|
@ -234,22 +234,22 @@ function api_upload(array $user, ?int $routineId): void
|
|||
if ($routineId === null) {
|
||||
$duplicate = routine_duplicate_exists((int) $user['id'], $package);
|
||||
if ($duplicate !== null) {
|
||||
abort_api(409, 'duplicate', 'Diese Kür ist bereits im Hub (ID ' . $duplicate . ').');
|
||||
abort_api(409, 'duplicate', t('api.duplicate', ['id' => $duplicate]));
|
||||
}
|
||||
$routineId = routine_create((int) $user['id'], $package);
|
||||
} else {
|
||||
$routine = routine_fetch($routineId);
|
||||
if ($routine === null) {
|
||||
abort_api(404, 'not_found', 'Kür nicht gefunden.');
|
||||
abort_api(404, 'not_found', t('routine.not_found_short'));
|
||||
}
|
||||
if (!routine_can_edit($routine, $user)) {
|
||||
abort_api(403, 'forbidden', 'Nur der Eigentümer oder ein Admin darf die Kür ändern.');
|
||||
abort_api(403, 'forbidden', t('api.edit_forbidden'));
|
||||
}
|
||||
routine_add_revision($routineId, (int) $user['id'], $package);
|
||||
}
|
||||
$created = routine_fetch($routineId);
|
||||
if ($created === null) {
|
||||
abort_api(500, 'server_error', 'Kür konnte nicht geladen werden.');
|
||||
abort_api(500, 'server_error', t('api.routine_load_failed'));
|
||||
}
|
||||
json_response(api_routine_payload($created), 201);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ function auth_require_admin(): array
|
|||
{
|
||||
$user = auth_require_login();
|
||||
if ($user['role'] !== 'admin') {
|
||||
abort_page(403, 'Dieser Bereich ist nur für Administratoren.');
|
||||
abort_page(403, t('auth.admin_only'));
|
||||
}
|
||||
return $user;
|
||||
}
|
||||
|
|
@ -190,7 +190,7 @@ function auth_attempt(string $login, string $password): array
|
|||
$retry = max(60, (int) $first + $window - time());
|
||||
return [
|
||||
'ok' => false,
|
||||
'error' => 'Zu viele Fehlversuche. Bitte in ' . max(1, (int) ceil($retry / 60)) . ' Minuten erneut versuchen.',
|
||||
'error' => t('login.error.rate_limited', ['minutes' => max(1, (int) ceil($retry / 60))]),
|
||||
'retry' => $retry,
|
||||
];
|
||||
}
|
||||
|
|
@ -213,10 +213,10 @@ function auth_attempt(string $login, string $password): array
|
|||
}
|
||||
|
||||
if (!$user || !$valid) {
|
||||
return ['ok' => false, 'error' => 'Benutzername oder Passwort ist falsch.', 'retry' => 0];
|
||||
return ['ok' => false, 'error' => t('login.error.credentials'), 'retry' => 0];
|
||||
}
|
||||
if ($user['status'] !== 'active') {
|
||||
return ['ok' => false, 'error' => 'Dieses Konto ist deaktiviert.', 'retry' => 0];
|
||||
return ['ok' => false, 'error' => t('login.error.disabled'), 'retry' => 0];
|
||||
}
|
||||
if (password_needs_upgrade((string) $user['password_hash'])) {
|
||||
db()->prepare('UPDATE users SET password_hash = ? WHERE id = ?')
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ date_default_timezone_set('UTC');
|
|||
ini_set('display_errors', '0');
|
||||
ini_set('log_errors', '1');
|
||||
|
||||
require HUB_APP . '/i18n.php';
|
||||
require HUB_APP . '/util.php';
|
||||
require HUB_APP . '/db.php';
|
||||
require HUB_APP . '/auth.php';
|
||||
|
|
@ -42,14 +43,16 @@ if (is_dir($storage) && is_writable($storage)) {
|
|||
set_exception_handler(static function (Throwable $error): void {
|
||||
error_log('Hub: ' . $error::class . ': ' . $error->getMessage() . ' in ' . $error->getFile() . ':' . $error->getLine());
|
||||
if (function_exists('wants_json') && wants_json()) {
|
||||
json_response(['error' => ['code' => 'server_error', 'message' => 'Interner Fehler.']], 500);
|
||||
json_response(['error' => ['code' => 'server_error', 'message' => t('api.server_error')]], 500);
|
||||
return;
|
||||
}
|
||||
http_response_code(500);
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
echo '<!doctype html><meta charset="utf-8"><title>Fehler</title>'
|
||||
$title = function_exists('t') ? t('page.title_error', ['status' => 500]) : 'Fehler 500';
|
||||
$hint = function_exists('t') ? t('api.server_error') : 'Interner Fehler.';
|
||||
echo '<!doctype html><meta charset="utf-8"><title>' . e($title) . '</title>'
|
||||
. '<body style="font-family:system-ui;background:#050d19;color:#eefaff;padding:2rem">'
|
||||
. '<h1>Interner Fehler</h1><p>Bitte später erneut versuchen.</p></body>';
|
||||
. '<h1>' . e($hint) . '</h1></body>';
|
||||
});
|
||||
|
||||
security_headers();
|
||||
|
|
|
|||
71
hub/app/i18n.php
Normal file
71
hub/app/i18n.php
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* Texte der Hub-Oberfläche (Deutsch und Englisch).
|
||||
*
|
||||
* Die Sprache kommt aus dem Cookie RHUB_LANG und wird ausschließlich über den
|
||||
* DE/EN-Umschalter gesetzt (Route /language). Standard ist Deutsch; der Hub
|
||||
* ist eine geschlossene Beta und schaltet nicht automatisch um.
|
||||
*
|
||||
* t() liefert Text mit eingesetzten Platzhaltern ({name}); die Ausgabe wird
|
||||
* an der Aufrufstelle mit e() maskiert. In den Texten steht kein HTML.
|
||||
*/
|
||||
|
||||
const HUB_LOCALES = ['de', 'en'];
|
||||
const HUB_DEFAULT_LOCALE = 'de';
|
||||
const HUB_LOCALE_COOKIE = 'RHUB_LANG';
|
||||
|
||||
function hub_locale(): string
|
||||
{
|
||||
static $locale = null;
|
||||
if ($locale !== null) {
|
||||
return $locale;
|
||||
}
|
||||
$raw = strtolower(substr((string) ($_COOKIE[HUB_LOCALE_COOKIE] ?? ''), 0, 2));
|
||||
$locale = in_array($raw, HUB_LOCALES, true) ? $raw : HUB_DEFAULT_LOCALE;
|
||||
return $locale;
|
||||
}
|
||||
|
||||
function hub_locale_set(string $locale): void
|
||||
{
|
||||
$locale = strtolower(substr($locale, 0, 2));
|
||||
if (!in_array($locale, HUB_LOCALES, true)) {
|
||||
return;
|
||||
}
|
||||
if (!headers_sent()) {
|
||||
setcookie(HUB_LOCALE_COOKIE, $locale, [
|
||||
'expires' => time() + 365 * 86400,
|
||||
'path' => '/',
|
||||
'secure' => is_https(),
|
||||
'httponly' => false,
|
||||
'samesite' => 'Lax',
|
||||
]);
|
||||
}
|
||||
$_COOKIE[HUB_LOCALE_COOKIE] = $locale;
|
||||
}
|
||||
|
||||
function hub_strings(): array
|
||||
{
|
||||
static $strings = null;
|
||||
if ($strings === null) {
|
||||
$strings = require HUB_APP . '/i18n_strings.php';
|
||||
}
|
||||
return $strings;
|
||||
}
|
||||
|
||||
/** Text in der aktuellen Sprache; unbekannte Schlüssel geben den Schlüssel zurück. */
|
||||
function t(string $key, array $args = []): string
|
||||
{
|
||||
$strings = hub_strings();
|
||||
$locale = hub_locale();
|
||||
$text = $strings[$locale][$key] ?? $strings[HUB_DEFAULT_LOCALE][$key] ?? $key;
|
||||
if ($args !== []) {
|
||||
$replace = [];
|
||||
foreach ($args as $name => $value) {
|
||||
$replace['{' . $name . '}'] = (string) $value;
|
||||
}
|
||||
$text = strtr($text, $replace);
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
664
hub/app/i18n_strings.php
Normal file
664
hub/app/i18n_strings.php
Normal file
|
|
@ -0,0 +1,664 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
/** Textkatalog des Hubs. Beide Sprachen müssen dieselben Schlüssel haben. */
|
||||
|
||||
return [
|
||||
'de' => [
|
||||
// Rahmen
|
||||
'app.name' => 'Rinkplanner-Hub',
|
||||
'nav.routines' => 'Küren',
|
||||
'nav.upload' => 'Hochladen',
|
||||
'nav.admin' => 'Verwaltung',
|
||||
'nav.logout' => 'Abmelden',
|
||||
'nav.login' => 'Anmelden',
|
||||
'nav.language' => 'Sprache',
|
||||
'footer.beta' => 'Geschlossene Beta · Rinkplanner-Hub',
|
||||
'footer.website' => 'Zur Rinkplanner-Seite',
|
||||
'flash.secret' => 'Geheimnis',
|
||||
'page.title_default' => 'Kür-Hub',
|
||||
'page.title_error' => 'Fehler {status}',
|
||||
|
||||
// Seitentitel
|
||||
'page.login' => 'Anmelden',
|
||||
'page.register' => 'Registrieren',
|
||||
'page.dashboard' => 'Küren',
|
||||
'page.upload' => 'Kür hochladen',
|
||||
'page.revision' => 'Neue Revision',
|
||||
'page.account' => 'Konto',
|
||||
'page.admin_invites' => 'Einladungen',
|
||||
'page.admin_users' => 'Benutzer',
|
||||
'page.admin_routines' => 'Alle Küren',
|
||||
'page.admin_audit' => 'Audit-Log',
|
||||
|
||||
// Anmeldung
|
||||
'login.title' => 'Anmelden',
|
||||
'login.lede' => 'Der Kür-Hub ist in einer geschlossenen Beta. Zugang gibt es per Einladungscode.',
|
||||
'login.login_label' => 'Benutzername oder E-Mail',
|
||||
'login.password' => 'Passwort',
|
||||
'login.remember' => 'Angemeldet bleiben (30 Tage)',
|
||||
'login.submit' => 'Anmelden',
|
||||
'login.no_access' => 'Noch keinen Zugang? Ein Beta-Code kommt von der Hub-Administration.',
|
||||
|
||||
// Registrierung
|
||||
'register.title' => 'Beta-Zugang einlösen',
|
||||
'register.lede' => 'Ein Einladungscode legt genau ein Konto an. Der Code verliert danach seine Gültigkeit.',
|
||||
'register.code' => 'Einladungscode',
|
||||
'register.username' => 'Benutzername',
|
||||
'register.username_hint' => '3–32 Zeichen, nur Kleinbuchstaben, Ziffern, Punkt, Bindestrich, Unterstrich.',
|
||||
'register.display_name' => 'Anzeigename',
|
||||
'register.email' => 'E-Mail (optional)',
|
||||
'register.email_bound' => 'Diese Einladung ist an {email} gebunden.',
|
||||
'register.password' => 'Passwort',
|
||||
'register.password_repeat' => 'Passwort wiederholen',
|
||||
'register.password_hint' => 'Mindestens 10 Zeichen.',
|
||||
'register.rights' => 'Ich akzeptiere die Beta-Regeln und teile keine Inhalte, an denen ich keine Rechte habe.',
|
||||
'register.submit' => 'Konto anlegen',
|
||||
'register.have_account' => 'Schon ein Konto?',
|
||||
'register.login_link' => 'Anmelden',
|
||||
|
||||
// Übersicht
|
||||
'dashboard.eyebrow' => 'Viele Schlittschuhe, ein Netz',
|
||||
'dashboard.hero_title' => 'Küren teilen, Fassungen vergleichen, gemeinsam weiterentwickeln.',
|
||||
'dashboard.hero_sub' => 'Der Hub sammelt Küren, Musik und Revisionen deines Teams an einem Ort.',
|
||||
'dashboard.title' => 'Küren',
|
||||
'dashboard.count' => '{count} {label} im Hub',
|
||||
'dashboard.one_routine' => 'Kür',
|
||||
'dashboard.many_routines' => 'Küren',
|
||||
'dashboard.mine_suffix' => ' (nur deine)',
|
||||
'dashboard.upload' => 'Kür hochladen',
|
||||
'dashboard.search_placeholder' => 'Titel, Skater, Musik, Benutzer …',
|
||||
'dashboard.search' => 'Suchen',
|
||||
'dashboard.all' => 'Alle',
|
||||
'dashboard.mine' => 'Meine Küren',
|
||||
'dashboard.empty' => 'Keine Küren gefunden.',
|
||||
'dashboard.empty_hint' => 'Suche zurücksetzen oder',
|
||||
'dashboard.empty_upload' => 'selbst eine Kür hochladen',
|
||||
'dashboard.empty_first' => 'Der Hub ist noch leer.',
|
||||
'dashboard.empty_first_action' => 'Erste Kür hochladen',
|
||||
'badge.hidden' => 'versteckt',
|
||||
|
||||
// Tabellen
|
||||
'table.title' => 'Titel',
|
||||
'table.skater' => 'Skater',
|
||||
'table.music' => 'Musik',
|
||||
'table.revision' => 'Rev.',
|
||||
'table.size' => 'Größe',
|
||||
'table.updated' => 'Aktualisiert',
|
||||
'table.by' => 'Von',
|
||||
'table.name' => 'Name',
|
||||
'table.prefix' => 'Prefix',
|
||||
'table.created' => 'Erstellt',
|
||||
'table.last_used' => 'Zuletzt',
|
||||
'table.status' => 'Status',
|
||||
'table.role' => 'Rolle',
|
||||
'table.routines' => 'Küren',
|
||||
'table.registered' => 'Registriert',
|
||||
'table.last_login' => 'Letzte Anmeldung',
|
||||
'table.actions' => 'Aktionen',
|
||||
'table.downloads' => 'Downloads',
|
||||
'table.email' => 'E-Mail',
|
||||
'table.note' => 'Notiz',
|
||||
'table.valid_until' => 'Gültig bis',
|
||||
'table.from_to' => 'Von / an',
|
||||
'table.time' => 'Zeit',
|
||||
'table.actor' => 'Akteur',
|
||||
'table.action' => 'Aktion',
|
||||
'table.subject' => 'Objekt',
|
||||
'table.detail' => 'Detail',
|
||||
'table.ip' => 'IP',
|
||||
'pagination.back' => '← Zurück',
|
||||
'pagination.next' => 'Weiter →',
|
||||
'pagination.page' => 'Seite {page} von {pages}',
|
||||
|
||||
// Kür-Detail
|
||||
'routine.breadcrumb' => 'Küren',
|
||||
'routine.breadcrumb_current' => 'Kür',
|
||||
'routine.revision' => 'Revision {revision}',
|
||||
'routine.download' => 'Kür herunterladen',
|
||||
'routine.download_audio' => 'Musik herunterladen',
|
||||
'routine.owner_bar' => 'Du kannst diese Kür verwalten.',
|
||||
'routine.new_revision' => 'Neue Revision hochladen',
|
||||
'routine.hide' => 'Aus dem Hub nehmen',
|
||||
'routine.publish' => 'Wieder veröffentlichen',
|
||||
'routine.open_admin' => 'In der Verwaltung öffnen',
|
||||
'routine.description' => 'Beschreibung',
|
||||
'routine.music' => 'Musik',
|
||||
'routine.details' => 'Details',
|
||||
'routine.category' => 'Kategorie',
|
||||
'routine.music_title' => 'Musiktitel',
|
||||
'routine.music_artist' => 'Musik',
|
||||
'routine.routine_file' => 'Kür-Datei',
|
||||
'routine.audio_file' => 'Audio-Datei',
|
||||
'routine.checksums' => 'Prüfsummen',
|
||||
'routine.checksum_hint' => 'Beim Download prüfen, ob die SHA-256-Summe zur Kür passt.',
|
||||
|
||||
// Upload
|
||||
'upload.title_new' => 'Kür hochladen',
|
||||
'upload.title_revision' => 'Neue Revision',
|
||||
'upload.revision_lede' => 'Neue Fassung von „{title}“. Die bisherige Revision bleibt erhalten.',
|
||||
'upload.lede' => 'Lade die Kür-JSON und – falls die Kür Musik nutzt – die zugehörige Audiodatei hoch. Beide gehören als Paket zusammen.',
|
||||
'upload.routine_file' => 'Kür-Datei (.json)',
|
||||
'upload.routine_hint' => 'Aus Rinkplanner gespeicherte Kür, max. {max}.',
|
||||
'upload.audio_file' => 'Musikdatei (MP3/OGG/WAV/M4A/AAC)',
|
||||
'upload.audio_hint' => 'Dateiname muss exakt dem Feld „music_file“ der Kür entsprechen.',
|
||||
'upload.description' => 'Beschreibung (optional)',
|
||||
'upload.music_title' => 'Musiktitel (optional)',
|
||||
'upload.artist' => 'Interpret (optional)',
|
||||
'upload.rights' => 'Ich habe die Rechte an Kür und Musik und darf sie im geschlossenen Beta-Hub teilen.',
|
||||
'upload.submit_new' => 'Kür veröffentlichen',
|
||||
'upload.submit_revision' => 'Revision veröffentlichen',
|
||||
'upload.cancel' => 'Abbrechen',
|
||||
|
||||
// Konto
|
||||
'account.title' => 'Konto',
|
||||
'account.role_admin' => 'Administrator',
|
||||
'account.role_user' => 'Beta-Nutzer',
|
||||
'account.must_change' => 'Bitte ein neues Passwort setzen, bevor du den Hub weiter nutzt.',
|
||||
'account.change_password' => 'Passwort ändern',
|
||||
'account.current_password' => 'Aktuelles Passwort',
|
||||
'account.new_password' => 'Neues Passwort',
|
||||
'account.repeat_password' => 'Neues Passwort wiederholen',
|
||||
'account.password_hint' => 'Mindestens 10 Zeichen.',
|
||||
'account.save_password' => 'Passwort speichern',
|
||||
'account.tokens' => 'API-Tokens',
|
||||
'account.tokens_lede' => 'Für die Godot-App. Ein Token ersetzt Benutzername und Passwort im Client und lässt sich jederzeit widerrufen.',
|
||||
'account.token_placeholder' => 'Name, z. B. Büro-PC',
|
||||
'account.token_create' => 'Token erzeugen',
|
||||
'account.token_active' => 'aktiv',
|
||||
'account.token_revoked' => 'widerrufen',
|
||||
'account.token_revoke' => 'widerrufen',
|
||||
'account.no_tokens' => 'Noch kein Token erzeugt.',
|
||||
|
||||
// Verwaltung
|
||||
'admin.title' => 'Verwaltung',
|
||||
'admin.tab_invites' => 'Einladungen',
|
||||
'admin.tab_users' => 'Benutzer',
|
||||
'admin.tab_routines' => 'Küren',
|
||||
'admin.tab_audit' => 'Audit-Log',
|
||||
'admin.audit_lede' => 'Die letzten {count} Ereignisse.',
|
||||
'admin.audit_empty' => 'Noch keine Einträge.',
|
||||
'admin_invites.lede' => 'Einladungen für die geschlossene Beta.',
|
||||
'admin_invites.new' => 'Neue Einladung',
|
||||
'admin_invites.new_lede' => 'Der Code wird nach dem Anlegen genau einmal angezeigt. Er gilt für ein Konto.',
|
||||
'admin_invites.note' => 'Notiz (intern)',
|
||||
'admin_invites.note_placeholder' => 'z. B. Verein Nord',
|
||||
'admin_invites.email' => 'E-Mail binden (optional)',
|
||||
'admin_invites.email_hint' => 'Nur diese Adresse kann den Code nutzen.',
|
||||
'admin_invites.days' => 'Gültig (Tage)',
|
||||
'admin_invites.days_hint' => '0 = unbegrenzt.',
|
||||
'admin_invites.create' => 'Einladung erzeugen',
|
||||
'admin_invites.list' => 'Einladungen',
|
||||
'admin_invites.empty' => 'Noch keine Einladungen.',
|
||||
'admin_invites.revoke' => 'widerrufen',
|
||||
'admin_users.lede' => 'Beta-Konten verwalten.',
|
||||
'admin_users.self' => 'eigenes Konto',
|
||||
'admin_users.block' => 'sperren',
|
||||
'admin_users.unblock' => 'entsperren',
|
||||
'admin_users.reset' => 'Passwort zurücksetzen',
|
||||
'admin_users.delete' => 'löschen',
|
||||
'admin_users.delete_confirm' => 'mit allen Küren löschen',
|
||||
'admin_users.delete_submit' => 'Löschen bestätigen',
|
||||
'admin_users.role_admin' => 'Admin',
|
||||
'admin_users.role_user' => 'Nutzer',
|
||||
'status.active' => 'aktiv',
|
||||
'status.blocked' => 'gesperrt',
|
||||
'admin_routines.lede' => '{total} Küren insgesamt, auch versteckte.',
|
||||
'admin_routines.search_placeholder' => 'Titel, Skater, Benutzer …',
|
||||
'admin_routines.empty' => 'Keine Küren gefunden.',
|
||||
'admin_routines.hide' => 'verstecken',
|
||||
'admin_routines.publish' => 'veröffentlichen',
|
||||
'admin_routines.delete' => 'löschen',
|
||||
'admin_routines.delete_confirm' => 'endgültig löschen',
|
||||
'admin_routines.delete_submit' => 'Löschen bestätigen',
|
||||
|
||||
// Status einer Einladung
|
||||
'invite.status.open' => 'offen',
|
||||
'invite.status.used' => 'eingelöst',
|
||||
'invite.status.expired' => 'abgelaufen',
|
||||
'invite.status.revoked' => 'widerrufen',
|
||||
|
||||
// Fehlerseite
|
||||
'error.label' => 'Fehler {status}',
|
||||
'error.back' => 'Zurück zur',
|
||||
'error.back_link' => 'Küren-Übersicht',
|
||||
|
||||
// Meldungen
|
||||
'auth.admin_only' => 'Dieser Bereich ist nur für Administratoren.',
|
||||
'auth.change_password_first' => 'Bitte zuerst das Passwort ändern.',
|
||||
'auth.logged_out' => 'Abgemeldet.',
|
||||
'auth.welcome' => 'Willkommen im Kür-Hub!',
|
||||
'auth.session_expired' => 'Die Sitzung ist abgelaufen. Bitte die Seite neu laden.',
|
||||
'page.method_not_allowed' => 'Diese Methode ist nicht erlaubt.',
|
||||
'page.not_found' => 'Diese Seite gibt es nicht.',
|
||||
'username.length' => 'Der Benutzername muss 3 bis 32 Zeichen lang sein.',
|
||||
'username.charset' => 'Nur Kleinbuchstaben, Ziffern, Punkt, Bindestrich und Unterstrich; Anfang und Ende alphanumerisch.',
|
||||
'username.reserved' => 'Dieser Benutzername ist reserviert.',
|
||||
'register.invalid_invite' => 'Dieser Einladungscode ist ungültig, abgelaufen oder bereits eingelöst.',
|
||||
'register.display_name_long' => 'Der Anzeigename darf höchstens 64 Zeichen lang sein.',
|
||||
'register.email_invalid' => 'Die E-Mail-Adresse ist nicht gültig.',
|
||||
'register.email_mismatch' => 'Diese Einladung ist an eine andere E-Mail-Adresse gebunden.',
|
||||
'register.password_mismatch' => 'Die Passwortwiederholung passt nicht.',
|
||||
'register.rights_required' => 'Bitte die Beta-Regeln akzeptieren.',
|
||||
'register.invite_taken' => 'Der Einladungscode wurde gerade eingelöst. Bitte einen neuen Code anfordern.',
|
||||
'register.username_taken' => 'Dieser Benutzername ist schon vergeben.',
|
||||
'register.email_taken' => 'Diese E-Mail-Adresse ist schon registriert.',
|
||||
'routine.not_found' => 'Diese Kür gibt es nicht.',
|
||||
'routine.forbidden' => 'Diese Kür ist nicht freigegeben.',
|
||||
'routine.edit_forbidden' => 'Nur der Eigentümer oder ein Admin kann diese Kür ändern.',
|
||||
'upload.quota' => 'Stündliches Upload-Limit erreicht. Bitte später erneut versuchen.',
|
||||
'upload.rights_confirm' => 'Bitte bestätigen, dass du Kür und Musik teilen darfst.',
|
||||
'upload.duplicate' => 'Diese Kür ist bereits im Hub.',
|
||||
'upload.published' => 'Kür veröffentlicht.',
|
||||
'upload.save_failed' => 'Die Kür konnte nicht gespeichert werden.',
|
||||
'revision.saved' => 'Neue Revision {revision} gespeichert.',
|
||||
'revision.save_failed' => 'Die Revision konnte nicht gespeichert werden.',
|
||||
'routine.published_again' => 'Kür ist wieder sichtbar.',
|
||||
'routine.hidden_now' => 'Kür wurde aus dem Hub genommen.',
|
||||
'account.current_wrong' => 'Das aktuelle Passwort ist falsch.',
|
||||
'account.password_changed' => 'Passwort geändert. Andere Sitzungen wurden abgemeldet.',
|
||||
'token.created' => 'Neuer API-Token – jetzt kopieren, er wird nicht erneut angezeigt',
|
||||
'token.revoked' => 'Token widerrufen.',
|
||||
'token.not_found' => 'Token nicht gefunden.',
|
||||
'invite.created' => 'Einladung erstellt.',
|
||||
'invite.created_label' => 'Einladungscode',
|
||||
'invite.revoked' => 'Einladung widerrufen.',
|
||||
'invite.revoke_failed' => 'Einladung konnte nicht widerrufen werden.',
|
||||
'user.not_found' => 'Benutzer nicht gefunden.',
|
||||
'user.self_change' => 'Das eigene Konto lässt sich hier nicht ändern.',
|
||||
'user.disabled' => 'Benutzer deaktiviert.',
|
||||
'user.enabled' => 'Benutzer aktiviert.',
|
||||
'user.temp_password' => 'Temporäres Passwort für {user}',
|
||||
'user.must_change' => 'Der Benutzer muss das Passwort bei der nächsten Anmeldung ändern.',
|
||||
'user.delete_confirm_required' => 'Löschen muss bestätigt werden.',
|
||||
'user.deleted' => 'Benutzer und zugehörige Küren gelöscht.',
|
||||
'action.unknown' => 'Unbekannte Aktion.',
|
||||
'routine.not_found_short' => 'Kür nicht gefunden.',
|
||||
'admin.status_changed' => 'Status geändert.',
|
||||
'routine.deleted' => 'Kür endgültig gelöscht.',
|
||||
|
||||
// Anmeldung und Passwortregeln
|
||||
'login.error.rate_limited' => 'Zu viele Fehlversuche. Bitte in {minutes} Minuten erneut versuchen.',
|
||||
'login.error.credentials' => 'Benutzername oder Passwort ist falsch.',
|
||||
'login.error.disabled' => 'Dieses Konto ist deaktiviert.',
|
||||
'password.min' => 'Das Passwort muss mindestens 10 Zeichen lang sein.',
|
||||
'password.max' => 'Das Passwort darf höchstens 200 Zeichen lang sein.',
|
||||
'password.same_as_username' => 'Das Passwort darf nicht dem Benutzernamen entsprechen.',
|
||||
|
||||
// Upload-Prüfung
|
||||
'upload.select_routine' => 'Bitte eine Kür-Datei (.json) auswählen.',
|
||||
'upload.invalid' => 'Ungültiger Upload.',
|
||||
'upload.routine_too_large' => 'Die Kür-Datei ist zu groß (max. {max}).',
|
||||
'upload.routine_not_json' => 'Kürdateien müssen im JSON-Format vorliegen (.json).',
|
||||
'upload.read_failed' => 'Die Kür-Datei konnte nicht gelesen werden.',
|
||||
'upload.invalid_json' => 'Die Kür-Datei ist kein gültiges JSON.',
|
||||
'upload.no_json_object' => 'Die Kür-Datei enthält kein JSON-Objekt.',
|
||||
'upload.not_rinkplanner' => 'Das ist keine Rinkplanner-Kür (format fehlt oder ist falsch).',
|
||||
'upload.unsupported_version' => 'Diese Kür-Formatversion wird nicht unterstützt.',
|
||||
'upload.no_sections' => 'Die Kür enthält keine Abschnittsliste.',
|
||||
'upload.too_many_sections' => 'Die Kür hat zu viele Abschnitte (max. 500).',
|
||||
'upload.title_required' => 'Die Kür braucht einen Titel.',
|
||||
'upload.bad_music_name' => 'Die Kür verweist auf einen ungültigen Musikdateinamen.',
|
||||
'upload.music_missing' => 'Die Kür verweist auf „{name}“. Bitte die passende Audiodatei mit hochladen.',
|
||||
'upload.music_unexpected' => 'Die Kür verweist auf keine Musikdatei; die Audiodatei passt nicht dazu.',
|
||||
'upload.audio_invalid' => 'Ungültiger Audio-Upload.',
|
||||
'upload.audio_too_large' => 'Die Audiodatei ist zu groß (max. {max}).',
|
||||
'upload.audio_name_mismatch' => 'Die Audiodatei heißt „{actual}“, die Kür verweist aber auf „{expected}“.',
|
||||
'upload.audio_format' => 'Die Audiodatei ist kein unterstütztes Format (MP3, OGG, WAV, M4A, AAC).',
|
||||
'upload.file_too_large' => 'Die Datei ist zu groß.',
|
||||
'upload.interrupted' => 'Der Upload wurde unterbrochen.',
|
||||
'upload.no_file_chosen' => 'Es wurde keine Datei ausgewählt.',
|
||||
'upload.store_failed' => 'Die Datei konnte nicht gespeichert werden.',
|
||||
'upload.unknown_error' => 'Unbekannter Upload-Fehler.',
|
||||
'routine.no_file_yet' => 'Diese Kür hat noch keine Datei.',
|
||||
'routine.file_missing' => 'Die Datei fehlt im Speicher.',
|
||||
'routine.file_unreadable' => 'Die Datei konnte nicht geöffnet werden.',
|
||||
|
||||
// API
|
||||
'api.post_only' => 'Nur POST ist erlaubt.',
|
||||
'api.get_only' => 'Nur GET ist erlaubt.',
|
||||
'api.get_or_post' => 'Nur GET oder POST ist erlaubt.',
|
||||
'api.get_or_delete' => 'Nur GET oder DELETE ist erlaubt.',
|
||||
'api.unknown_path' => 'Unbekannter API-Pfad.',
|
||||
'api.bearer_missing' => 'Bearer-Token fehlt.',
|
||||
'api.token_invalid' => 'Token ist ungültig, abgelaufen oder widerrufen.',
|
||||
'api.credentials_required' => 'Benutzername und Passwort sind erforderlich.',
|
||||
'api.change_password_web' => 'Bitte zuerst im Web das Passwort ändern.',
|
||||
'api.edit_forbidden' => 'Nur der Eigentümer oder ein Admin darf die Kür ändern.',
|
||||
'api.rights_required' => 'Bitte bestätigen, dass Kür und Musik geteilt werden dürfen.',
|
||||
'api.upload_limit' => 'Stündliches Upload-Limit erreicht.',
|
||||
'api.invalid_files' => 'Die Dateien sind nicht gültig.',
|
||||
'api.duplicate' => 'Diese Kür ist bereits im Hub (ID {id}).',
|
||||
'api.server_error' => 'Interner Fehler.',
|
||||
'api.routine_load_failed' => 'Kür konnte nicht geladen werden.',
|
||||
],
|
||||
|
||||
'en' => [
|
||||
// Frame
|
||||
'app.name' => 'Rinkplanner Hub',
|
||||
'nav.routines' => 'Programmes',
|
||||
'nav.upload' => 'Upload',
|
||||
'nav.admin' => 'Administration',
|
||||
'nav.logout' => 'Sign out',
|
||||
'nav.login' => 'Sign in',
|
||||
'nav.language' => 'Language',
|
||||
'footer.beta' => 'Closed beta · Rinkplanner Hub',
|
||||
'footer.website' => 'To the Rinkplanner website',
|
||||
'flash.secret' => 'Secret',
|
||||
'page.title_default' => 'Programme hub',
|
||||
'page.title_error' => 'Error {status}',
|
||||
|
||||
// Page titles
|
||||
'page.login' => 'Sign in',
|
||||
'page.register' => 'Register',
|
||||
'page.dashboard' => 'Programmes',
|
||||
'page.upload' => 'Upload programme',
|
||||
'page.revision' => 'New revision',
|
||||
'page.account' => 'Account',
|
||||
'page.admin_invites' => 'Invitations',
|
||||
'page.admin_users' => 'Users',
|
||||
'page.admin_routines' => 'All programmes',
|
||||
'page.admin_audit' => 'Audit log',
|
||||
|
||||
// Sign in
|
||||
'login.title' => 'Sign in',
|
||||
'login.lede' => 'The programme hub is in a closed beta. Access is granted by invitation code.',
|
||||
'login.login_label' => 'Username or email',
|
||||
'login.password' => 'Password',
|
||||
'login.remember' => 'Stay signed in (30 days)',
|
||||
'login.submit' => 'Sign in',
|
||||
'login.no_access' => 'No access yet? A beta code comes from the hub administration.',
|
||||
|
||||
// Registration
|
||||
'register.title' => 'Redeem beta access',
|
||||
'register.lede' => 'An invitation code creates exactly one account. The code expires once it has been used.',
|
||||
'register.code' => 'Invitation code',
|
||||
'register.username' => 'Username',
|
||||
'register.username_hint' => '3–32 characters, lowercase letters, digits, dot, hyphen and underscore only.',
|
||||
'register.display_name' => 'Display name',
|
||||
'register.email' => 'Email (optional)',
|
||||
'register.email_bound' => 'This invitation is bound to {email}.',
|
||||
'register.password' => 'Password',
|
||||
'register.password_repeat' => 'Repeat password',
|
||||
'register.password_hint' => 'At least 10 characters.',
|
||||
'register.rights' => 'I accept the beta rules and will not share content I have no rights to.',
|
||||
'register.submit' => 'Create account',
|
||||
'register.have_account' => 'Already have an account?',
|
||||
'register.login_link' => 'Sign in',
|
||||
|
||||
// Overview
|
||||
'dashboard.eyebrow' => 'Many skates, one net',
|
||||
'dashboard.hero_title' => 'Share programmes, compare versions, develop them together.',
|
||||
'dashboard.hero_sub' => 'The hub collects your team’s programmes, music and revisions in one place.',
|
||||
'dashboard.title' => 'Programmes',
|
||||
'dashboard.count' => '{count} {label} in the hub',
|
||||
'dashboard.one_routine' => 'programme',
|
||||
'dashboard.many_routines' => 'programmes',
|
||||
'dashboard.mine_suffix' => ' (yours only)',
|
||||
'dashboard.upload' => 'Upload programme',
|
||||
'dashboard.search_placeholder' => 'Title, skater, music, user …',
|
||||
'dashboard.search' => 'Search',
|
||||
'dashboard.all' => 'All',
|
||||
'dashboard.mine' => 'My programmes',
|
||||
'dashboard.empty' => 'No programmes found.',
|
||||
'dashboard.empty_hint' => 'Clear the search or',
|
||||
'dashboard.empty_upload' => 'upload a programme yourself',
|
||||
'dashboard.empty_first' => 'The hub is still empty.',
|
||||
'dashboard.empty_first_action' => 'Upload the first programme',
|
||||
'badge.hidden' => 'hidden',
|
||||
|
||||
// Tables
|
||||
'table.title' => 'Title',
|
||||
'table.skater' => 'Skater',
|
||||
'table.music' => 'Music',
|
||||
'table.revision' => 'Rev.',
|
||||
'table.size' => 'Size',
|
||||
'table.updated' => 'Updated',
|
||||
'table.by' => 'By',
|
||||
'table.name' => 'Name',
|
||||
'table.prefix' => 'Prefix',
|
||||
'table.created' => 'Created',
|
||||
'table.last_used' => 'Last used',
|
||||
'table.status' => 'Status',
|
||||
'table.role' => 'Role',
|
||||
'table.routines' => 'Programmes',
|
||||
'table.registered' => 'Registered',
|
||||
'table.last_login' => 'Last sign-in',
|
||||
'table.actions' => 'Actions',
|
||||
'table.downloads' => 'Downloads',
|
||||
'table.email' => 'Email',
|
||||
'table.note' => 'Note',
|
||||
'table.valid_until' => 'Valid until',
|
||||
'table.from_to' => 'From / to',
|
||||
'table.time' => 'Time',
|
||||
'table.actor' => 'Actor',
|
||||
'table.action' => 'Action',
|
||||
'table.subject' => 'Subject',
|
||||
'table.detail' => 'Detail',
|
||||
'table.ip' => 'IP',
|
||||
'pagination.back' => '← Back',
|
||||
'pagination.next' => 'Next →',
|
||||
'pagination.page' => 'Page {page} of {pages}',
|
||||
|
||||
// Programme detail
|
||||
'routine.breadcrumb' => 'Programmes',
|
||||
'routine.breadcrumb_current' => 'Programme',
|
||||
'routine.revision' => 'Revision {revision}',
|
||||
'routine.download' => 'Download programme',
|
||||
'routine.download_audio' => 'Download music',
|
||||
'routine.owner_bar' => 'You can manage this programme.',
|
||||
'routine.new_revision' => 'Upload new revision',
|
||||
'routine.hide' => 'Remove from the hub',
|
||||
'routine.publish' => 'Publish again',
|
||||
'routine.open_admin' => 'Open in administration',
|
||||
'routine.description' => 'Description',
|
||||
'routine.music' => 'Music',
|
||||
'routine.details' => 'Details',
|
||||
'routine.category' => 'Category',
|
||||
'routine.music_title' => 'Music title',
|
||||
'routine.music_artist' => 'Artist',
|
||||
'routine.routine_file' => 'Programme file',
|
||||
'routine.audio_file' => 'Audio file',
|
||||
'routine.checksums' => 'Checksums',
|
||||
'routine.checksum_hint' => 'When downloading, check that the SHA-256 checksum matches the programme.',
|
||||
|
||||
// Upload
|
||||
'upload.title_new' => 'Upload programme',
|
||||
'upload.title_revision' => 'New revision',
|
||||
'upload.revision_lede' => 'New version of “{title}”. The previous revision is kept.',
|
||||
'upload.lede' => 'Upload the programme JSON and, if the programme uses music, the matching audio file. They belong together as a package.',
|
||||
'upload.routine_file' => 'Programme file (.json)',
|
||||
'upload.routine_hint' => 'A programme saved from Rinkplanner, max. {max}.',
|
||||
'upload.audio_file' => 'Music file (MP3/OGG/WAV/M4A/AAC)',
|
||||
'upload.audio_hint' => 'The filename must match the “music_file” field of the programme exactly.',
|
||||
'upload.description' => 'Description (optional)',
|
||||
'upload.music_title' => 'Music title (optional)',
|
||||
'upload.artist' => 'Artist (optional)',
|
||||
'upload.rights' => 'I hold the rights to the programme and the music and may share them in the closed beta hub.',
|
||||
'upload.submit_new' => 'Publish programme',
|
||||
'upload.submit_revision' => 'Publish revision',
|
||||
'upload.cancel' => 'Cancel',
|
||||
|
||||
// Account
|
||||
'account.title' => 'Account',
|
||||
'account.role_admin' => 'Administrator',
|
||||
'account.role_user' => 'Beta user',
|
||||
'account.must_change' => 'Please set a new password before using the hub further.',
|
||||
'account.change_password' => 'Change password',
|
||||
'account.current_password' => 'Current password',
|
||||
'account.new_password' => 'New password',
|
||||
'account.repeat_password' => 'Repeat new password',
|
||||
'account.password_hint' => 'At least 10 characters.',
|
||||
'account.save_password' => 'Save password',
|
||||
'account.tokens' => 'API tokens',
|
||||
'account.tokens_lede' => 'For the Godot app. A token replaces username and password in the client and can be revoked at any time.',
|
||||
'account.token_placeholder' => 'Name, e.g. office PC',
|
||||
'account.token_create' => 'Create token',
|
||||
'account.token_active' => 'active',
|
||||
'account.token_revoked' => 'revoked',
|
||||
'account.token_revoke' => 'revoke',
|
||||
'account.no_tokens' => 'No token created yet.',
|
||||
|
||||
// Administration
|
||||
'admin.title' => 'Administration',
|
||||
'admin.tab_invites' => 'Invitations',
|
||||
'admin.tab_users' => 'Users',
|
||||
'admin.tab_routines' => 'Programmes',
|
||||
'admin.tab_audit' => 'Audit log',
|
||||
'admin.audit_lede' => 'The last {count} events.',
|
||||
'admin.audit_empty' => 'No entries yet.',
|
||||
'admin_invites.lede' => 'Invitations for the closed beta.',
|
||||
'admin_invites.new' => 'New invitation',
|
||||
'admin_invites.new_lede' => 'The code is shown exactly once after it is created. It is valid for one account.',
|
||||
'admin_invites.note' => 'Note (internal)',
|
||||
'admin_invites.note_placeholder' => 'e.g. Club North',
|
||||
'admin_invites.email' => 'Bind email (optional)',
|
||||
'admin_invites.email_hint' => 'Only this address can use the code.',
|
||||
'admin_invites.days' => 'Valid (days)',
|
||||
'admin_invites.days_hint' => '0 = unlimited.',
|
||||
'admin_invites.create' => 'Create invitation',
|
||||
'admin_invites.list' => 'Invitations',
|
||||
'admin_invites.empty' => 'No invitations yet.',
|
||||
'admin_invites.revoke' => 'revoke',
|
||||
'admin_users.lede' => 'Manage beta accounts.',
|
||||
'admin_users.self' => 'own account',
|
||||
'admin_users.block' => 'block',
|
||||
'admin_users.unblock' => 'unblock',
|
||||
'admin_users.reset' => 'Reset password',
|
||||
'admin_users.delete' => 'delete',
|
||||
'admin_users.delete_confirm' => 'delete including all programmes',
|
||||
'admin_users.delete_submit' => 'Confirm deletion',
|
||||
'admin_users.role_admin' => 'Admin',
|
||||
'admin_users.role_user' => 'User',
|
||||
'status.active' => 'active',
|
||||
'status.blocked' => 'blocked',
|
||||
'admin_routines.lede' => '{total} programmes in total, including hidden ones.',
|
||||
'admin_routines.search_placeholder' => 'Title, skater, user …',
|
||||
'admin_routines.empty' => 'No programmes found.',
|
||||
'admin_routines.hide' => 'hide',
|
||||
'admin_routines.publish' => 'publish',
|
||||
'admin_routines.delete' => 'delete',
|
||||
'admin_routines.delete_confirm' => 'delete permanently',
|
||||
'admin_routines.delete_submit' => 'Confirm deletion',
|
||||
|
||||
// Invitation status
|
||||
'invite.status.open' => 'open',
|
||||
'invite.status.used' => 'redeemed',
|
||||
'invite.status.expired' => 'expired',
|
||||
'invite.status.revoked' => 'revoked',
|
||||
|
||||
// Error page
|
||||
'error.label' => 'Error {status}',
|
||||
'error.back' => 'Back to the',
|
||||
'error.back_link' => 'programme overview',
|
||||
|
||||
// Messages
|
||||
'auth.admin_only' => 'This area is for administrators only.',
|
||||
'auth.change_password_first' => 'Please change your password first.',
|
||||
'auth.logged_out' => 'Signed out.',
|
||||
'auth.welcome' => 'Welcome to the programme hub!',
|
||||
'auth.session_expired' => 'The session has expired. Please reload the page.',
|
||||
'page.method_not_allowed' => 'This method is not allowed.',
|
||||
'page.not_found' => 'This page does not exist.',
|
||||
'username.length' => 'The username must be 3 to 32 characters long.',
|
||||
'username.charset' => 'Lowercase letters, digits, dot, hyphen and underscore only; begin and end with a letter or digit.',
|
||||
'username.reserved' => 'This username is reserved.',
|
||||
'register.invalid_invite' => 'This invitation code is invalid, expired or already redeemed.',
|
||||
'register.display_name_long' => 'The display name may be at most 64 characters long.',
|
||||
'register.email_invalid' => 'The email address is not valid.',
|
||||
'register.email_mismatch' => 'This invitation is bound to a different email address.',
|
||||
'register.password_mismatch' => 'The passwords do not match.',
|
||||
'register.rights_required' => 'Please accept the beta rules.',
|
||||
'register.invite_taken' => 'The invitation code was just redeemed. Please request a new one.',
|
||||
'register.username_taken' => 'This username is already taken.',
|
||||
'register.email_taken' => 'This email address is already registered.',
|
||||
'routine.not_found' => 'This programme does not exist.',
|
||||
'routine.forbidden' => 'This programme is not shared with you.',
|
||||
'routine.edit_forbidden' => 'Only the owner or an admin can change this programme.',
|
||||
'upload.quota' => 'Hourly upload limit reached. Please try again later.',
|
||||
'upload.rights_confirm' => 'Please confirm that you may share the programme and its music.',
|
||||
'upload.duplicate' => 'This programme is already in the hub.',
|
||||
'upload.published' => 'Programme published.',
|
||||
'upload.save_failed' => 'The programme could not be saved.',
|
||||
'revision.saved' => 'New revision {revision} saved.',
|
||||
'revision.save_failed' => 'The revision could not be saved.',
|
||||
'routine.published_again' => 'The programme is visible again.',
|
||||
'routine.hidden_now' => 'The programme was removed from the hub.',
|
||||
'account.current_wrong' => 'The current password is wrong.',
|
||||
'account.password_changed' => 'Password changed. Other sessions were signed out.',
|
||||
'token.created' => 'New API token – copy it now, it will not be shown again',
|
||||
'token.revoked' => 'Token revoked.',
|
||||
'token.not_found' => 'Token not found.',
|
||||
'invite.created' => 'Invitation created.',
|
||||
'invite.created_label' => 'Invitation code',
|
||||
'invite.revoked' => 'Invitation revoked.',
|
||||
'invite.revoke_failed' => 'The invitation could not be revoked.',
|
||||
'user.not_found' => 'User not found.',
|
||||
'user.self_change' => 'Your own account cannot be changed here.',
|
||||
'user.disabled' => 'User disabled.',
|
||||
'user.enabled' => 'User enabled.',
|
||||
'user.temp_password' => 'Temporary password for {user}',
|
||||
'user.must_change' => 'The user must change the password at the next sign-in.',
|
||||
'user.delete_confirm_required' => 'Deletion must be confirmed.',
|
||||
'user.deleted' => 'User and their programmes deleted.',
|
||||
'action.unknown' => 'Unknown action.',
|
||||
'routine.not_found_short' => 'Programme not found.',
|
||||
'admin.status_changed' => 'Status changed.',
|
||||
'routine.deleted' => 'Programme permanently deleted.',
|
||||
|
||||
// Sign-in and password rules
|
||||
'login.error.rate_limited' => 'Too many failed attempts. Please try again in {minutes} minutes.',
|
||||
'login.error.credentials' => 'Username or password is incorrect.',
|
||||
'login.error.disabled' => 'This account is disabled.',
|
||||
'password.min' => 'The password must be at least 10 characters long.',
|
||||
'password.max' => 'The password may be at most 200 characters long.',
|
||||
'password.same_as_username' => 'The password must not be the same as the username.',
|
||||
|
||||
// Upload validation
|
||||
'upload.select_routine' => 'Please choose a programme file (.json).',
|
||||
'upload.invalid' => 'Invalid upload.',
|
||||
'upload.routine_too_large' => 'The programme file is too large (max. {max}).',
|
||||
'upload.routine_not_json' => 'Programme files must be in JSON format (.json).',
|
||||
'upload.read_failed' => 'The programme file could not be read.',
|
||||
'upload.invalid_json' => 'The programme file is not valid JSON.',
|
||||
'upload.no_json_object' => 'The programme file does not contain a JSON object.',
|
||||
'upload.not_rinkplanner' => 'This is not a Rinkplanner programme (missing or wrong format).',
|
||||
'upload.unsupported_version' => 'This programme format version is not supported.',
|
||||
'upload.no_sections' => 'The programme has no section list.',
|
||||
'upload.too_many_sections' => 'The programme has too many sections (max. 500).',
|
||||
'upload.title_required' => 'The programme needs a title.',
|
||||
'upload.bad_music_name' => 'The programme refers to an invalid music filename.',
|
||||
'upload.music_missing' => 'The programme refers to “{name}”. Please upload the matching audio file as well.',
|
||||
'upload.music_unexpected' => 'The programme refers to no music file; the audio file does not match.',
|
||||
'upload.audio_invalid' => 'Invalid audio upload.',
|
||||
'upload.audio_too_large' => 'The audio file is too large (max. {max}).',
|
||||
'upload.audio_name_mismatch' => 'The audio file is named “{actual}”, but the programme refers to “{expected}”.',
|
||||
'upload.audio_format' => 'The audio file is not a supported format (MP3, OGG, WAV, M4A, AAC).',
|
||||
'upload.file_too_large' => 'The file is too large.',
|
||||
'upload.interrupted' => 'The upload was interrupted.',
|
||||
'upload.no_file_chosen' => 'No file was selected.',
|
||||
'upload.store_failed' => 'The file could not be stored.',
|
||||
'upload.unknown_error' => 'Unknown upload error.',
|
||||
'routine.no_file_yet' => 'This programme has no file yet.',
|
||||
'routine.file_missing' => 'The file is missing from storage.',
|
||||
'routine.file_unreadable' => 'The file could not be opened.',
|
||||
|
||||
// API
|
||||
'api.post_only' => 'Only POST is allowed.',
|
||||
'api.get_only' => 'Only GET is allowed.',
|
||||
'api.get_or_post' => 'Only GET or POST is allowed.',
|
||||
'api.get_or_delete' => 'Only GET or DELETE is allowed.',
|
||||
'api.unknown_path' => 'Unknown API path.',
|
||||
'api.bearer_missing' => 'Bearer token missing.',
|
||||
'api.token_invalid' => 'Token is invalid, expired or revoked.',
|
||||
'api.credentials_required' => 'Username and password are required.',
|
||||
'api.change_password_web' => 'Please change your password in the web interface first.',
|
||||
'api.edit_forbidden' => 'Only the owner or an admin may change the programme.',
|
||||
'api.rights_required' => 'Please confirm that the programme and its music may be shared.',
|
||||
'api.upload_limit' => 'Hourly upload limit reached.',
|
||||
'api.invalid_files' => 'The files are not valid.',
|
||||
'api.duplicate' => 'This programme is already in the hub (ID {id}).',
|
||||
'api.server_error' => 'Internal error.',
|
||||
'api.routine_load_failed' => 'The programme could not be loaded.',
|
||||
],
|
||||
];
|
||||
|
|
@ -106,13 +106,13 @@ function invites_list(): array
|
|||
function invite_status(array $invite): string
|
||||
{
|
||||
if ($invite['revoked_at'] !== null) {
|
||||
return 'widerrufen';
|
||||
return 'revoked';
|
||||
}
|
||||
if ($invite['used_at'] !== null) {
|
||||
return 'eingelöst';
|
||||
return 'used';
|
||||
}
|
||||
if ($invite['expires_at'] !== null && $invite['expires_at'] <= utc_now()) {
|
||||
return 'abgelaufen';
|
||||
return 'expired';
|
||||
}
|
||||
return 'offen';
|
||||
return 'open';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ function page_handle(string $method, string $path): void
|
|||
{
|
||||
$path = '/' . trim($path, '/');
|
||||
if (!in_array($method, ['GET', 'POST'], true)) {
|
||||
abort_page(405, 'Diese Methode ist nicht erlaubt.');
|
||||
abort_page(405, t('page.method_not_allowed'));
|
||||
}
|
||||
|
||||
if ($path === '/health') {
|
||||
|
|
@ -20,11 +20,20 @@ function page_handle(string $method, string $path): void
|
|||
return;
|
||||
}
|
||||
|
||||
// Sprachwahl über den DE/EN-Umschalter; muss auch ohne Anmeldung gehen.
|
||||
if ($path === '/language') {
|
||||
$lang = strtolower(substr(query_string('lang'), 0, 2));
|
||||
if (in_array($lang, HUB_LOCALES, true)) {
|
||||
hub_locale_set($lang);
|
||||
}
|
||||
redirect(auth_next_url('/'));
|
||||
}
|
||||
|
||||
$user = auth_user();
|
||||
if ($user !== null && $user['must_change_password'] === 1
|
||||
&& !in_array($path, ['/account', '/account/password', '/logout'], true)
|
||||
&& !in_array($path, ['/account', '/account/password', '/logout', '/language'], true)
|
||||
) {
|
||||
flash('info', 'Bitte zuerst das Passwort ändern.');
|
||||
flash('info', t('auth.change_password_first'));
|
||||
redirect('/account');
|
||||
}
|
||||
|
||||
|
|
@ -41,7 +50,7 @@ function page_handle(string $method, string $path): void
|
|||
redirect('/');
|
||||
}
|
||||
auth_logout();
|
||||
flash('success', 'Abgemeldet.');
|
||||
flash('success', t('auth.logged_out'));
|
||||
redirect('/login');
|
||||
}
|
||||
if ($path === '/') {
|
||||
|
|
@ -94,7 +103,7 @@ function page_handle(string $method, string $path): void
|
|||
}
|
||||
if ($path === '/admin/audit') {
|
||||
require_admin_page();
|
||||
render_page('admin_audit', ['entries' => audit_list(200)], 'Audit-Log');
|
||||
render_page('admin_audit', ['entries' => audit_list(200)], t('page.admin_audit'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -115,7 +124,7 @@ function page_handle(string $method, string $path): void
|
|||
return;
|
||||
}
|
||||
|
||||
abort_page(404, 'Diese Seite gibt es nicht.');
|
||||
abort_page(404, t('page.not_found'));
|
||||
}
|
||||
|
||||
function health_check(): void
|
||||
|
|
@ -163,19 +172,19 @@ function page_login(string $method): void
|
|||
'error' => $error,
|
||||
'login' => $login,
|
||||
'next' => $next,
|
||||
], 'Anmelden');
|
||||
], t('page.login'));
|
||||
}
|
||||
|
||||
function username_error(string $username): ?string
|
||||
{
|
||||
if (mb_strlen($username, 'UTF-8') < 3 || mb_strlen($username, 'UTF-8') > 32) {
|
||||
return 'Der Benutzername muss 3 bis 32 Zeichen lang sein.';
|
||||
return t('username.length');
|
||||
}
|
||||
if (preg_match('/^[a-z0-9](?:[a-z0-9._-]{1,30}[a-z0-9])$/u', $username) !== 1) {
|
||||
return 'Nur Kleinbuchstaben, Ziffern, Punkt, Bindestrich und Unterstrich; Anfang und Ende alphanumerisch.';
|
||||
return t('username.charset');
|
||||
}
|
||||
if (in_array($username, HUB_RESERVED_USERNAMES, true)) {
|
||||
return 'Dieser Benutzername ist reserviert.';
|
||||
return t('username.reserved');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
@ -209,7 +218,7 @@ function page_register(string $method): void
|
|||
$input['email'] = post_string('email');
|
||||
|
||||
if ($invite === null) {
|
||||
$errors[] = 'Dieser Einladungscode ist ungültig, abgelaufen oder bereits eingelöst.';
|
||||
$errors[] = t('register.invalid_invite');
|
||||
} elseif (!empty($invite['email']) && $input['email'] === '') {
|
||||
$input['email'] = (string) $invite['email'];
|
||||
}
|
||||
|
|
@ -221,15 +230,15 @@ function page_register(string $method): void
|
|||
$input['display_name'] = $input['username'];
|
||||
}
|
||||
if (mb_strlen($input['display_name'], 'UTF-8') > 64) {
|
||||
$errors[] = 'Der Anzeigename darf höchstens 64 Zeichen lang sein.';
|
||||
$errors[] = t('register.display_name_long');
|
||||
}
|
||||
if ($input['email'] !== '' && filter_var($input['email'], FILTER_VALIDATE_EMAIL) === false) {
|
||||
$errors[] = 'Die E-Mail-Adresse ist nicht gültig.';
|
||||
$errors[] = t('register.email_invalid');
|
||||
}
|
||||
if ($invite !== null && !empty($invite['email'])
|
||||
&& strcasecmp((string) $invite['email'], $input['email']) !== 0
|
||||
) {
|
||||
$errors[] = 'Diese Einladung ist an eine andere E-Mail-Adresse gebunden.';
|
||||
$errors[] = t('register.email_mismatch');
|
||||
}
|
||||
$password = (string) ($_POST['password'] ?? '');
|
||||
$repeat = (string) ($_POST['password_repeat'] ?? '');
|
||||
|
|
@ -238,10 +247,10 @@ function page_register(string $method): void
|
|||
$errors[] = $policy;
|
||||
}
|
||||
if ($password !== $repeat) {
|
||||
$errors[] = 'Die Passwortwiederholung passt nicht.';
|
||||
$errors[] = t('register.password_mismatch');
|
||||
}
|
||||
if (($_POST['rights'] ?? '') !== '1') {
|
||||
$errors[] = 'Bitte die Beta-Regeln akzeptieren.';
|
||||
$errors[] = t('register.rights_required');
|
||||
}
|
||||
|
||||
if (!$errors && $invite !== null) {
|
||||
|
|
@ -268,7 +277,7 @@ function page_register(string $method): void
|
|||
$newId = (int) $pdo->lastInsertId();
|
||||
if (!invite_consume((int) $invite['id'], $newId)) {
|
||||
$pdo->rollBack();
|
||||
$errors[] = 'Der Einladungscode wurde gerade eingelöst. Bitte einen neuen Code anfordern.';
|
||||
$errors[] = t('register.invite_taken');
|
||||
} else {
|
||||
audit('invite.use', 'invite', (int) $invite['id'], $input['username'], $newId);
|
||||
audit('user.register', 'user', $newId, $input['username'], $newId);
|
||||
|
|
@ -279,9 +288,9 @@ function page_register(string $method): void
|
|||
$pdo->rollBack();
|
||||
}
|
||||
if (str_contains($exception->getMessage(), 'uq_users_username')) {
|
||||
$errors[] = 'Dieser Benutzername ist schon vergeben.';
|
||||
$errors[] = t('register.username_taken');
|
||||
} elseif (str_contains($exception->getMessage(), 'uq_users_email')) {
|
||||
$errors[] = 'Diese E-Mail-Adresse ist schon registriert.';
|
||||
$errors[] = t('register.email_taken');
|
||||
} else {
|
||||
throw $exception;
|
||||
}
|
||||
|
|
@ -291,7 +300,7 @@ function page_register(string $method): void
|
|||
$user = auth_user_by_id($newId);
|
||||
if ($user !== null) {
|
||||
auth_login($user);
|
||||
flash('success', 'Willkommen im Kür-Hub!');
|
||||
flash('success', t('auth.welcome'));
|
||||
redirect('/');
|
||||
}
|
||||
}
|
||||
|
|
@ -303,7 +312,7 @@ function page_register(string $method): void
|
|||
'code' => $code,
|
||||
'errors' => $errors,
|
||||
'input' => $input,
|
||||
], 'Registrieren');
|
||||
], t('page.register'));
|
||||
}
|
||||
|
||||
function page_dashboard(string $method): void
|
||||
|
|
@ -320,7 +329,7 @@ function page_dashboard(string $method): void
|
|||
'pages' => $result['pages'],
|
||||
'query' => $query,
|
||||
'mine' => $mine,
|
||||
], 'Küren');
|
||||
], t('page.dashboard'));
|
||||
}
|
||||
|
||||
function page_routine_detail(int $id, string $method): void
|
||||
|
|
@ -328,10 +337,10 @@ function page_routine_detail(int $id, string $method): void
|
|||
$user = auth_require_login();
|
||||
$routine = routine_fetch($id);
|
||||
if ($routine === null) {
|
||||
abort_page(404, 'Diese Kür gibt es nicht.');
|
||||
abort_page(404, t('routine.not_found'));
|
||||
}
|
||||
if (!routine_can_view($routine, $user)) {
|
||||
abort_page(403, 'Diese Kür ist nicht freigegeben.');
|
||||
abort_page(403, t('routine.forbidden'));
|
||||
}
|
||||
render_page('routine', [
|
||||
'routine' => $routine,
|
||||
|
|
@ -345,10 +354,10 @@ function page_routine_file(int $id, string $kind): void
|
|||
$user = auth_require_login();
|
||||
$routine = routine_fetch($id);
|
||||
if ($routine === null) {
|
||||
abort_page(404, 'Diese Kür gibt es nicht.');
|
||||
abort_page(404, t('routine.not_found'));
|
||||
}
|
||||
if (!routine_can_view($routine, $user)) {
|
||||
abort_page(403, 'Diese Kür ist nicht freigegeben.');
|
||||
abort_page(403, t('routine.forbidden'));
|
||||
}
|
||||
routine_send_file($routine, $kind);
|
||||
}
|
||||
|
|
@ -366,10 +375,10 @@ function page_upload(string $method): void
|
|||
if ($method === 'POST') {
|
||||
csrf_require();
|
||||
if (!routine_upload_quota_ok((int) $user['id'])) {
|
||||
$errors[] = 'Stündliches Upload-Limit erreicht. Bitte später erneut versuchen.';
|
||||
$errors[] = t('upload.quota');
|
||||
}
|
||||
if (($_POST['rights'] ?? '') !== '1') {
|
||||
$errors[] = 'Bitte bestätigen, dass du Kür und Musik teilen darfst.';
|
||||
$errors[] = t('upload.rights_confirm');
|
||||
}
|
||||
if (!$errors) {
|
||||
$package = routine_validate_package($_POST);
|
||||
|
|
@ -378,16 +387,16 @@ function page_upload(string $method): void
|
|||
} else {
|
||||
$duplicate = routine_duplicate_exists((int) $user['id'], $package);
|
||||
if ($duplicate !== null) {
|
||||
flash('info', 'Diese Kür ist bereits im Hub.');
|
||||
flash('info', t('upload.duplicate'));
|
||||
redirect('/routines/' . $duplicate);
|
||||
}
|
||||
try {
|
||||
$routineId = routine_create((int) $user['id'], $package);
|
||||
flash('success', 'Kür veröffentlicht.');
|
||||
flash('success', t('upload.published'));
|
||||
redirect('/routines/' . $routineId);
|
||||
} catch (Throwable $error) {
|
||||
hub_log('Upload fehlgeschlagen: ' . $error->getMessage());
|
||||
$errors[] = 'Die Kür konnte nicht gespeichert werden.';
|
||||
$errors[] = t('upload.save_failed');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -400,7 +409,7 @@ function page_upload(string $method): void
|
|||
'errors' => $errors,
|
||||
'input' => $input,
|
||||
'routine' => null,
|
||||
], 'Kür hochladen');
|
||||
], t('page.upload'));
|
||||
}
|
||||
|
||||
function page_routine_revise(int $id, string $method): void
|
||||
|
|
@ -408,10 +417,10 @@ function page_routine_revise(int $id, string $method): void
|
|||
$user = auth_require_login();
|
||||
$routine = routine_fetch($id);
|
||||
if ($routine === null) {
|
||||
abort_page(404, 'Diese Kür gibt es nicht.');
|
||||
abort_page(404, t('routine.not_found'));
|
||||
}
|
||||
if (!routine_can_edit($routine, $user)) {
|
||||
abort_page(403, 'Nur der Eigentümer oder ein Admin kann diese Kür ändern.');
|
||||
abort_page(403, t('routine.edit_forbidden'));
|
||||
}
|
||||
$errors = [];
|
||||
$input = [
|
||||
|
|
@ -423,10 +432,10 @@ function page_routine_revise(int $id, string $method): void
|
|||
if ($method === 'POST') {
|
||||
csrf_require();
|
||||
if (!routine_upload_quota_ok((int) $user['id'])) {
|
||||
$errors[] = 'Stündliches Upload-Limit erreicht. Bitte später erneut versuchen.';
|
||||
$errors[] = t('upload.quota');
|
||||
}
|
||||
if (($_POST['rights'] ?? '') !== '1') {
|
||||
$errors[] = 'Bitte bestätigen, dass du Kür und Musik teilen darfst.';
|
||||
$errors[] = t('upload.rights_confirm');
|
||||
}
|
||||
if (!$errors) {
|
||||
$package = routine_validate_package($_POST);
|
||||
|
|
@ -435,11 +444,11 @@ function page_routine_revise(int $id, string $method): void
|
|||
} else {
|
||||
try {
|
||||
$revision = routine_add_revision($id, (int) $user['id'], $package);
|
||||
flash('success', 'Neue Revision ' . $revision . ' gespeichert.');
|
||||
flash('success', t('revision.saved', ['revision' => $revision]));
|
||||
redirect('/routines/' . $id);
|
||||
} catch (Throwable $error) {
|
||||
hub_log('Revision fehlgeschlagen: ' . $error->getMessage());
|
||||
$errors[] = 'Die Revision konnte nicht gespeichert werden.';
|
||||
$errors[] = t('revision.save_failed');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -452,7 +461,7 @@ function page_routine_revise(int $id, string $method): void
|
|||
'errors' => $errors,
|
||||
'input' => $input,
|
||||
'routine' => $routine,
|
||||
], 'Neue Revision');
|
||||
], t('page.revision'));
|
||||
}
|
||||
|
||||
function page_routine_status(int $id, string $action, string $method): void
|
||||
|
|
@ -464,14 +473,14 @@ function page_routine_status(int $id, string $action, string $method): void
|
|||
csrf_require();
|
||||
$routine = routine_fetch($id);
|
||||
if ($routine === null) {
|
||||
abort_page(404, 'Diese Kür gibt es nicht.');
|
||||
abort_page(404, t('routine.not_found'));
|
||||
}
|
||||
if (!routine_can_edit($routine, $user)) {
|
||||
abort_page(403, 'Nur der Eigentümer oder ein Admin kann diese Kür ändern.');
|
||||
abort_page(403, t('routine.edit_forbidden'));
|
||||
}
|
||||
$status = $action === 'publish' ? 'published' : 'hidden';
|
||||
routine_set_status($id, $status);
|
||||
flash('success', $status === 'published' ? 'Kür ist wieder sichtbar.' : 'Kür wurde aus dem Hub genommen.');
|
||||
flash('success', $status === 'published' ? t('routine.published_again') : t('routine.hidden_now'));
|
||||
redirect('/routines/' . $id);
|
||||
}
|
||||
|
||||
|
|
@ -480,7 +489,7 @@ function page_account(string $method): void
|
|||
$user = auth_require_login();
|
||||
render_page('account', [
|
||||
'tokens' => tokens_list((int) $user['id']),
|
||||
], 'Konto');
|
||||
], t('page.account'));
|
||||
}
|
||||
|
||||
function page_account_password(string $method): void
|
||||
|
|
@ -496,14 +505,14 @@ function page_account_password(string $method): void
|
|||
$errors = [];
|
||||
|
||||
if (!password_verify($current, (string) $user['password_hash'])) {
|
||||
$errors[] = 'Das aktuelle Passwort ist falsch.';
|
||||
$errors[] = t('account.current_wrong');
|
||||
}
|
||||
$policy = password_policy_error($password, (string) $user['username']);
|
||||
if ($policy !== null) {
|
||||
$errors[] = $policy;
|
||||
}
|
||||
if ($password !== $repeat) {
|
||||
$errors[] = 'Die Passwortwiederholung passt nicht.';
|
||||
$errors[] = t('register.password_mismatch');
|
||||
}
|
||||
if ($errors) {
|
||||
foreach ($errors as $error) {
|
||||
|
|
@ -517,7 +526,7 @@ function page_account_password(string $method): void
|
|||
)->execute([hash_password($password), utc_now(), (int) $user['id']]);
|
||||
auth_revoke_sessions((int) $user['id']);
|
||||
audit('user.password_change', 'user', (int) $user['id']);
|
||||
flash('success', 'Passwort geändert. Andere Sitzungen wurden abgemeldet.');
|
||||
flash('success', t('account.password_changed'));
|
||||
redirect('/account');
|
||||
}
|
||||
|
||||
|
|
@ -533,7 +542,7 @@ function page_account_token_create(string $method): void
|
|||
$name = 'App';
|
||||
}
|
||||
$created = token_create((int) $user['id'], $name);
|
||||
flash_secret('Neuer API-Token – jetzt kopieren, er wird nicht erneut angezeigt', $created['token']);
|
||||
flash_secret(t('token.created'), $created['token']);
|
||||
redirect('/account');
|
||||
}
|
||||
|
||||
|
|
@ -547,9 +556,9 @@ function page_account_token_revoke(string $method): void
|
|||
$tokenId = (int) post_string('token_id');
|
||||
if (token_revoke($tokenId, (int) $user['id'])) {
|
||||
audit('token.revoke', 'token', $tokenId);
|
||||
flash('success', 'Token widerrufen.');
|
||||
flash('success', t('token.revoked'));
|
||||
} else {
|
||||
flash('error', 'Token nicht gefunden.');
|
||||
flash('error', t('token.not_found'));
|
||||
}
|
||||
redirect('/account');
|
||||
}
|
||||
|
|
@ -564,7 +573,7 @@ function page_admin_invites(string $method): void
|
|||
$days = (int) post_string('expires_days', '30');
|
||||
$errors = [];
|
||||
if ($email !== '' && filter_var($email, FILTER_VALIDATE_EMAIL) === false) {
|
||||
$errors[] = 'Die E-Mail-Adresse ist nicht gültig.';
|
||||
$errors[] = t('register.email_invalid');
|
||||
}
|
||||
if ($errors) {
|
||||
foreach ($errors as $error) {
|
||||
|
|
@ -574,14 +583,14 @@ function page_admin_invites(string $method): void
|
|||
$code = invite_create($note, $email, $days, (int) $admin['id']);
|
||||
$publicUrl = rtrim((string) config('app.public_url', ''), '/');
|
||||
$link = $publicUrl . '/register?code=' . rawurlencode($code);
|
||||
flash_secret('Einladungscode', $code . ' – Link: ' . $link);
|
||||
flash('success', 'Einladung erstellt.');
|
||||
flash_secret(t('invite.created_label'), $code . ' – Link: ' . $link);
|
||||
flash('success', t('invite.created'));
|
||||
}
|
||||
redirect('/admin/invites');
|
||||
}
|
||||
render_page('admin_invites', [
|
||||
'invites' => invites_list(),
|
||||
], 'Einladungen');
|
||||
], t('page.admin_invites'));
|
||||
}
|
||||
|
||||
function page_admin_invite_revoke(string $method): void
|
||||
|
|
@ -594,9 +603,9 @@ function page_admin_invite_revoke(string $method): void
|
|||
$inviteId = (int) post_string('invite_id');
|
||||
if (invite_revoke($inviteId)) {
|
||||
audit('invite.revoke', 'invite', $inviteId);
|
||||
flash('success', 'Einladung widerrufen.');
|
||||
flash('success', t('invite.revoked'));
|
||||
} else {
|
||||
flash('error', 'Einladung konnte nicht widerrufen werden.');
|
||||
flash('error', t('invite.revoke_failed'));
|
||||
}
|
||||
redirect('/admin/invites');
|
||||
}
|
||||
|
|
@ -608,7 +617,7 @@ function page_admin_users(string $method): void
|
|||
'SELECT u.*, (SELECT COUNT(*) FROM routines r WHERE r.owner_id = u.id) AS routine_count
|
||||
FROM users u ORDER BY u.created_at DESC, u.id DESC'
|
||||
)->fetchAll();
|
||||
render_page('admin_users', ['users' => $users], 'Benutzer');
|
||||
render_page('admin_users', ['users' => $users], t('page.admin_users'));
|
||||
}
|
||||
|
||||
function page_admin_user_action(string $method): void
|
||||
|
|
@ -622,11 +631,11 @@ function page_admin_user_action(string $method): void
|
|||
$action = post_string('action');
|
||||
$target = auth_user_by_id($targetId);
|
||||
if ($target === null) {
|
||||
flash('error', 'Benutzer nicht gefunden.');
|
||||
flash('error', t('user.not_found'));
|
||||
redirect('/admin/users');
|
||||
}
|
||||
if ($targetId === (int) $admin['id']) {
|
||||
flash('error', 'Das eigene Konto lässt sich hier nicht ändern.');
|
||||
flash('error', t('user.self_change'));
|
||||
redirect('/admin/users');
|
||||
}
|
||||
|
||||
|
|
@ -634,11 +643,11 @@ function page_admin_user_action(string $method): void
|
|||
db()->prepare("UPDATE users SET status = 'disabled' WHERE id = ?")->execute([$targetId]);
|
||||
auth_revoke_sessions($targetId);
|
||||
audit('user.disable', 'user', $targetId, (string) $target['username']);
|
||||
flash('success', 'Benutzer deaktiviert.');
|
||||
flash('success', t('user.disabled'));
|
||||
} elseif ($action === 'enable') {
|
||||
db()->prepare("UPDATE users SET status = 'active' WHERE id = ?")->execute([$targetId]);
|
||||
audit('user.enable', 'user', $targetId, (string) $target['username']);
|
||||
flash('success', 'Benutzer aktiviert.');
|
||||
flash('success', t('user.enabled'));
|
||||
} elseif ($action === 'reset') {
|
||||
$alphabet = HUB_INVITE_ALPHABET;
|
||||
$temp = '';
|
||||
|
|
@ -650,11 +659,11 @@ function page_admin_user_action(string $method): void
|
|||
)->execute([hash_password($temp), utc_now(), $targetId]);
|
||||
auth_revoke_sessions($targetId);
|
||||
audit('user.password_reset', 'user', $targetId, (string) $target['username']);
|
||||
flash_secret('Temporäres Passwort für ' . $target['username'], $temp);
|
||||
flash('info', 'Der Benutzer muss das Passwort bei der nächsten Anmeldung ändern.');
|
||||
flash_secret(t('user.temp_password', ['user' => $target['username']]), $temp);
|
||||
flash('info', t('user.must_change'));
|
||||
} elseif ($action === 'delete') {
|
||||
if (($_POST['confirm'] ?? '') !== '1') {
|
||||
flash('error', 'Löschen muss bestätigt werden.');
|
||||
flash('error', t('user.delete_confirm_required'));
|
||||
redirect('/admin/users');
|
||||
}
|
||||
$stmt = db()->prepare('SELECT id FROM routines WHERE owner_id = ?');
|
||||
|
|
@ -666,9 +675,9 @@ function page_admin_user_action(string $method): void
|
|||
->execute([utc_now(), $targetId]);
|
||||
audit('user.delete', 'user', $targetId, (string) $target['username']);
|
||||
db()->prepare('DELETE FROM users WHERE id = ?')->execute([$targetId]);
|
||||
flash('success', 'Benutzer und zugehörige Küren gelöscht.');
|
||||
flash('success', t('user.deleted'));
|
||||
} else {
|
||||
flash('error', 'Unbekannte Aktion.');
|
||||
flash('error', t('action.unknown'));
|
||||
}
|
||||
redirect('/admin/users');
|
||||
}
|
||||
|
|
@ -685,7 +694,7 @@ function page_admin_routines(string $method): void
|
|||
'page' => $result['page'],
|
||||
'pages' => $result['pages'],
|
||||
'query' => $query,
|
||||
], 'Alle Küren');
|
||||
], t('page.admin_routines'));
|
||||
}
|
||||
|
||||
function page_admin_routine_action(string $method): void
|
||||
|
|
@ -699,21 +708,21 @@ function page_admin_routine_action(string $method): void
|
|||
$action = post_string('action');
|
||||
$routine = routine_fetch($routineId);
|
||||
if ($routine === null) {
|
||||
flash('error', 'Kür nicht gefunden.');
|
||||
flash('error', t('routine.not_found_short'));
|
||||
redirect('/admin/routines');
|
||||
}
|
||||
if ($action === 'hide' || $action === 'publish') {
|
||||
routine_set_status($routineId, $action === 'publish' ? 'published' : 'hidden');
|
||||
flash('success', 'Status geändert.');
|
||||
flash('success', t('admin.status_changed'));
|
||||
} elseif ($action === 'delete') {
|
||||
if (($_POST['confirm'] ?? '') !== '1') {
|
||||
flash('error', 'Löschen muss bestätigt werden.');
|
||||
flash('error', t('user.delete_confirm_required'));
|
||||
redirect('/admin/routines');
|
||||
}
|
||||
routine_delete($routineId);
|
||||
flash('success', 'Kür endgültig gelöscht.');
|
||||
flash('success', t('routine.deleted'));
|
||||
} else {
|
||||
flash('error', 'Unbekannte Aktion.');
|
||||
flash('error', t('action.unknown'));
|
||||
}
|
||||
redirect('/admin/routines');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,11 +47,11 @@ function routine_music_name_valid(string $name): bool
|
|||
function upload_error_message(int $code): string
|
||||
{
|
||||
return match ($code) {
|
||||
UPLOAD_ERR_INI_SIZE, UPLOAD_ERR_FORM_SIZE => 'Die Datei ist zu groß.',
|
||||
UPLOAD_ERR_PARTIAL => 'Der Upload wurde unterbrochen.',
|
||||
UPLOAD_ERR_NO_FILE => 'Es wurde keine Datei ausgewählt.',
|
||||
UPLOAD_ERR_NO_TMP_DIR, UPLOAD_ERR_CANT_WRITE, UPLOAD_ERR_EXTENSION => 'Die Datei konnte nicht gespeichert werden.',
|
||||
default => 'Unbekannter Upload-Fehler.',
|
||||
UPLOAD_ERR_INI_SIZE, UPLOAD_ERR_FORM_SIZE => t('upload.file_too_large'),
|
||||
UPLOAD_ERR_PARTIAL => t('upload.interrupted'),
|
||||
UPLOAD_ERR_NO_FILE => t('upload.no_file_chosen'),
|
||||
UPLOAD_ERR_NO_TMP_DIR, UPLOAD_ERR_CANT_WRITE, UPLOAD_ERR_EXTENSION => t('upload.store_failed'),
|
||||
default => t('upload.unknown_error'),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -112,20 +112,20 @@ function routine_validate_package(array $post): array
|
|||
|
||||
$routineFile = $_FILES['routine'] ?? null;
|
||||
if (!is_array($routineFile) || ($routineFile['error'] ?? UPLOAD_ERR_NO_FILE) !== UPLOAD_ERR_OK) {
|
||||
$errors[] = 'Bitte eine Kür-Datei (.json) auswählen.';
|
||||
$errors[] = t('upload.select_routine');
|
||||
return ['ok' => false, 'errors' => $errors];
|
||||
}
|
||||
$routineTmp = (string) $routineFile['tmp_name'];
|
||||
$routineBytes = (int) $routineFile['size'];
|
||||
if (!is_uploaded_file($routineTmp)) {
|
||||
return ['ok' => false, 'errors' => ['Ungültiger Upload.']];
|
||||
return ['ok' => false, 'errors' => [t('upload.invalid')]];
|
||||
}
|
||||
if ($routineBytes <= 0 || $routineBytes > $maxRoutine) {
|
||||
$errors[] = 'Die Kür-Datei ist zu groß (max. ' . human_bytes($maxRoutine) . ').';
|
||||
$errors[] = t('upload.routine_too_large', ['max' => human_bytes($maxRoutine)]);
|
||||
}
|
||||
$routineName = clean_filename((string) ($routineFile['name'] ?? 'kuer.json'));
|
||||
if (!str_ends_with(strtolower($routineName), '.json')) {
|
||||
$errors[] = 'Kürdateien müssen im JSON-Format vorliegen (.json).';
|
||||
$errors[] = t('upload.routine_not_json');
|
||||
}
|
||||
if ($errors) {
|
||||
return ['ok' => false, 'errors' => $errors];
|
||||
|
|
@ -133,28 +133,28 @@ function routine_validate_package(array $post): array
|
|||
|
||||
$contents = file_get_contents($routineTmp);
|
||||
if (!is_string($contents)) {
|
||||
return ['ok' => false, 'errors' => ['Die Kür-Datei konnte nicht gelesen werden.']];
|
||||
return ['ok' => false, 'errors' => [t('upload.read_failed')]];
|
||||
}
|
||||
try {
|
||||
$json = json_decode($contents, true, 64, JSON_THROW_ON_ERROR);
|
||||
} catch (JsonException) {
|
||||
return ['ok' => false, 'errors' => ['Die Kür-Datei ist kein gültiges JSON.']];
|
||||
return ['ok' => false, 'errors' => [t('upload.invalid_json')]];
|
||||
}
|
||||
if (!is_array($json)) {
|
||||
return ['ok' => false, 'errors' => ['Die Kür-Datei enthält kein JSON-Objekt.']];
|
||||
return ['ok' => false, 'errors' => [t('upload.no_json_object')]];
|
||||
}
|
||||
if (($json['format'] ?? '') !== 'rinkplanner.routine') {
|
||||
return ['ok' => false, 'errors' => ['Das ist keine Rinkplanner-Kür (format fehlt oder ist falsch).']];
|
||||
return ['ok' => false, 'errors' => [t('upload.not_rinkplanner')]];
|
||||
}
|
||||
$formatVersion = (int) ($json['format_version'] ?? 0);
|
||||
if ($formatVersion !== 1) {
|
||||
return ['ok' => false, 'errors' => ['Diese Kür-Formatversion wird nicht unterstützt.']];
|
||||
return ['ok' => false, 'errors' => [t('upload.unsupported_version')]];
|
||||
}
|
||||
if (!is_array($json['sections'] ?? null)) {
|
||||
return ['ok' => false, 'errors' => ['Die Kür enthält keine Abschnittsliste.']];
|
||||
return ['ok' => false, 'errors' => [t('upload.no_sections')]];
|
||||
}
|
||||
if (count($json['sections']) > 500) {
|
||||
return ['ok' => false, 'errors' => ['Die Kür hat zu viele Abschnitte (max. 500).']];
|
||||
return ['ok' => false, 'errors' => [t('upload.too_many_sections')]];
|
||||
}
|
||||
|
||||
$title = trim((string) ($json['title'] ?? ''));
|
||||
|
|
@ -162,14 +162,14 @@ function routine_validate_package(array $post): array
|
|||
$title = (string) pathinfo($routineName, PATHINFO_FILENAME);
|
||||
}
|
||||
if ($title === '') {
|
||||
return ['ok' => false, 'errors' => ['Die Kür braucht einen Titel.']];
|
||||
return ['ok' => false, 'errors' => [t('upload.title_required')]];
|
||||
}
|
||||
$title = truncate_text($title, 190);
|
||||
$skater = truncate_text(trim((string) ($json['skater_name'] ?? '')), 190);
|
||||
$category = truncate_text(trim((string) ($json['adult_category'] ?? '')), 40);
|
||||
$musicFile = trim((string) ($json['music_file'] ?? ''));
|
||||
if ($musicFile !== '' && !routine_music_name_valid($musicFile)) {
|
||||
return ['ok' => false, 'errors' => ['Die Kür verweist auf einen ungültigen Musikdateinamen.']];
|
||||
return ['ok' => false, 'errors' => [t('upload.bad_music_name')]];
|
||||
}
|
||||
$fileRoutineId = trim((string) ($json['routine_id'] ?? ''));
|
||||
|
||||
|
|
@ -177,10 +177,10 @@ function routine_validate_package(array $post): array
|
|||
$audioFile = $_FILES['audio'] ?? null;
|
||||
$hasAudioUpload = is_array($audioFile) && ($audioFile['error'] ?? UPLOAD_ERR_NO_FILE) !== UPLOAD_ERR_NO_FILE;
|
||||
if ($musicFile !== '' && !$hasAudioUpload) {
|
||||
$errors[] = 'Die Kür verweist auf „' . $musicFile . '“. Bitte die passende Audiodatei mit hochladen.';
|
||||
$errors[] = t('upload.music_missing', ['name' => $musicFile]);
|
||||
}
|
||||
if ($musicFile === '' && $hasAudioUpload) {
|
||||
$errors[] = 'Die Kür verweist auf keine Musikdatei; die Audiodatei passt nicht dazu.';
|
||||
$errors[] = t('upload.music_unexpected');
|
||||
}
|
||||
if ($hasAudioUpload) {
|
||||
if (($audioFile['error'] ?? UPLOAD_ERR_NO_FILE) !== UPLOAD_ERR_OK) {
|
||||
|
|
@ -190,15 +190,15 @@ function routine_validate_package(array $post): array
|
|||
$audioBytes = (int) $audioFile['size'];
|
||||
$audioName = clean_filename((string) ($audioFile['name'] ?? ''));
|
||||
if (!is_uploaded_file($audioTmp)) {
|
||||
$errors[] = 'Ungültiger Audio-Upload.';
|
||||
$errors[] = t('upload.audio_invalid');
|
||||
} elseif ($audioBytes <= 0 || $audioBytes > $maxAudio) {
|
||||
$errors[] = 'Die Audiodatei ist zu groß (max. ' . human_bytes($maxAudio) . ').';
|
||||
$errors[] = t('upload.audio_too_large', ['max' => human_bytes($maxAudio)]);
|
||||
} elseif ($audioName !== $musicFile) {
|
||||
$errors[] = 'Die Audiodatei heißt „' . $audioName . '“, die Kür verweist aber auf „' . $musicFile . '“.';
|
||||
$errors[] = t('upload.audio_name_mismatch', ['actual' => $audioName, 'expected' => $musicFile]);
|
||||
} else {
|
||||
$sniffed = audio_sniff($audioTmp);
|
||||
if ($sniffed === null) {
|
||||
$errors[] = 'Die Audiodatei ist kein unterstütztes Format (MP3, OGG, WAV, M4A, AAC).';
|
||||
$errors[] = t('upload.audio_format');
|
||||
} else {
|
||||
$audio = [
|
||||
'tmp' => $audioTmp,
|
||||
|
|
@ -542,9 +542,9 @@ function routine_send_file(array $routine, string $kind, ?array $user = null, bo
|
|||
$revision = routine_fetch((int) $routine['id']);
|
||||
if ($revision === null || $revision['revision_id'] === null) {
|
||||
if ($api) {
|
||||
abort_api(404, 'no_file', 'Diese Kür hat noch keine Datei.');
|
||||
abort_api(404, 'no_file', t('routine.no_file_yet'));
|
||||
}
|
||||
abort_page(404, 'Diese Kür hat noch keine Datei.');
|
||||
abort_page(404, t('routine.no_file_yet'));
|
||||
}
|
||||
if ($kind === 'audio') {
|
||||
$path = (string) ($revision['audio_path'] ?? '');
|
||||
|
|
@ -558,16 +558,16 @@ function routine_send_file(array $routine, string $kind, ?array $user = null, bo
|
|||
$absolute = storage_path($path);
|
||||
if ($path === '' || !is_file($absolute)) {
|
||||
if ($api) {
|
||||
abort_api(404, 'file_missing', 'Die Datei fehlt im Speicher.');
|
||||
abort_api(404, 'file_missing', t('routine.file_missing'));
|
||||
}
|
||||
abort_page(404, 'Die Datei fehlt im Speicher.');
|
||||
abort_page(404, t('routine.file_missing'));
|
||||
}
|
||||
$handle = fopen($absolute, 'rb');
|
||||
if ($handle === false) {
|
||||
if ($api) {
|
||||
abort_api(500, 'file_unreadable', 'Die Datei konnte nicht geöffnet werden.');
|
||||
abort_api(500, 'file_unreadable', t('routine.file_unreadable'));
|
||||
}
|
||||
abort_page(500, 'Die Datei konnte nicht geöffnet werden.');
|
||||
abort_page(500, t('routine.file_unreadable'));
|
||||
}
|
||||
|
||||
$user ??= auth_user();
|
||||
|
|
|
|||
|
|
@ -99,14 +99,14 @@ function api_require_user(): array
|
|||
{
|
||||
$token = bearer_token();
|
||||
if ($token === '') {
|
||||
abort_api(401, 'unauthorized', 'Bearer-Token fehlt.');
|
||||
abort_api(401, 'unauthorized', t('api.bearer_missing'));
|
||||
}
|
||||
$user = token_user($token);
|
||||
if ($user === null) {
|
||||
abort_api(401, 'invalid_token', 'Token ist ungültig, abgelaufen oder widerrufen.');
|
||||
abort_api(401, 'invalid_token', t('api.token_invalid'));
|
||||
}
|
||||
if ($user['must_change_password'] === 1) {
|
||||
abort_api(403, 'password_change_required', 'Bitte zuerst im Web das Passwort ändern.');
|
||||
abort_api(403, 'password_change_required', t('api.change_password_web'));
|
||||
}
|
||||
return $user;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,6 +84,9 @@ function url(string $path = '/'): string
|
|||
return $base . $path;
|
||||
}
|
||||
|
||||
/** Cache-Buster für /assets/: bei Änderungen an hub.css erhöhen. */
|
||||
const HUB_ASSET_VERSION = '3';
|
||||
|
||||
function redirect(string $path, int $status = 303): never
|
||||
{
|
||||
header('Location: ' . url($path), true, $status);
|
||||
|
|
@ -141,17 +144,27 @@ function fmt_dt(?string $utc): string
|
|||
}
|
||||
try {
|
||||
$date = new DateTimeImmutable($utc, new DateTimeZone('UTC'));
|
||||
return $date->setTimezone(new DateTimeZone('Europe/Berlin'))->format('d.m.Y H:i');
|
||||
$format = hub_locale() === 'en' ? 'Y-m-d H:i' : 'd.m.Y H:i';
|
||||
return $date->setTimezone(new DateTimeZone('Europe/Berlin'))->format($format);
|
||||
} catch (Throwable) {
|
||||
return '–';
|
||||
}
|
||||
}
|
||||
|
||||
/** Zahl mit den Trennzeichen der aktuellen Sprache. */
|
||||
function fmt_number(float $value, int $decimals = 1): string
|
||||
{
|
||||
if (hub_locale() === 'en') {
|
||||
return number_format($value, $decimals, '.', ',');
|
||||
}
|
||||
return number_format($value, $decimals, ',', '.');
|
||||
}
|
||||
|
||||
function human_bytes(int|float|null $bytes): string
|
||||
{
|
||||
$bytes = (float) ($bytes ?? 0);
|
||||
if ($bytes < 1024) {
|
||||
return number_format($bytes, 0, ',', '.') . ' B';
|
||||
return fmt_number($bytes, 0) . ' B';
|
||||
}
|
||||
$units = ['KB', 'MB', 'GB'];
|
||||
$index = -1;
|
||||
|
|
@ -159,7 +172,7 @@ function human_bytes(int|float|null $bytes): string
|
|||
$bytes /= 1024;
|
||||
$index++;
|
||||
} while ($bytes >= 1024 && $index < count($units) - 1);
|
||||
return number_format($bytes, 1, ',', '.') . ' ' . $units[$index];
|
||||
return fmt_number($bytes, 1) . ' ' . $units[$index];
|
||||
}
|
||||
|
||||
function truncate_text(string $value, int $length): string
|
||||
|
|
@ -229,7 +242,7 @@ function csrf_valid(): bool
|
|||
function csrf_require(): void
|
||||
{
|
||||
if (!csrf_valid()) {
|
||||
abort_page(419, 'Die Sitzung ist abgelaufen. Bitte die Seite neu laden.');
|
||||
abort_page(419, t('auth.session_expired'));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -272,11 +285,11 @@ function render(string $view, array $data = []): string
|
|||
return (string) ob_get_clean();
|
||||
}
|
||||
|
||||
function render_page(string $view, array $data = [], string $title = 'Kür-Hub'): void
|
||||
function render_page(string $view, array $data = [], ?string $title = null): void
|
||||
{
|
||||
$content = render($view, $data);
|
||||
echo render('layout', [
|
||||
'title' => $title,
|
||||
'title' => $title ?? t('page.title_default'),
|
||||
'content' => $content,
|
||||
'user' => auth_user(),
|
||||
]);
|
||||
|
|
@ -287,7 +300,7 @@ function abort_page(int $status, string $message): never
|
|||
http_response_code($status);
|
||||
$content = render('error', ['status' => $status, 'message' => $message]);
|
||||
echo render('layout', [
|
||||
'title' => 'Fehler ' . $status,
|
||||
'title' => t('page.title_error', ['status' => $status]),
|
||||
'content' => $content,
|
||||
'user' => auth_user(),
|
||||
]);
|
||||
|
|
@ -303,13 +316,13 @@ function password_policy_error(string $password, string $username = ''): ?string
|
|||
{
|
||||
$length = mb_strlen($password, 'UTF-8');
|
||||
if ($length < 10) {
|
||||
return 'Das Passwort muss mindestens 10 Zeichen lang sein.';
|
||||
return t('password.min');
|
||||
}
|
||||
if ($length > 200) {
|
||||
return 'Das Passwort darf höchstens 200 Zeichen lang sein.';
|
||||
return t('password.max');
|
||||
}
|
||||
if ($username !== '' && mb_strtolower($password) === mb_strtolower($username)) {
|
||||
return 'Das Passwort darf nicht dem Benutzernamen entsprechen.';
|
||||
return t('password.same_as_username');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php /** @var string $active */ ?>
|
||||
<nav class="admin-tabs">
|
||||
<a class="<?= $active === 'invites' ? 'active' : '' ?>" href="<?= e(url('/admin/invites')) ?>">Einladungen</a>
|
||||
<a class="<?= $active === 'users' ? 'active' : '' ?>" href="<?= e(url('/admin/users')) ?>">Benutzer</a>
|
||||
<a class="<?= $active === 'routines' ? 'active' : '' ?>" href="<?= e(url('/admin/routines')) ?>">Küren</a>
|
||||
<a class="<?= $active === 'audit' ? 'active' : '' ?>" href="<?= e(url('/admin/audit')) ?>">Audit-Log</a>
|
||||
<a class="<?= $active === 'invites' ? 'active' : '' ?>" href="<?= e(url('/admin/invites')) ?>"><?= e(t('admin.tab_invites')) ?></a>
|
||||
<a class="<?= $active === 'users' ? 'active' : '' ?>" href="<?= e(url('/admin/users')) ?>"><?= e(t('admin.tab_users')) ?></a>
|
||||
<a class="<?= $active === 'routines' ? 'active' : '' ?>" href="<?= e(url('/admin/routines')) ?>"><?= e(t('admin.tab_routines')) ?></a>
|
||||
<a class="<?= $active === 'audit' ? 'active' : '' ?>" href="<?= e(url('/admin/audit')) ?>"><?= e(t('admin.tab_audit')) ?></a>
|
||||
</nav>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -1,20 +1,27 @@
|
|||
<?php /** @var array $entries */ ?>
|
||||
<div class="page-head">
|
||||
<div>
|
||||
<h1>Verwaltung</h1>
|
||||
<p class="muted">Die letzten <?= count($entries) ?> Ereignisse.</p>
|
||||
<h1><?= e(t('admin.title')) ?></h1>
|
||||
<p class="muted"><?= e(t('admin.audit_lede', ['count' => count($entries)])) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<?php $active = 'audit'; require HUB_ROOT . '/views/_admin_nav.php'; ?>
|
||||
|
||||
<section class="panel">
|
||||
<?php if (!$entries): ?>
|
||||
<p class="muted">Noch keine Einträge.</p>
|
||||
<p class="muted"><?= e(t('admin.audit_empty')) ?></p>
|
||||
<?php else: ?>
|
||||
<div class="table-wrap">
|
||||
<table class="list compact">
|
||||
<thead>
|
||||
<tr><th>Zeit</th><th>Akteur</th><th>Aktion</th><th>Objekt</th><th>Detail</th><th>IP</th></tr>
|
||||
<tr>
|
||||
<th><?= e(t('table.time')) ?></th>
|
||||
<th><?= e(t('table.actor')) ?></th>
|
||||
<th><?= e(t('table.action')) ?></th>
|
||||
<th><?= e(t('table.subject')) ?></th>
|
||||
<th><?= e(t('table.detail')) ?></th>
|
||||
<th><?= e(t('table.ip')) ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($entries as $entry): ?>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -17,26 +17,34 @@ $linkFor = static function (int $targetPage) use ($query): string {
|
|||
?>
|
||||
<div class="page-head">
|
||||
<div>
|
||||
<h1>Verwaltung</h1>
|
||||
<p class="muted"><?= (int) $total ?> Küren insgesamt, auch versteckte.</p>
|
||||
<h1><?= e(t('admin.title')) ?></h1>
|
||||
<p class="muted"><?= e(t('admin_routines.lede', ['total' => (int) $total])) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<?php $active = 'routines'; require HUB_ROOT . '/views/_admin_nav.php'; ?>
|
||||
|
||||
<div class="toolbar">
|
||||
<form method="get" action="<?= e(url('/admin/routines')) ?>" class="search">
|
||||
<input type="search" name="q" value="<?= e_attr($query) ?>" placeholder="Titel, Skater, Benutzer …">
|
||||
<button type="submit">Suchen</button>
|
||||
<input type="search" name="q" value="<?= e_attr($query) ?>" placeholder="<?= e_attr(t('admin_routines.search_placeholder')) ?>">
|
||||
<button type="submit"><?= e(t('dashboard.search')) ?></button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php if (!$items): ?>
|
||||
<div class="empty"><p>Keine Küren gefunden.</p></div>
|
||||
<div class="empty"><p><?= e(t('admin_routines.empty')) ?></p></div>
|
||||
<?php else: ?>
|
||||
<div class="table-wrap">
|
||||
<table class="list compact">
|
||||
<thead>
|
||||
<tr><th>Titel</th><th>Von</th><th>Status</th><th>Rev.</th><th>Aktualisiert</th><th>Downloads</th><th>Aktionen</th></tr>
|
||||
<tr>
|
||||
<th><?= e(t('table.title')) ?></th>
|
||||
<th><?= e(t('table.by')) ?></th>
|
||||
<th><?= e(t('table.status')) ?></th>
|
||||
<th><?= e(t('table.revision')) ?></th>
|
||||
<th><?= e(t('table.updated')) ?></th>
|
||||
<th><?= e(t('table.downloads')) ?></th>
|
||||
<th><?= e(t('table.actions')) ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($items as $item): ?>
|
||||
|
|
@ -53,19 +61,19 @@ $linkFor = static function (int $targetPage) use ($query): string {
|
|||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="routine_id" value="<?= (int) $item['id'] ?>">
|
||||
<input type="hidden" name="action" value="<?= $item['status'] === 'published' ? 'hide' : 'publish' ?>">
|
||||
<button class="link-button" type="submit"><?= $item['status'] === 'published' ? 'verstecken' : 'veröffentlichen' ?></button>
|
||||
<button class="link-button" type="submit"><?= e($item['status'] === 'published' ? t('admin_routines.hide') : t('admin_routines.publish')) ?></button>
|
||||
</form>
|
||||
<details class="danger-zone">
|
||||
<summary>löschen</summary>
|
||||
<summary><?= e(t('admin_routines.delete')) ?></summary>
|
||||
<form method="post" action="<?= e(url('/admin/routines/action')) ?>" class="stack-tight">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="routine_id" value="<?= (int) $item['id'] ?>">
|
||||
<input type="hidden" name="action" value="delete">
|
||||
<label class="check small">
|
||||
<input type="checkbox" name="confirm" value="1" required>
|
||||
endgültig löschen
|
||||
<?= e(t('admin_routines.delete_confirm')) ?>
|
||||
</label>
|
||||
<button class="link-button danger" type="submit">Löschen bestätigen</button>
|
||||
<button class="link-button danger" type="submit"><?= e(t('admin_routines.delete_submit')) ?></button>
|
||||
</form>
|
||||
</details>
|
||||
</div>
|
||||
|
|
@ -78,9 +86,9 @@ $linkFor = static function (int $targetPage) use ($query): string {
|
|||
|
||||
<?php if ($pages > 1): ?>
|
||||
<nav class="pagination">
|
||||
<?php if ($page > 1): ?><a href="<?= e($linkFor($page - 1)) ?>">← Zurück</a><?php endif; ?>
|
||||
<span>Seite <?= (int) $page ?> von <?= (int) $pages ?></span>
|
||||
<?php if ($page < $pages): ?><a href="<?= e($linkFor($page + 1)) ?>">Weiter →</a><?php endif; ?>
|
||||
<?php if ($page > 1): ?><a href="<?= e($linkFor($page - 1)) ?>"><?= e(t('pagination.back')) ?></a><?php endif; ?>
|
||||
<span><?= e(t('pagination.page', ['page' => (int) $page, 'pages' => (int) $pages])) ?></span>
|
||||
<?php if ($page < $pages): ?><a href="<?= e($linkFor($page + 1)) ?>"><?= e(t('pagination.next')) ?></a><?php endif; ?>
|
||||
</nav>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
|
|
|||
|
|
@ -2,18 +2,26 @@
|
|||
<?php $me = auth_user(); ?>
|
||||
<div class="page-head">
|
||||
<div>
|
||||
<h1>Verwaltung</h1>
|
||||
<p class="muted">Beta-Konten verwalten.</p>
|
||||
<h1><?= e(t('admin.title')) ?></h1>
|
||||
<p class="muted"><?= e(t('admin_users.lede')) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<?php $active = 'users'; require HUB_ROOT . '/views/_admin_nav.php'; ?>
|
||||
|
||||
<section class="panel">
|
||||
<h2>Benutzer</h2>
|
||||
<h2><?= e(t('admin.tab_users')) ?></h2>
|
||||
<div class="table-wrap">
|
||||
<table class="list compact">
|
||||
<thead>
|
||||
<tr><th>Benutzer</th><th>Rolle</th><th>Status</th><th>Küren</th><th>Registriert</th><th>Letzte Anmeldung</th><th>Aktionen</th></tr>
|
||||
<tr>
|
||||
<th><?= e(t('admin.tab_users')) ?></th>
|
||||
<th><?= e(t('table.role')) ?></th>
|
||||
<th><?= e(t('table.status')) ?></th>
|
||||
<th><?= e(t('table.routines')) ?></th>
|
||||
<th><?= e(t('table.registered')) ?></th>
|
||||
<th><?= e(t('table.last_login')) ?></th>
|
||||
<th><?= e(t('table.actions')) ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($users as $user): ?>
|
||||
|
|
@ -25,10 +33,10 @@
|
|||
<div class="muted small"><?= e($user['email']) ?></div>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td><?= $user['role'] === 'admin' ? 'Admin' : 'Nutzer' ?></td>
|
||||
<td><?= e($user['role'] === 'admin' ? t('admin_users.role_admin') : t('admin_users.role_user')) ?></td>
|
||||
<td>
|
||||
<span class="status status-<?= $user['status'] === 'active' ? 'open' : 'expired' ?>">
|
||||
<?= $user['status'] === 'active' ? 'aktiv' : 'gesperrt' ?>
|
||||
<?= e($user['status'] === 'active' ? t('status.active') : t('status.blocked')) ?>
|
||||
</span>
|
||||
</td>
|
||||
<td><?= (int) $user['routine_count'] ?></td>
|
||||
|
|
@ -36,7 +44,7 @@
|
|||
<td><?= e(fmt_dt($user['last_login_at'])) ?></td>
|
||||
<td>
|
||||
<?php if ((int) $user['id'] === (int) $me['id']): ?>
|
||||
<span class="muted small">eigenes Konto</span>
|
||||
<span class="muted small"><?= e(t('admin_users.self')) ?></span>
|
||||
<?php else: ?>
|
||||
<div class="row-actions">
|
||||
<?php if ($user['status'] === 'active'): ?>
|
||||
|
|
@ -44,33 +52,33 @@
|
|||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="user_id" value="<?= (int) $user['id'] ?>">
|
||||
<input type="hidden" name="action" value="disable">
|
||||
<button class="link-button danger" type="submit">sperren</button>
|
||||
<button class="link-button danger" type="submit"><?= e(t('admin_users.block')) ?></button>
|
||||
</form>
|
||||
<?php else: ?>
|
||||
<form class="inline" method="post" action="<?= e(url('/admin/users/action')) ?>">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="user_id" value="<?= (int) $user['id'] ?>">
|
||||
<input type="hidden" name="action" value="enable">
|
||||
<button class="link-button" type="submit">entsperren</button>
|
||||
<button class="link-button" type="submit"><?= e(t('admin_users.unblock')) ?></button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
<form class="inline" method="post" action="<?= e(url('/admin/users/action')) ?>">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="user_id" value="<?= (int) $user['id'] ?>">
|
||||
<input type="hidden" name="action" value="reset">
|
||||
<button class="link-button" type="submit">Passwort zurücksetzen</button>
|
||||
<button class="link-button" type="submit"><?= e(t('admin_users.reset')) ?></button>
|
||||
</form>
|
||||
<details class="danger-zone">
|
||||
<summary>löschen</summary>
|
||||
<summary><?= e(t('admin_users.delete')) ?></summary>
|
||||
<form method="post" action="<?= e(url('/admin/users/action')) ?>" class="stack-tight">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="user_id" value="<?= (int) $user['id'] ?>">
|
||||
<input type="hidden" name="action" value="delete">
|
||||
<label class="check small">
|
||||
<input type="checkbox" name="confirm" value="1" required>
|
||||
mit allen Küren löschen
|
||||
<?= e(t('admin_users.delete_confirm')) ?>
|
||||
</label>
|
||||
<button class="link-button danger" type="submit">Löschen bestätigen</button>
|
||||
<button class="link-button danger" type="submit"><?= e(t('admin_users.delete_submit')) ?></button>
|
||||
</form>
|
||||
</details>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -24,39 +24,42 @@ $linkFor = static function (int $targetPage) use ($query, $mine): string {
|
|||
alt="Rinkplanner-Hub-Logo: drei Schlittschuhe, durch ein Netz verbunden"
|
||||
width="132" height="132">
|
||||
<div class="hub-hero-text">
|
||||
<p class="eyebrow">Viele Schlittschuhe, ein Netz</p>
|
||||
<p class="hub-hero-title">Küren teilen, Fassungen vergleichen, gemeinsam weiterentwickeln.</p>
|
||||
<p class="hub-hero-sub">Der Hub sammelt Küren, Musik und Revisionen deines Teams an einem Ort.</p>
|
||||
<p class="eyebrow"><?= e(t('dashboard.eyebrow')) ?></p>
|
||||
<p class="hub-hero-title"><?= e(t('dashboard.hero_title')) ?></p>
|
||||
<p class="hub-hero-sub"><?= e(t('dashboard.hero_sub')) ?></p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="page-head">
|
||||
<div>
|
||||
<h1>Küren</h1>
|
||||
<p class="muted"><?= (int) $total ?> <?= $total === 1 ? 'Kür' : 'Küren' ?> im Hub<?= $mine ? ' (nur deine)' : '' ?>.</p>
|
||||
<h1><?= e(t('dashboard.title')) ?></h1>
|
||||
<p class="muted"><?= e(t('dashboard.count', [
|
||||
'count' => (int) $total,
|
||||
'label' => t($total === 1 ? 'dashboard.one_routine' : 'dashboard.many_routines'),
|
||||
])) ?><?= $mine ? e(t('dashboard.mine_suffix')) : '' ?>.</p>
|
||||
</div>
|
||||
<a class="button primary" href="<?= e(url('/upload')) ?>">Kür hochladen</a>
|
||||
<a class="button primary" href="<?= e(url('/upload')) ?>"><?= e(t('dashboard.upload')) ?></a>
|
||||
</div>
|
||||
|
||||
<div class="toolbar">
|
||||
<form method="get" action="<?= e(url('/')) ?>" class="search">
|
||||
<input type="search" name="q" value="<?= e_attr($query) ?>" placeholder="Titel, Skater, Musik, Benutzer …">
|
||||
<input type="search" name="q" value="<?= e_attr($query) ?>" placeholder="<?= e_attr(t('dashboard.search_placeholder')) ?>">
|
||||
<?php if ($mine): ?><input type="hidden" name="mine" value="1"><?php endif; ?>
|
||||
<button type="submit">Suchen</button>
|
||||
<button type="submit"><?= e(t('dashboard.search')) ?></button>
|
||||
</form>
|
||||
<div class="tabs">
|
||||
<a class="<?= $mine ? '' : 'active' ?>" href="<?= e(url('/')) ?>">Alle</a>
|
||||
<a class="<?= $mine ? 'active' : '' ?>" href="<?= e(url('/?mine=1')) ?>">Meine Küren</a>
|
||||
<a class="<?= $mine ? '' : 'active' ?>" href="<?= e(url('/')) ?>"><?= e(t('dashboard.all')) ?></a>
|
||||
<a class="<?= $mine ? 'active' : '' ?>" href="<?= e(url('/?mine=1')) ?>"><?= e(t('dashboard.mine')) ?></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (!$items): ?>
|
||||
<div class="empty">
|
||||
<p>Keine Küren gefunden.</p>
|
||||
<p><?= e(t('dashboard.empty')) ?></p>
|
||||
<?php if ($query !== ''): ?>
|
||||
<p class="muted">Suche zurücksetzen oder <a href="<?= e(url('/upload')) ?>">selbst eine Kür hochladen</a>.</p>
|
||||
<p class="muted"><?= e(t('dashboard.empty_hint')) ?> <a href="<?= e(url('/upload')) ?>"><?= e(t('dashboard.empty_upload')) ?></a>.</p>
|
||||
<?php else: ?>
|
||||
<p class="muted">Der Hub ist noch leer. <a href="<?= e(url('/upload')) ?>">Erste Kür hochladen</a>.</p>
|
||||
<p class="muted"><?= e(t('dashboard.empty_first')) ?> <a href="<?= e(url('/upload')) ?>"><?= e(t('dashboard.empty_first_action')) ?></a>.</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
|
|
@ -64,13 +67,13 @@ $linkFor = static function (int $targetPage) use ($query, $mine): string {
|
|||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Titel</th>
|
||||
<th>Skater</th>
|
||||
<th>Musik</th>
|
||||
<th>Rev.</th>
|
||||
<th>Größe</th>
|
||||
<th>Aktualisiert</th>
|
||||
<th>Von</th>
|
||||
<th><?= e(t('table.title')) ?></th>
|
||||
<th><?= e(t('table.skater')) ?></th>
|
||||
<th><?= e(t('table.music')) ?></th>
|
||||
<th><?= e(t('table.revision')) ?></th>
|
||||
<th><?= e(t('table.size')) ?></th>
|
||||
<th><?= e(t('table.updated')) ?></th>
|
||||
<th><?= e(t('table.by')) ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
@ -79,7 +82,7 @@ $linkFor = static function (int $targetPage) use ($query, $mine): string {
|
|||
<td>
|
||||
<a class="title-link" href="<?= e(url('/routines/' . (int) $item['id'])) ?>"><?= e($item['title']) ?></a>
|
||||
<?php if ($item['status'] !== 'published'): ?>
|
||||
<span class="badge">versteckt</span>
|
||||
<span class="badge"><?= e(t('badge.hidden')) ?></span>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($item['category'])): ?>
|
||||
<span class="badge badge-soft"><?= e($item['category']) ?></span>
|
||||
|
|
@ -110,11 +113,11 @@ $linkFor = static function (int $targetPage) use ($query, $mine): string {
|
|||
<?php if ($pages > 1): ?>
|
||||
<nav class="pagination">
|
||||
<?php if ($page > 1): ?>
|
||||
<a href="<?= e($linkFor($page - 1)) ?>">← Zurück</a>
|
||||
<a href="<?= e($linkFor($page - 1)) ?>"><?= e(t('pagination.back')) ?></a>
|
||||
<?php endif; ?>
|
||||
<span>Seite <?= (int) $page ?> von <?= (int) $pages ?></span>
|
||||
<span><?= e(t('pagination.page', ['page' => (int) $page, 'pages' => (int) $pages])) ?></span>
|
||||
<?php if ($page < $pages): ?>
|
||||
<a href="<?= e($linkFor($page + 1)) ?>">Weiter →</a>
|
||||
<a href="<?= e($linkFor($page + 1)) ?>"><?= e(t('pagination.next')) ?></a>
|
||||
<?php endif; ?>
|
||||
</nav>
|
||||
<?php endif; ?>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php /** @var int $status */ ?>
|
||||
<?php /** @var string $message */ ?>
|
||||
<section class="auth-card">
|
||||
<p class="eyebrow">Fehler <?= (int) $status ?></p>
|
||||
<p class="eyebrow"><?= e(t('error.label', ['status' => (int) $status])) ?></p>
|
||||
<h1><?= e($message) ?></h1>
|
||||
<p class="muted">Zurück zur <a href="<?= e(url('/')) ?>">Küren-Übersicht</a>.</p>
|
||||
<p class="muted"><?= e(t('error.back')) ?> <a href="<?= e(url('/')) ?>"><?= e(t('error.back_link')) ?></a>.</p>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -3,16 +3,18 @@
|
|||
/** @var string $content */
|
||||
/** @var array|null $user */
|
||||
$flashes = flash_pull();
|
||||
$locale = hub_locale();
|
||||
$next = (string) ($_SERVER['REQUEST_URI'] ?? '/');
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="de">
|
||||
<html lang="<?= e($locale) ?>">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title><?= e($title) ?> · Rinkplanner-Hub</title>
|
||||
<title><?= e($title) ?> · <?= e(t('app.name')) ?></title>
|
||||
<link rel="icon" type="image/png" href="<?= e(url('/assets/logo-icon.png')) ?>">
|
||||
<link rel="apple-touch-icon" href="<?= e(url('/assets/logo-icon.png')) ?>">
|
||||
<link rel="stylesheet" href="<?= e(url('/assets/hub.css')) ?>">
|
||||
<link rel="stylesheet" href="<?= e(url('/assets/hub.css') . '?v=' . HUB_ASSET_VERSION) ?>">
|
||||
</head>
|
||||
<body>
|
||||
<header class="topbar">
|
||||
|
|
@ -22,19 +24,25 @@ $flashes = flash_pull();
|
|||
</a>
|
||||
<nav class="nav">
|
||||
<?php if ($user !== null): ?>
|
||||
<a href="<?= e(url('/')) ?>">Küren</a>
|
||||
<a href="<?= e(url('/upload')) ?>">Hochladen</a>
|
||||
<a href="<?= e(url('/')) ?>"><?= e(t('nav.routines')) ?></a>
|
||||
<a href="<?= e(url('/upload')) ?>"><?= e(t('nav.upload')) ?></a>
|
||||
<a href="<?= e(url('/account')) ?>"><?= e($user['display_name']) ?></a>
|
||||
<?php if (($user['role'] ?? '') === 'admin'): ?>
|
||||
<a class="nav-admin" href="<?= e(url('/admin/invites')) ?>">Verwaltung</a>
|
||||
<a class="nav-admin" href="<?= e(url('/admin/invites')) ?>"><?= e(t('nav.admin')) ?></a>
|
||||
<?php endif; ?>
|
||||
<form class="inline" method="post" action="<?= e(url('/logout')) ?>">
|
||||
<?= csrf_field() ?>
|
||||
<button class="link-button" type="submit">Abmelden</button>
|
||||
<button class="link-button" type="submit"><?= e(t('nav.logout')) ?></button>
|
||||
</form>
|
||||
<?php else: ?>
|
||||
<a href="<?= e(url('/login')) ?>">Anmelden</a>
|
||||
<a href="<?= e(url('/login')) ?>"><?= e(t('nav.login')) ?></a>
|
||||
<?php endif; ?>
|
||||
<div class="lang-switch" role="group" aria-label="<?= e(t('nav.language')) ?>">
|
||||
<?php foreach (['de' => 'DE', 'en' => 'EN'] as $code => $label): ?>
|
||||
<a href="<?= e(url('/language') . '?lang=' . $code . '&next=' . rawurlencode($next)) ?>"
|
||||
lang="<?= e($code) ?>" hreflang="<?= e($code) ?>"<?= $locale === $code ? ' aria-current="true"' : '' ?>><?= $label ?></a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
|
|
@ -44,7 +52,7 @@ $flashes = flash_pull();
|
|||
<?php foreach ($flashes as $flash): ?>
|
||||
<?php if (($flash['type'] ?? '') === 'secret'): ?>
|
||||
<div class="flash flash-secret">
|
||||
<strong><?= e($flash['label'] ?? 'Geheimnis') ?></strong>
|
||||
<strong><?= e($flash['label'] ?? t('flash.secret')) ?></strong>
|
||||
<code><?= e($flash['value'] ?? '') ?></code>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
|
|
@ -60,8 +68,8 @@ $flashes = flash_pull();
|
|||
</main>
|
||||
|
||||
<footer class="footer">
|
||||
<span>Geschlossene Beta · Rinkplanner-Hub</span>
|
||||
<a href="https://rinkplanner.programmschmiede.de/">Zur Rinkplanner-Seite</a>
|
||||
<span><?= e(t('footer.beta')) ?></span>
|
||||
<a href="https://rinkplanner.programmschmiede.de/"><?= e(t('footer.website')) ?></a>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
<?php /** @var string $login */ ?>
|
||||
<?php /** @var string $next */ ?>
|
||||
<section class="auth-card">
|
||||
<h1>Anmelden</h1>
|
||||
<p class="muted">Der Kür-Hub ist in einer geschlossenen Beta. Zugang gibt es per Einladungscode.</p>
|
||||
<h1><?= e(t('login.title')) ?></h1>
|
||||
<p class="muted"><?= e(t('login.lede')) ?></p>
|
||||
|
||||
<?php if ($error !== ''): ?>
|
||||
<div class="flash flash-error"><?= e($error) ?></div>
|
||||
|
|
@ -13,19 +13,19 @@
|
|||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="next" value="<?= e_attr($next) ?>">
|
||||
<label>
|
||||
Benutzername oder E-Mail
|
||||
<?= e(t('login.login_label')) ?>
|
||||
<input type="text" name="login" value="<?= e_attr($login) ?>" autocomplete="username" required autofocus>
|
||||
</label>
|
||||
<label>
|
||||
Passwort
|
||||
<?= e(t('login.password')) ?>
|
||||
<input type="password" name="password" autocomplete="current-password" required>
|
||||
</label>
|
||||
<label class="check">
|
||||
<input type="checkbox" name="remember" value="1">
|
||||
Angemeldet bleiben (30 Tage)
|
||||
<?= e(t('login.remember')) ?>
|
||||
</label>
|
||||
<button class="primary" type="submit">Anmelden</button>
|
||||
<button class="primary" type="submit"><?= e(t('login.submit')) ?></button>
|
||||
</form>
|
||||
|
||||
<p class="muted small">Noch keinen Zugang? Ein Beta-Code kommt von der Hub-Administration.</p>
|
||||
<p class="muted small"><?= e(t('login.no_access')) ?></p>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
<?php /** @var array $errors */ ?>
|
||||
<?php /** @var array $input */ ?>
|
||||
<section class="auth-card wide">
|
||||
<h1>Beta-Zugang einlösen</h1>
|
||||
<p class="muted">Ein Einladungscode legt genau ein Konto an. Der Code verliert danach seine Gültigkeit.</p>
|
||||
<h1><?= e(t('register.title')) ?></h1>
|
||||
<p class="muted"><?= e(t('register.lede')) ?></p>
|
||||
|
||||
<?php if ($errors): ?>
|
||||
<div class="flash flash-error">
|
||||
|
|
@ -19,44 +19,44 @@
|
|||
<form method="post" action="<?= e(url('/register')) ?>" class="stack">
|
||||
<?= csrf_field() ?>
|
||||
<label>
|
||||
Einladungscode
|
||||
<?= e(t('register.code')) ?>
|
||||
<input type="text" name="code" value="<?= e_attr($code) ?>" placeholder="RHUB-XXXX-XXXX-XXXX-XXXX" required>
|
||||
</label>
|
||||
<div class="grid-2">
|
||||
<label>
|
||||
Benutzername
|
||||
<?= e(t('register.username')) ?>
|
||||
<input type="text" name="username" value="<?= e_attr($input['username']) ?>" autocomplete="username" required>
|
||||
<span class="hint">3–32 Zeichen, nur Kleinbuchstaben, Ziffern, Punkt, Bindestrich, Unterstrich.</span>
|
||||
<span class="hint"><?= e(t('register.username_hint')) ?></span>
|
||||
</label>
|
||||
<label>
|
||||
Anzeigename
|
||||
<?= e(t('register.display_name')) ?>
|
||||
<input type="text" name="display_name" value="<?= e_attr($input['display_name']) ?>" maxlength="64">
|
||||
</label>
|
||||
</div>
|
||||
<label>
|
||||
E-Mail (optional)
|
||||
<?= e(t('register.email')) ?>
|
||||
<input type="email" name="email" value="<?= e_attr($input['email']) ?>" autocomplete="email"<?= $invite !== null && !empty($invite['email']) ? ' readonly' : '' ?>>
|
||||
<?php if ($invite !== null && !empty($invite['email'])): ?>
|
||||
<span class="hint">Diese Einladung ist an <?= e($invite['email']) ?> gebunden.</span>
|
||||
<span class="hint"><?= e(t('register.email_bound', ['email' => $invite['email']])) ?></span>
|
||||
<?php endif; ?>
|
||||
</label>
|
||||
<div class="grid-2">
|
||||
<label>
|
||||
Passwort
|
||||
<?= e(t('register.password')) ?>
|
||||
<input type="password" name="password" autocomplete="new-password" required>
|
||||
<span class="hint">Mindestens 10 Zeichen.</span>
|
||||
<span class="hint"><?= e(t('register.password_hint')) ?></span>
|
||||
</label>
|
||||
<label>
|
||||
Passwort wiederholen
|
||||
<?= e(t('register.password_repeat')) ?>
|
||||
<input type="password" name="password_repeat" autocomplete="new-password" required>
|
||||
</label>
|
||||
</div>
|
||||
<label class="check">
|
||||
<input type="checkbox" name="rights" value="1" required>
|
||||
Ich akzeptiere die Beta-Regeln und teile keine Inhalte, an denen ich keine Rechte habe.
|
||||
<?= e(t('register.rights')) ?>
|
||||
</label>
|
||||
<button class="primary" type="submit">Konto anlegen</button>
|
||||
<button class="primary" type="submit"><?= e(t('register.submit')) ?></button>
|
||||
</form>
|
||||
|
||||
<p class="muted small">Schon ein Konto? <a href="<?= e(url('/login')) ?>">Anmelden</a></p>
|
||||
<p class="muted small"><?= e(t('register.have_account')) ?> <a href="<?= e(url('/login')) ?>"><?= e(t('register.login_link')) ?></a></p>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -1,93 +1,93 @@
|
|||
<?php /** @var array $routine */ ?>
|
||||
<?php /** @var array|null $routine */ ?>
|
||||
<?php /** @var bool $can_edit */ ?>
|
||||
<?php /** @var bool $is_admin */ ?>
|
||||
<?php $audioName = $routine['audio_original_name'] ?? ''; ?>
|
||||
<article class="detail">
|
||||
<div class="page-head">
|
||||
<div>
|
||||
<p class="eyebrow"><a href="<?= e(url('/')) ?>">Küren</a> / Kür</p>
|
||||
<p class="eyebrow"><a href="<?= e(url('/')) ?>"><?= e(t('routine.breadcrumb')) ?></a> / <?= e(t('routine.breadcrumb_current')) ?></p>
|
||||
<h1><?= e($routine['title']) ?></h1>
|
||||
<p class="muted">
|
||||
<?= e($routine['owner_display_name'] ?: $routine['owner_username']) ?>
|
||||
· Revision <?= (int) ($routine['revision'] ?? 0) ?>
|
||||
· <?= e(t('routine.revision', ['revision' => (int) ($routine['revision'] ?? 0)])) ?>
|
||||
· <?= e(fmt_dt($routine['updated_at'])) ?>
|
||||
<?php if ($routine['status'] !== 'published'): ?>
|
||||
· <span class="badge">versteckt</span>
|
||||
· <span class="badge"><?= e(t('badge.hidden')) ?></span>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<?php if (!empty($routine['routine_path'])): ?>
|
||||
<a class="button primary" href="<?= e(url('/routines/' . (int) $routine['id'] . '/download')) ?>">Kür herunterladen</a>
|
||||
<a class="button primary" href="<?= e(url('/routines/' . (int) $routine['id'] . '/download')) ?>"><?= e(t('routine.download')) ?></a>
|
||||
<?php endif; ?>
|
||||
<?php if ($audioName !== ''): ?>
|
||||
<a class="button" href="<?= e(url('/routines/' . (int) $routine['id'] . '/audio')) ?>">Musik herunterladen</a>
|
||||
<a class="button" href="<?= e(url('/routines/' . (int) $routine['id'] . '/audio')) ?>"><?= e(t('routine.download_audio')) ?></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($can_edit): ?>
|
||||
<div class="owner-bar">
|
||||
<span class="muted">Du kannst diese Kür verwalten.</span>
|
||||
<a class="button small" href="<?= e(url('/routines/' . (int) $routine['id'] . '/revise')) ?>">Neue Revision hochladen</a>
|
||||
<span class="muted"><?= e(t('routine.owner_bar')) ?></span>
|
||||
<a class="button small" href="<?= e(url('/routines/' . (int) $routine['id'] . '/revise')) ?>"><?= e(t('routine.new_revision')) ?></a>
|
||||
<?php if ($routine['status'] === 'published'): ?>
|
||||
<form class="inline" method="post" action="<?= e(url('/routines/' . (int) $routine['id'] . '/hide')) ?>">
|
||||
<?= csrf_field() ?>
|
||||
<button class="button small danger-ghost" type="submit">Aus dem Hub nehmen</button>
|
||||
<button class="button small danger-ghost" type="submit"><?= e(t('routine.hide')) ?></button>
|
||||
</form>
|
||||
<?php else: ?>
|
||||
<form class="inline" method="post" action="<?= e(url('/routines/' . (int) $routine['id'] . '/publish')) ?>">
|
||||
<?= csrf_field() ?>
|
||||
<button class="button small" type="submit">Wieder veröffentlichen</button>
|
||||
<button class="button small" type="submit"><?= e(t('routine.publish')) ?></button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
<?php if ($is_admin): ?>
|
||||
<a class="button small danger-ghost" href="<?= e(url('/admin/routines?q=' . rawurlencode($routine['title']))) ?>">In der Verwaltung öffnen</a>
|
||||
<a class="button small danger-ghost" href="<?= e(url('/admin/routines?q=' . rawurlencode($routine['title']))) ?>"><?= e(t('routine.open_admin')) ?></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($routine['description'])): ?>
|
||||
<section class="panel">
|
||||
<h2>Beschreibung</h2>
|
||||
<h2><?= e(t('routine.description')) ?></h2>
|
||||
<p class="preline"><?= e($routine['description']) ?></p>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($audioName !== ''): ?>
|
||||
<section class="panel">
|
||||
<h2>Musik</h2>
|
||||
<h2><?= e(t('routine.music')) ?></h2>
|
||||
<audio controls preload="none" src="<?= e(url('/routines/' . (int) $routine['id'] . '/audio')) ?>"></audio>
|
||||
<p class="muted small"><?= e($audioName) ?> · <?= e(human_bytes((int) ($routine['audio_bytes'] ?? 0))) ?></p>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<section class="panel">
|
||||
<h2>Details</h2>
|
||||
<h2><?= e(t('routine.details')) ?></h2>
|
||||
<dl class="facts">
|
||||
<div><dt>Skater</dt><dd><?= e($routine['skater_name'] ?: '–') ?></dd></div>
|
||||
<div><dt>Kategorie</dt><dd><?= e($routine['category'] ?: '–') ?></dd></div>
|
||||
<div><dt>Musiktitel</dt><dd><?= e($routine['music_title'] ?: '–') ?></dd></div>
|
||||
<div><dt>Musik</dt><dd><?= e($routine['music_artist'] ?: '–') ?></dd></div>
|
||||
<div><dt>Kür-Datei</dt><dd><?= e($routine['routine_original_name'] ?? '–') ?> · <?= e(human_bytes((int) ($routine['routine_bytes'] ?? 0))) ?></dd></div>
|
||||
<div><dt>Audio-Datei</dt><dd><?= e($audioName !== '' ? $audioName . ' · ' . human_bytes((int) ($routine['audio_bytes'] ?? 0)) : '–') ?></dd></div>
|
||||
<div><dt>Downloads</dt><dd><?= (int) $routine['download_count'] ?></dd></div>
|
||||
<div><dt>Eingestellt</dt><dd><?= e(fmt_dt($routine['created_at'])) ?></dd></div>
|
||||
<div><dt><?= e(t('table.skater')) ?></dt><dd><?= e($routine['skater_name'] ?: '–') ?></dd></div>
|
||||
<div><dt><?= e(t('routine.category')) ?></dt><dd><?= e($routine['category'] ?: '–') ?></dd></div>
|
||||
<div><dt><?= e(t('routine.music_title')) ?></dt><dd><?= e($routine['music_title'] ?: '–') ?></dd></div>
|
||||
<div><dt><?= e(t('routine.music_artist')) ?></dt><dd><?= e($routine['music_artist'] ?: '–') ?></dd></div>
|
||||
<div><dt><?= e(t('routine.routine_file')) ?></dt><dd><?= e($routine['routine_original_name'] ?? '–') ?> · <?= e(human_bytes((int) ($routine['routine_bytes'] ?? 0))) ?></dd></div>
|
||||
<div><dt><?= e(t('routine.audio_file')) ?></dt><dd><?= e($audioName !== '' ? $audioName . ' · ' . human_bytes((int) ($routine['audio_bytes'] ?? 0)) : '–') ?></dd></div>
|
||||
<div><dt><?= e(t('table.downloads')) ?></dt><dd><?= (int) $routine['download_count'] ?></dd></div>
|
||||
<div><dt><?= e(t('table.created')) ?></dt><dd><?= e(fmt_dt($routine['created_at'])) ?></dd></div>
|
||||
</dl>
|
||||
</section>
|
||||
|
||||
<section class="panel">
|
||||
<h2>Prüfsummen</h2>
|
||||
<h2><?= e(t('routine.checksums')) ?></h2>
|
||||
<div class="hash">
|
||||
<span>Kür</span>
|
||||
<span><?= e(t('routine.breadcrumb_current')) ?></span>
|
||||
<code><?= e($routine['routine_sha256'] ?? '–') ?></code>
|
||||
</div>
|
||||
<?php if ($audioName !== ''): ?>
|
||||
<div class="hash">
|
||||
<span>Musik</span>
|
||||
<span><?= e(t('routine.music')) ?></span>
|
||||
<code><?= e($routine['audio_sha256'] ?? '–') ?></code>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<p class="muted small">Beim Download prüfen, ob die SHA-256-Summe zur Kür passt.</p>
|
||||
<p class="muted small"><?= e(t('routine.checksum_hint')) ?></p>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
<?php /** @var array|null $routine */ ?>
|
||||
<?php $isRevision = $routine !== null; ?>
|
||||
<section class="auth-card wide">
|
||||
<h1><?= $isRevision ? 'Neue Revision' : 'Kür hochladen' ?></h1>
|
||||
<h1><?= e($isRevision ? t('upload.title_revision') : t('upload.title_new')) ?></h1>
|
||||
<?php if ($isRevision): ?>
|
||||
<p class="muted">Neue Fassung von „<?= e($routine['title']) ?>“. Die bisherige Revision bleibt erhalten.</p>
|
||||
<p class="muted"><?= e(t('upload.revision_lede', ['title' => $routine['title']])) ?></p>
|
||||
<?php else: ?>
|
||||
<p class="muted">Lade die Kür-JSON und – falls die Kür Musik nutzt – die zugehörige Audiodatei hoch. Beide gehören als Paket zusammen.</p>
|
||||
<p class="muted"><?= e(t('upload.lede')) ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($errors): ?>
|
||||
|
|
@ -26,41 +26,41 @@
|
|||
<?= csrf_field() ?>
|
||||
<div class="grid-2">
|
||||
<label>
|
||||
Kür-Datei (.json)
|
||||
<?= e(t('upload.routine_file')) ?>
|
||||
<input type="file" name="routine" accept=".json,application/json" required>
|
||||
<span class="hint">Aus Rinkplanner gespeicherte Kür, max. <?= e(human_bytes((int) config('app.max_routine_bytes', 8 * 1024 * 1024))) ?>.</span>
|
||||
<span class="hint"><?= e(t('upload.routine_hint', ['max' => human_bytes((int) config('app.max_routine_bytes', 8 * 1024 * 1024))])) ?></span>
|
||||
</label>
|
||||
<label>
|
||||
Musikdatei (MP3/OGG/WAV/M4A/AAC)
|
||||
<?= e(t('upload.audio_file')) ?>
|
||||
<input type="file" name="audio" accept=".mp3,.ogg,.wav,.m4a,.aac,audio/*">
|
||||
<span class="hint">Dateiname muss exakt dem Feld „music_file“ der Kür entsprechen.</span>
|
||||
<span class="hint"><?= e(t('upload.audio_hint')) ?></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<label>
|
||||
Beschreibung (optional)
|
||||
<?= e(t('upload.description')) ?>
|
||||
<textarea name="description" rows="4" maxlength="2000"><?= e($input['description']) ?></textarea>
|
||||
</label>
|
||||
|
||||
<div class="grid-2">
|
||||
<label>
|
||||
Musiktitel (optional)
|
||||
<?= e(t('upload.music_title')) ?>
|
||||
<input type="text" name="music_title" maxlength="190" value="<?= e_attr($input['music_title']) ?>">
|
||||
</label>
|
||||
<label>
|
||||
Interpret (optional)
|
||||
<?= e(t('upload.artist')) ?>
|
||||
<input type="text" name="music_artist" maxlength="190" value="<?= e_attr($input['music_artist']) ?>">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<label class="check">
|
||||
<input type="checkbox" name="rights" value="1" required>
|
||||
Ich habe die Rechte an Kür und Musik und darf sie im geschlossenen Beta-Hub teilen.
|
||||
<?= e(t('upload.rights')) ?>
|
||||
</label>
|
||||
|
||||
<div class="actions">
|
||||
<button class="primary" type="submit"><?= $isRevision ? 'Revision veröffentlichen' : 'Kür veröffentlichen' ?></button>
|
||||
<a class="button" href="<?= e(url($isRevision ? '/routines/' . (int) $routine['id'] : '/')) ?>">Abbrechen</a>
|
||||
<button class="primary" type="submit"><?= e($isRevision ? t('upload.submit_revision') : t('upload.submit_new')) ?></button>
|
||||
<a class="button" href="<?= e(url($isRevision ? '/routines/' . (int) $routine['id'] : '/')) ?>"><?= e(t('upload.cancel')) ?></a>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -141,6 +141,30 @@ code {
|
|||
color: var(--gold) !important;
|
||||
}
|
||||
|
||||
.lang-switch {
|
||||
align-items: center;
|
||||
background: rgba(11, 32, 54, 0.7);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 999px;
|
||||
display: inline-flex;
|
||||
gap: 2px;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.lang-switch a {
|
||||
border-radius: 999px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.06em;
|
||||
padding: 0.15rem 0.55rem;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.lang-switch a[aria-current="true"] {
|
||||
background: linear-gradient(135deg, var(--blue), var(--deep-blue));
|
||||
color: var(--ink);
|
||||
}
|
||||
|
||||
.page {
|
||||
margin: 0 auto;
|
||||
max-width: 1180px;
|
||||
|
|
|
|||
|
|
@ -221,11 +221,77 @@ do_check() {
|
|||
[[ "$config_code" == "403" || "$config_code" == "404" ]] && echo "Konfiguration gesperrt: OK" || { echo "Konfiguration erreichbar: HTTP $config_code" >&2; ok=1; }
|
||||
[[ "$storage_code" == "403" || "$storage_code" == "404" ]] && echo "Storage gesperrt: OK" || { echo "Storage erreichbar: HTTP $storage_code" >&2; ok=1; }
|
||||
[[ "$install_code" == "404" ]] && echo "Installer entfernt: OK" || echo "Hinweis: Installer liefert HTTP $install_code" >&2
|
||||
|
||||
check_hub_texts || ok=1
|
||||
|
||||
local de_page en_page
|
||||
de_page="$(curl -sS --max-time 30 -H 'Cookie: RHUB_LANG=de' "$PUBLIC_URL/login" || true)"
|
||||
en_page="$(curl -sS --max-time 30 -H 'Cookie: RHUB_LANG=en' "$PUBLIC_URL/login" || true)"
|
||||
[[ "$de_page" == *'<html lang="de">'* ]] && echo "Login deutsch: OK" || { echo "Login deutsch: html lang fehlt" >&2; ok=1; }
|
||||
[[ "$en_page" == *'<html lang="en">'* ]] && echo "Login englisch: OK" || { echo "Login englisch: html lang fehlt" >&2; ok=1; }
|
||||
[[ "$en_page" == *'Sign in'* ]] && echo "Englische Texte: OK" || { echo "Englische Texte fehlen" >&2; ok=1; }
|
||||
|
||||
local switch_headers
|
||||
switch_headers="$(curl -sS -o /dev/null -D - --max-time 30 "$PUBLIC_URL/language?lang=en&next=%2Flogin" || true)"
|
||||
if [[ "$switch_headers" == *'RHUB_LANG=en'* ]]; then
|
||||
echo "Sprachwechsel: OK"
|
||||
else
|
||||
echo "Sprachwechsel setzt kein Cookie" >&2
|
||||
ok=1
|
||||
fi
|
||||
|
||||
if [[ "$ok" -ne 0 ]]; then
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Prüft, dass de und en dieselben Schlüssel haben und dass jeder in t()
|
||||
# verwendete Schlüssel im Katalog steht.
|
||||
check_hub_texts() {
|
||||
echo "Prüfe Texte (hub/app/i18n_strings.php) …"
|
||||
python3 - "$HUB_DIR" <<'PY'
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
root = Path(sys.argv[1])
|
||||
catalog = (root / 'app' / 'i18n_strings.php').read_text(encoding='utf-8')
|
||||
blocks = re.split(r"\n '(de|en)' => \[", catalog)
|
||||
if len(blocks) != 5:
|
||||
print(' FEHLER: de/en-Blöcke nicht gefunden', file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
def keys(block):
|
||||
return set(re.findall(r"^\s+'([^']+)'\s*=>", block, re.M))
|
||||
|
||||
de, en = keys(blocks[2]), keys(blocks[4])
|
||||
status = 0
|
||||
for missing in sorted(de - en):
|
||||
print(f' FEHLER: en fehlt "{missing}"', file=sys.stderr)
|
||||
status = 1
|
||||
for extra in sorted(en - de):
|
||||
print(f' FEHLER: de fehlt "{extra}"', file=sys.stderr)
|
||||
status = 1
|
||||
|
||||
used = set()
|
||||
for path in list((root / 'app').glob('*.php')) + list((root / 'views').glob('*.php')):
|
||||
if path.name.startswith('i18n'):
|
||||
continue
|
||||
text = path.read_text(encoding='utf-8')
|
||||
used.update(re.findall(r"\bt\('([a-z0-9_.]+)'", text))
|
||||
|
||||
for key in sorted(used - de):
|
||||
if key.endswith('.'):
|
||||
continue # dynamisch zusammengesetzt, z. B. t('invite.status.' . $status)
|
||||
print(f' FEHLER: t(\'{key}\') fehlt im Katalog', file=sys.stderr)
|
||||
status = 1
|
||||
|
||||
if status == 0:
|
||||
print(f' ok: {len(de)} Schlüssel, deckungsgleich und vollständig')
|
||||
sys.exit(status)
|
||||
PY
|
||||
}
|
||||
|
||||
case "$MODE" in
|
||||
sync) do_sync ;;
|
||||
install) install_if_needed ;;
|
||||
|
|
|
|||
180
tools/deploy_web.sh
Executable file
180
tools/deploy_web.sh
Executable file
|
|
@ -0,0 +1,180 @@
|
|||
#!/usr/bin/env bash
|
||||
# Website von rinkplanner.programmschmiede.de (Quelle: web/).
|
||||
#
|
||||
# Aufruf:
|
||||
# ./tools/deploy_web.sh --check # Standard: Texte und Live-Seite prüfen
|
||||
# ./tools/deploy_web.sh --sync # web/ per FTPS hochladen
|
||||
# ./tools/deploy_web.sh --all # sync + check
|
||||
#
|
||||
# Zugangsdaten kommen aus docs/credentials.txt (gitignored).
|
||||
# Der Docroot der Subdomain ist das FTP-Verzeichnis
|
||||
# rinkplanner.programmschmiede.de; media/, fonts/ und version.json bleiben
|
||||
# unangetastet, weil sie nicht in web/ liegen.
|
||||
set -euo pipefail
|
||||
|
||||
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
WEB_DIR="$REPO_ROOT/web"
|
||||
CREDENTIALS="$REPO_ROOT/docs/credentials.txt"
|
||||
REMOTE_DIR="rinkplanner.programmschmiede.de"
|
||||
PUBLIC_URL="https://rinkplanner.programmschmiede.de"
|
||||
|
||||
MODE="check"
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--check) MODE="check" ;;
|
||||
--sync) MODE="sync" ;;
|
||||
--all) MODE="all" ;;
|
||||
-h|--help)
|
||||
sed -n '2,12p' "${BASH_SOURCE[0]}" | sed 's/^# \{0,1\}//'
|
||||
exit 0
|
||||
;;
|
||||
*) echo "Unbekannte Option: $1" >&2; exit 2 ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
[[ -d "$WEB_DIR" ]] || { echo "Fehlt: $WEB_DIR" >&2; exit 1; }
|
||||
|
||||
cred() {
|
||||
[[ -f "$CREDENTIALS" ]] || { echo "Fehlt: $CREDENTIALS" >&2; exit 1; }
|
||||
grep -m1 "^$1=" "$CREDENTIALS" | cut -d= -f2- | tr -d '\r'
|
||||
}
|
||||
|
||||
FTP_URL="$(cred FTP_URL)"
|
||||
FTP_USER="$(cred FTP_USER)"
|
||||
FTP_PASSWORD="$(cred FTP_PASSWORD)"
|
||||
|
||||
HOST="${FTP_URL#ftp://}"
|
||||
HOST="${HOST#ftps://}"
|
||||
HOST="${HOST%%/*}"
|
||||
HOST="${HOST%%:*}"
|
||||
[[ -n "$HOST" && -n "$FTP_USER" ]] || { echo "FTP-Zugang unvollständig." >&2; exit 1; }
|
||||
|
||||
CURL=(curl --ssl-reqd --insecure --silent --show-error --connect-timeout 20 --max-time 300 --user "$FTP_USER:$FTP_PASSWORD")
|
||||
|
||||
fail=0
|
||||
problem() { echo " FEHLER: $*" >&2; fail=1; }
|
||||
ok() { echo " ok: $*"; }
|
||||
|
||||
check_texts() {
|
||||
echo "Prüfe Texte (web/i18n.php) …"
|
||||
python3 - "$WEB_DIR/i18n.php" <<'PY' || fail=1
|
||||
import re
|
||||
import sys
|
||||
|
||||
text = open(sys.argv[1], encoding='utf-8').read()
|
||||
blocks = re.split(r"\n '(de|en)' => \[", text)
|
||||
if len(blocks) != 5:
|
||||
print(' FEHLER: de/en-Blöcke nicht gefunden', file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
def keys(block):
|
||||
return re.findall(r"^\s+'([^']+)'\s*=>", block, re.M)
|
||||
|
||||
de = set(keys(blocks[2]))
|
||||
en = set(keys(blocks[4]))
|
||||
status = 0
|
||||
for missing in sorted(de - en):
|
||||
print(f' FEHLER: en fehlt "{missing}"', file=sys.stderr)
|
||||
status = 1
|
||||
for extra in sorted(en - de):
|
||||
print(f' FEHLER: de fehlt "{extra}"', file=sys.stderr)
|
||||
status = 1
|
||||
if status == 0:
|
||||
print(f' ok: {len(de)} Schlüssel in beiden Sprachen')
|
||||
sys.exit(status)
|
||||
PY
|
||||
|
||||
if command -v php >/dev/null 2>&1; then
|
||||
echo "Prüfe PHP-Syntax …"
|
||||
while IFS= read -r file; do
|
||||
php -l "$file" >/dev/null || fail=1
|
||||
done < <(find "$WEB_DIR" -name '*.php' | sort)
|
||||
ok "php -l ohne Befund"
|
||||
else
|
||||
echo " Hinweis: kein lokales php; Syntax prüft erst der Server."
|
||||
fi
|
||||
}
|
||||
|
||||
http_code() { curl -sS -o /dev/null -w '%{http_code}' --max-time 30 "$@" || true; }
|
||||
|
||||
# Sprache, die / bei diesem Accept-Language-Header wählt.
|
||||
detected_lang() {
|
||||
curl -sS -o /dev/null -D - --max-time 30 -H "Accept-Language: $1" "$PUBLIC_URL/" \
|
||||
| tr -d '\r' | awk 'tolower($1)=="location:" {print $2}'
|
||||
}
|
||||
|
||||
check_live() {
|
||||
echo "Prüfe ${PUBLIC_URL} …"
|
||||
|
||||
[[ "$(detected_lang 'en-US,en;q=0.9')" == "/en/" ]] && ok "/ → /en/ (en-US)" || problem "/ leitet bei en-US nicht auf /en/"
|
||||
[[ "$(detected_lang 'de-DE,de;q=0.9')" == "/de/" ]] && ok "/ → /de/ (de-DE)" || problem "/ leitet bei de-DE nicht auf /de/"
|
||||
[[ "$(detected_lang 'fr-FR,fr;q=0.9')" == "/de/" ]] && ok "/ → /de/ (Fallback)" || problem "Fallback ist nicht /de/"
|
||||
[[ "$(detected_lang 'en;q=0.2,de;q=0.9')" == "/de/" ]] && ok "q-Werte werden beachtet" || problem "q-Werte werden ignoriert"
|
||||
|
||||
local code
|
||||
code="$(http_code "$PUBLIC_URL/de/")"
|
||||
[[ "$code" == "200" ]] && ok "/de/ → 200" || problem "/de/ liefert HTTP $code"
|
||||
code="$(http_code "$PUBLIC_URL/en/")"
|
||||
[[ "$code" == "200" ]] && ok "/en/ → 200" || problem "/en/ liefert HTTP $code"
|
||||
|
||||
for asset in assets/site.css fonts/fonts.css media/hero-poster.jpg; do
|
||||
code="$(http_code "$PUBLIC_URL/$asset")"
|
||||
[[ "$code" == "200" ]] && ok "/$asset → 200" || problem "/$asset liefert HTTP $code"
|
||||
done
|
||||
|
||||
local legacy
|
||||
legacy="$(http_code "$PUBLIC_URL/index.html")"
|
||||
case "$legacy" in
|
||||
200|302) ok "/index.html → HTTP $legacy (Weiterleitung oder Altseite)" ;;
|
||||
*) problem "/index.html liefert HTTP $legacy" ;;
|
||||
esac
|
||||
|
||||
local de en
|
||||
de="$(curl -sS --max-time 30 "$PUBLIC_URL/de/" || true)"
|
||||
en="$(curl -sS --max-time 30 "$PUBLIC_URL/en/" || true)"
|
||||
|
||||
[[ "$de" == *'<html lang="de">'* ]] && ok "de: html lang=\"de\"" || problem "de: html lang fehlt oder falsch"
|
||||
[[ "$en" == *'<html lang="en">'* ]] && ok "en: html lang=\"en\"" || problem "en: html lang fehlt oder falsch"
|
||||
[[ "$de" == *'Kürplaner'* ]] && ok "de: deutsche Texte" || problem "de: deutsche Texte fehlen"
|
||||
[[ "$en" == *'programme planner'* ]] && ok "en: englische Texte" || problem "en: englische Texte fehlen"
|
||||
|
||||
if grep -qE '<h3></h3>|<p>\s*</p>' <<<"$de$en"; then
|
||||
problem "leere Überschrift oder leeres Absatz-Element (fehlender Textschlüssel?)"
|
||||
else
|
||||
ok "keine leeren Textstellen"
|
||||
fi
|
||||
|
||||
local vary
|
||||
vary="$(curl -sS -o /dev/null -D - --max-time 30 -H 'Accept-Language: en' "$PUBLIC_URL/" | tr -d '\r' | awk 'tolower($1)=="vary:" {print}')"
|
||||
[[ "$vary" == *Accept-Language* ]] && ok "Vary: Accept-Language gesetzt" || problem "Vary: Accept-Language fehlt"
|
||||
}
|
||||
|
||||
do_sync() {
|
||||
echo "Lade web/ nach $REMOTE_DIR …"
|
||||
while IFS= read -r file; do
|
||||
local relative="${file#"$WEB_DIR"/}"
|
||||
case "$relative" in
|
||||
*.swp|.DS_Store) continue ;;
|
||||
esac
|
||||
"${CURL[@]}" --ftp-create-dirs -T "$file" "ftp://$HOST/$REMOTE_DIR/$relative"
|
||||
echo " $relative"
|
||||
done < <(find "$WEB_DIR" -type f | sort)
|
||||
echo "Sync fertig."
|
||||
}
|
||||
|
||||
do_check() {
|
||||
check_texts
|
||||
check_live
|
||||
if [[ "$fail" -ne 0 ]]; then
|
||||
echo "Prüfung mit Fehlern beendet." >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "Alle Prüfungen bestanden."
|
||||
}
|
||||
|
||||
case "$MODE" in
|
||||
sync) do_sync ;;
|
||||
check) do_check ;;
|
||||
all) do_sync; do_check ;;
|
||||
esac
|
||||
7
web/.htaccess
Normal file
7
web/.htaccess
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# Rinkplanner-Website: Sprachweiche vor den statischen Seiten.
|
||||
#
|
||||
# index.php entscheidet anhand von Accept-Language, welche Sprache ausgeliefert
|
||||
# wird. Der Host erlaubt weder mod_alias noch mod_rewrite, deshalb liegt die
|
||||
# alte Adresse /index.html als kleine Weiterleitungsseite daneben – sie wird
|
||||
# nur ausgeliefert, wenn index.php nicht gefunden wird.
|
||||
DirectoryIndex index.php index.html
|
||||
682
web/assets/site.css
Normal file
682
web/assets/site.css
Normal file
|
|
@ -0,0 +1,682 @@
|
|||
:root {
|
||||
--ink: #050d19;
|
||||
--navy: #071a30;
|
||||
--ice: #c9f0ff;
|
||||
--frost: #eefaff;
|
||||
--sky: #7dd3fc;
|
||||
--blue: #38bdf8;
|
||||
--deep-blue: #185a86;
|
||||
--gold: #f3d7a3;
|
||||
--text: #f4fbff;
|
||||
--muted: rgba(224, 244, 255, 0.68);
|
||||
--line: rgba(190, 230, 255, 0.17);
|
||||
--glass: rgba(7, 24, 43, 0.58);
|
||||
--glass-strong: rgba(8, 29, 51, 0.82);
|
||||
--shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
|
||||
--radius: 24px;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
overflow-x: hidden;
|
||||
background: var(--ink);
|
||||
color: var(--text);
|
||||
font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
::selection {
|
||||
background: rgba(125, 211, 252, 0.35);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--ice);
|
||||
}
|
||||
|
||||
.bg-media {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: -3;
|
||||
overflow: hidden;
|
||||
background:
|
||||
radial-gradient(circle at 28% 18%, rgba(56, 189, 248, 0.18), transparent 38%),
|
||||
radial-gradient(circle at 76% 44%, rgba(24, 90, 134, 0.34), transparent 44%),
|
||||
linear-gradient(145deg, #050d19 0%, #071a30 48%, #0a2742 100%);
|
||||
}
|
||||
|
||||
.bg-video {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
opacity: 0.58;
|
||||
filter: saturate(1.08) contrast(1.04);
|
||||
}
|
||||
|
||||
body.no-video .bg-video {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.bg-shade {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(3, 9, 18, 0.28) 0%, rgba(3, 9, 18, 0.62) 58%, var(--ink) 100%),
|
||||
radial-gradient(circle at 50% 42%, transparent 0%, rgba(3, 9, 18, 0.46) 76%);
|
||||
}
|
||||
|
||||
.bg-aurora {
|
||||
position: absolute;
|
||||
inset: -20%;
|
||||
background:
|
||||
radial-gradient(ellipse at 18% 55%, rgba(125, 211, 252, 0.16), transparent 34%),
|
||||
radial-gradient(ellipse at 82% 32%, rgba(243, 215, 163, 0.08), transparent 28%),
|
||||
radial-gradient(ellipse at 54% 84%, rgba(56, 189, 248, 0.12), transparent 32%);
|
||||
filter: blur(30px);
|
||||
animation: aurora 16s ease-in-out infinite alternate;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.trail {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: -2;
|
||||
overflow: hidden;
|
||||
pointer-events: none;
|
||||
opacity: 0.58;
|
||||
}
|
||||
|
||||
.trail svg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.trail-line {
|
||||
fill: none;
|
||||
stroke: rgba(201, 240, 255, 0.34);
|
||||
stroke-width: 1.4;
|
||||
stroke-linecap: round;
|
||||
stroke-dasharray: 3 22;
|
||||
animation: trailDash 9s linear infinite;
|
||||
}
|
||||
|
||||
.trail-line.two {
|
||||
stroke: rgba(125, 211, 252, 0.26);
|
||||
animation-duration: 13s;
|
||||
animation-direction: reverse;
|
||||
}
|
||||
|
||||
.trail-line.three {
|
||||
stroke: rgba(243, 215, 163, 0.16);
|
||||
animation-duration: 17s;
|
||||
}
|
||||
|
||||
.grain {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: -1;
|
||||
pointer-events: none;
|
||||
opacity: 0.05;
|
||||
background-image: radial-gradient(rgba(255, 255, 255, 0.9) 0.6px, transparent 0.6px);
|
||||
background-size: 3px 3px;
|
||||
}
|
||||
|
||||
.site-header {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 20;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 24px;
|
||||
padding: 20px clamp(20px, 5vw, 64px);
|
||||
background: linear-gradient(180deg, rgba(3, 9, 18, 0.78), transparent);
|
||||
}
|
||||
|
||||
.brand {
|
||||
color: var(--text);
|
||||
text-decoration: none;
|
||||
font-size: 0.92rem;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.brand span {
|
||||
color: var(--sky);
|
||||
}
|
||||
|
||||
.site-nav {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.site-nav a {
|
||||
color: var(--muted);
|
||||
text-decoration: none;
|
||||
font-size: 0.82rem;
|
||||
font-weight: 600;
|
||||
padding: 9px 14px;
|
||||
border-radius: 999px;
|
||||
transition: color 0.2s ease, background 0.2s ease;
|
||||
}
|
||||
|
||||
.site-nav a:hover {
|
||||
color: var(--text);
|
||||
background: rgba(201, 240, 255, 0.08);
|
||||
}
|
||||
|
||||
.site-nav .nav-back {
|
||||
color: var(--text);
|
||||
border: 1px solid var(--line);
|
||||
background: rgba(7, 24, 43, 0.42);
|
||||
backdrop-filter: blur(12px);
|
||||
}
|
||||
|
||||
.lang-switch {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
padding: 3px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 999px;
|
||||
background: rgba(7, 24, 43, 0.42);
|
||||
backdrop-filter: blur(12px);
|
||||
}
|
||||
|
||||
.site-nav .lang-switch a {
|
||||
padding: 6px 10px;
|
||||
border-radius: 999px;
|
||||
font-size: 0.72rem;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.site-nav .lang-switch a[aria-current="page"] {
|
||||
color: #04111f;
|
||||
background: linear-gradient(135deg, var(--frost), var(--sky));
|
||||
}
|
||||
|
||||
main {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: min(1180px, 100%);
|
||||
margin: 0 auto;
|
||||
padding: 0 clamp(20px, 5vw, 64px);
|
||||
}
|
||||
|
||||
.hero {
|
||||
min-height: 92vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
padding: 150px 0 80px;
|
||||
}
|
||||
|
||||
.eyebrow,
|
||||
.section-kicker {
|
||||
margin: 0 0 22px;
|
||||
color: var(--sky);
|
||||
font-size: 0.72rem;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.28em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.eyebrow {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.eyebrow::before {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
background: var(--sky);
|
||||
box-shadow: 0 0 18px rgba(125, 211, 252, 0.9);
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 0 0 -0.24em;
|
||||
font-family: "Playfair Display", Georgia, serif;
|
||||
font-size: clamp(2.9rem, 13vw, 9.5rem);
|
||||
font-weight: 600;
|
||||
line-height: 0.88;
|
||||
padding-bottom: 0.28em;
|
||||
letter-spacing: -0.045em;
|
||||
background: linear-gradient(180deg, #ffffff 0%, var(--ice) 48%, var(--sky) 100%);
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
color: transparent;
|
||||
filter: drop-shadow(0 22px 54px rgba(56, 189, 248, 0.22));
|
||||
}
|
||||
|
||||
.lede {
|
||||
max-width: 650px;
|
||||
margin: 30px auto 0;
|
||||
color: var(--muted);
|
||||
font-size: clamp(1.02rem, 1.8vw, 1.22rem);
|
||||
font-weight: 400;
|
||||
line-height: 1.75;
|
||||
}
|
||||
|
||||
.hero-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
gap: 12px;
|
||||
margin-top: 34px;
|
||||
}
|
||||
|
||||
.button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 10px;
|
||||
padding: 14px 24px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid transparent;
|
||||
text-decoration: none;
|
||||
font-size: 0.94rem;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.01em;
|
||||
transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
|
||||
}
|
||||
|
||||
.button:hover {
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.button-primary {
|
||||
color: #04111f;
|
||||
background: linear-gradient(135deg, var(--frost), var(--sky) 48%, var(--blue));
|
||||
box-shadow: 0 14px 38px rgba(56, 189, 248, 0.26);
|
||||
}
|
||||
|
||||
.button-primary:hover {
|
||||
box-shadow: 0 20px 48px rgba(56, 189, 248, 0.36);
|
||||
}
|
||||
|
||||
.button-ghost {
|
||||
color: var(--text);
|
||||
border-color: var(--line);
|
||||
background: rgba(7, 24, 43, 0.38);
|
||||
backdrop-filter: blur(14px);
|
||||
}
|
||||
|
||||
.button-ghost:hover {
|
||||
background: rgba(201, 240, 255, 0.09);
|
||||
}
|
||||
|
||||
.hero-meta {
|
||||
margin-top: 26px;
|
||||
color: var(--muted);
|
||||
font-size: 0.82rem;
|
||||
letter-spacing: 0.03em;
|
||||
}
|
||||
|
||||
.section {
|
||||
padding: 92px 0;
|
||||
scroll-margin-top: 80px;
|
||||
}
|
||||
|
||||
.section h2 {
|
||||
margin: 0;
|
||||
font-family: "Playfair Display", Georgia, serif;
|
||||
font-size: clamp(2.2rem, 4.6vw, 3.7rem);
|
||||
font-weight: 500;
|
||||
line-height: 1.08;
|
||||
letter-spacing: -0.025em;
|
||||
}
|
||||
|
||||
.section-lede {
|
||||
max-width: 680px;
|
||||
margin: 18px auto 0;
|
||||
color: var(--muted);
|
||||
font-size: 1.02rem;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
.centered {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.feature-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 16px;
|
||||
margin-top: 42px;
|
||||
}
|
||||
|
||||
.feature-card {
|
||||
padding: 26px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
background: var(--glass);
|
||||
box-shadow: var(--shadow);
|
||||
backdrop-filter: blur(20px);
|
||||
}
|
||||
|
||||
.feature-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
margin-bottom: 20px;
|
||||
border: 1px solid rgba(201, 240, 255, 0.28);
|
||||
border-radius: 50%;
|
||||
color: var(--ice);
|
||||
font-size: 1.25rem;
|
||||
background: radial-gradient(circle at 30% 20%, rgba(201, 240, 255, 0.22), transparent 60%);
|
||||
}
|
||||
|
||||
.feature-card h3 {
|
||||
margin: 0 0 10px;
|
||||
font-size: 1.02rem;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.feature-card p {
|
||||
margin: 0;
|
||||
color: var(--muted);
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.68;
|
||||
}
|
||||
|
||||
.downloads {
|
||||
padding-top: 70px;
|
||||
}
|
||||
|
||||
.download-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 18px;
|
||||
max-width: 920px;
|
||||
margin: 44px auto 0;
|
||||
}
|
||||
|
||||
.download-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
padding: 34px 30px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
background: var(--glass-strong);
|
||||
box-shadow: var(--shadow);
|
||||
backdrop-filter: blur(24px);
|
||||
}
|
||||
|
||||
.os-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 84px;
|
||||
padding: 7px 13px;
|
||||
border: 1px solid rgba(201, 240, 255, 0.26);
|
||||
border-radius: 999px;
|
||||
color: var(--ice);
|
||||
font-size: 0.68rem;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.16em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.download-card h3 {
|
||||
margin: 18px 0 8px;
|
||||
font-size: 1.45rem;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.download-card > p {
|
||||
margin: 0;
|
||||
color: var(--muted);
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.65;
|
||||
}
|
||||
|
||||
.download-card .button {
|
||||
width: 100%;
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.download-card .button span {
|
||||
font-weight: 600;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.sub-link {
|
||||
display: inline-block;
|
||||
margin-top: 14px;
|
||||
color: var(--ice);
|
||||
font-size: 0.82rem;
|
||||
font-weight: 600;
|
||||
text-decoration: underline;
|
||||
text-decoration-color: rgba(201, 240, 255, 0.32);
|
||||
text-underline-offset: 4px;
|
||||
}
|
||||
|
||||
.hint {
|
||||
margin-top: 20px !important;
|
||||
color: rgba(224, 244, 255, 0.54) !important;
|
||||
font-size: 0.78rem !important;
|
||||
line-height: 1.6 !important;
|
||||
}
|
||||
|
||||
.download-note {
|
||||
max-width: 720px;
|
||||
margin: 26px auto 0;
|
||||
color: rgba(224, 244, 255, 0.5);
|
||||
font-size: 0.78rem;
|
||||
line-height: 1.6;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.notes-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 16px;
|
||||
margin-top: 36px;
|
||||
}
|
||||
|
||||
.note-card {
|
||||
padding: 26px;
|
||||
border-top: 1px solid var(--line);
|
||||
}
|
||||
|
||||
.note-card h3 {
|
||||
margin: 0 0 9px;
|
||||
font-size: 0.95rem;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.note-card p {
|
||||
margin: 0;
|
||||
color: var(--muted);
|
||||
font-size: 0.88rem;
|
||||
line-height: 1.66;
|
||||
}
|
||||
|
||||
.release-list {
|
||||
display: grid;
|
||||
gap: 16px;
|
||||
max-width: 860px;
|
||||
margin: 36px auto 0;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.release-card {
|
||||
padding: 24px 26px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
background: var(--glass);
|
||||
backdrop-filter: blur(20px);
|
||||
}
|
||||
|
||||
.release-head {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: baseline;
|
||||
gap: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.release-version {
|
||||
font-weight: 800;
|
||||
color: var(--ice);
|
||||
}
|
||||
|
||||
.release-date {
|
||||
color: var(--muted);
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.release-badge {
|
||||
margin-left: auto;
|
||||
padding: 3px 10px;
|
||||
border: 1px solid rgba(201, 240, 255, 0.28);
|
||||
border-radius: 999px;
|
||||
color: var(--ice);
|
||||
font-size: 0.68rem;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.release-card ul {
|
||||
margin: 0;
|
||||
padding-left: 18px;
|
||||
color: var(--muted);
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
.release-card li {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.release-card li:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.site-footer {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
width: min(1180px, 100%);
|
||||
margin: 30px auto 0;
|
||||
padding: 30px clamp(20px, 5vw, 64px) 42px;
|
||||
border-top: 1px solid var(--line);
|
||||
color: var(--muted);
|
||||
font-size: 0.78rem;
|
||||
}
|
||||
|
||||
.site-footer a {
|
||||
color: var(--muted);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.site-footer a:hover {
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
@keyframes aurora {
|
||||
from { transform: translate3d(-2%, -1%, 0) scale(1); }
|
||||
to { transform: translate3d(2%, 2%, 0) scale(1.06); }
|
||||
}
|
||||
|
||||
@keyframes trailDash {
|
||||
to { stroke-dashoffset: -260; }
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.feature-grid,
|
||||
.notes-grid {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.download-grid {
|
||||
grid-template-columns: 1fr;
|
||||
max-width: 560px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.site-header {
|
||||
padding: 16px 18px;
|
||||
}
|
||||
|
||||
.site-nav > a:not(.nav-back) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.site-header {
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.site-nav {
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.hero {
|
||||
min-height: 88vh;
|
||||
padding-top: 126px;
|
||||
}
|
||||
|
||||
.section {
|
||||
padding: 68px 0;
|
||||
}
|
||||
|
||||
.feature-grid,
|
||||
.notes-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.download-card {
|
||||
padding: 28px 22px;
|
||||
}
|
||||
|
||||
.bg-video {
|
||||
opacity: 0.42;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
html {
|
||||
scroll-behavior: auto;
|
||||
}
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
animation-duration: 0.001ms !important;
|
||||
animation-iteration-count: 1 !important;
|
||||
transition-duration: 0.001ms !important;
|
||||
}
|
||||
}
|
||||
121
web/bootstrap.php
Normal file
121
web/bootstrap.php
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
<?php
|
||||
// Sprachwahl der Rinkplanner-Website.
|
||||
//
|
||||
// Die Sprache kommt aus Accept-Language (der User-Agent enthält keine
|
||||
// Sprachinformation). Reihenfolge der Entscheidung:
|
||||
// 1. ?lang=de|en – explizite Wahl, wird als Cookie gespeichert
|
||||
// 2. Cookie lang – frühere Wahl des Besuchers
|
||||
// 3. Accept-Language
|
||||
// 4. DEFAULT_LANG
|
||||
//
|
||||
// /de/ und /en/ sind eigenständige URLs. "/" leitet nur weiter.
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
const SUPPORTED_LANGS = ['de', 'en'];
|
||||
const DEFAULT_LANG = 'de';
|
||||
const LANG_COOKIE = 'lang';
|
||||
const COOKIE_LIFETIME = 365 * 86400;
|
||||
|
||||
/** "de-DE", "EN", "de_AT" → "de"; unbekannte Sprachen → null. */
|
||||
function normalize_lang(string $value): ?string
|
||||
{
|
||||
$primary = substr(strtolower(trim($value)), 0, 2);
|
||||
return in_array($primary, SUPPORTED_LANGS, true) ? $primary : null;
|
||||
}
|
||||
|
||||
function cookie_lang(): ?string
|
||||
{
|
||||
$raw = $_COOKIE[LANG_COOKIE] ?? null;
|
||||
return is_string($raw) ? normalize_lang($raw) : null;
|
||||
}
|
||||
|
||||
function set_lang_cookie(string $lang): void
|
||||
{
|
||||
if (headers_sent()) {
|
||||
return;
|
||||
}
|
||||
$https = ($_SERVER['HTTPS'] ?? '') !== '' && ($_SERVER['HTTPS'] ?? '') !== 'off';
|
||||
setcookie(LANG_COOKIE, $lang, [
|
||||
'expires' => time() + COOKIE_LIFETIME,
|
||||
'path' => '/',
|
||||
'secure' => $https,
|
||||
'httponly' => false,
|
||||
'samesite' => 'Lax',
|
||||
]);
|
||||
}
|
||||
|
||||
/** Beste unterstützte Sprache aus dem Accept-Language-Header, q-Werte beachtet. */
|
||||
function accept_language(): ?string
|
||||
{
|
||||
$header = $_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? '';
|
||||
if (!is_string($header) || trim($header) === '') {
|
||||
return null;
|
||||
}
|
||||
|
||||
$candidates = [];
|
||||
foreach (explode(',', $header) as $position => $entry) {
|
||||
$parts = explode(';', trim($entry));
|
||||
$lang = normalize_lang($parts[0]);
|
||||
if ($lang === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$quality = 1.0;
|
||||
foreach (array_slice($parts, 1) as $parameter) {
|
||||
if (preg_match('/^\s*q\s*=\s*([0-9.]+)\s*$/i', $parameter, $match) === 1) {
|
||||
$quality = (float) $match[1];
|
||||
}
|
||||
}
|
||||
if ($quality <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Pro Sprache zählt der beste Treffer; bei Gleichstand gewinnt die
|
||||
// Reihenfolge im Header.
|
||||
if (!isset($candidates[$lang]) || $quality > $candidates[$lang][0]) {
|
||||
$candidates[$lang] = [$quality, $position];
|
||||
}
|
||||
}
|
||||
|
||||
if ($candidates === []) {
|
||||
return null;
|
||||
}
|
||||
|
||||
uasort($candidates, static fn (array $a, array $b): int => $b[0] <=> $a[0] ?: $a[1] <=> $b[1]);
|
||||
return (string) array_key_first($candidates);
|
||||
}
|
||||
|
||||
function redirect_lang(string $lang): never
|
||||
{
|
||||
header('Vary: Accept-Language, Cookie');
|
||||
header('Location: /' . $lang . '/', true, 302);
|
||||
exit;
|
||||
}
|
||||
|
||||
/** Explizite Sprachwahl aus der URL, z. B. /de/?lang=en. */
|
||||
function requested_lang(): ?string
|
||||
{
|
||||
$raw = $_GET['lang'] ?? null;
|
||||
return is_string($raw) ? normalize_lang($raw) : null;
|
||||
}
|
||||
|
||||
function render_page(string $lang): never
|
||||
{
|
||||
$requested = requested_lang();
|
||||
if ($requested !== null && $requested !== $lang) {
|
||||
set_lang_cookie($requested);
|
||||
redirect_lang($requested);
|
||||
}
|
||||
if ($requested === $lang) {
|
||||
set_lang_cookie($lang);
|
||||
}
|
||||
|
||||
$strings = require __DIR__ . '/i18n.php';
|
||||
$t = $strings[$lang];
|
||||
$alt = $lang === 'de' ? 'en' : 'de';
|
||||
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
require __DIR__ . '/template.php';
|
||||
exit;
|
||||
}
|
||||
6
web/de/index.php
Normal file
6
web/de/index.php
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
require __DIR__ . '/../bootstrap.php';
|
||||
|
||||
render_page('de');
|
||||
6
web/en/index.php
Normal file
6
web/en/index.php
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
require __DIR__ . '/../bootstrap.php';
|
||||
|
||||
render_page('en');
|
||||
176
web/i18n.php
Normal file
176
web/i18n.php
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
<?php
|
||||
// Alle Texte der Rinkplanner-Website. Beide Sprachen müssen dieselben
|
||||
// Schlüssel haben; tools/check_web.sh prüft das.
|
||||
//
|
||||
// HTML ist erlaubt (z. B. <code>), die Inhalte stammen ausschließlich aus
|
||||
// dieser Datei und werden unverändert ausgegeben.
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'de' => [
|
||||
'meta.title' => 'Rinkplanner – Kürplaner für Eiskunstlauf',
|
||||
'meta.description' => 'Rinkplanner: Der Kürplaner für Eiskunstlauf. Elemente setzen, Timings planen, 3D-Vorschau und Cloud-Sync. Test-Builds für macOS und Windows.',
|
||||
|
||||
'nav.label' => 'Seitennavigation',
|
||||
'nav.features' => 'Funktionen',
|
||||
'nav.downloads' => 'Downloads',
|
||||
'nav.news' => 'Was ist neu',
|
||||
'nav.home' => 'Startseite',
|
||||
|
||||
'hero.eyebrow' => 'Eiskunstlauf · Kürplanung',
|
||||
'hero.lede' => 'Von der ersten Idee bis zur fertigen Kür: Elemente platzieren, Timings planen, Sprungkombinationen prüfen und die Kür auf dem Tablet oder Desktop zum Leben erwecken.',
|
||||
'hero.cta_download' => 'Jetzt herunterladen',
|
||||
'hero.cta_features' => 'Funktionen ansehen',
|
||||
'hero.meta' => 'Kostenloser Test-Build · macOS & Windows · 12.11.2026',
|
||||
|
||||
'features.kicker' => 'Alles für die Kür',
|
||||
'features.title' => 'Dein Programm. Deine Linien.',
|
||||
'features.lede' => 'Rinkplanner verbindet Zeichnung, ISU-Elemente und Timing in einer ruhigen Oberfläche – für die Planung am Schreibtisch und die Abnahme auf dem Eis.',
|
||||
|
||||
'feature.editor.title' => 'Kür-Editor',
|
||||
'feature.editor.body' => 'Linien, Bögen und Sections frei zeichnen. Start, Richtung, Kante und Tiefe direkt am Segment bearbeiten.',
|
||||
'feature.elements.title' => 'ISU-Elemente',
|
||||
'feature.elements.body' => 'Sprünge, Pirouetten, Sequenzen und Sprungkombinationen mit Kürzel, Level und Standzeit planen.',
|
||||
'feature.preview.title' => '3D-Vorschau',
|
||||
'feature.preview.body' => 'Die geplante Kür als animierte Vorschau erleben – mit Läufer, Kufenspur und Kameraansicht.',
|
||||
'feature.sync.title' => 'Cloud-Sync',
|
||||
'feature.sync.body' => 'Kürdateien und Musik über das eigene Dropbox-Konto zwischen Desktop und Tablet abgleichen.',
|
||||
'feature.export.title' => 'Export',
|
||||
'feature.export.body' => 'Übersichtliche PDF- und SVG-Blätter für Training, Wettkampf und die Absprache mit dem Trainer.',
|
||||
'feature.tablet.title' => 'Für das Tablet',
|
||||
'feature.tablet.body' => 'Große Touch-Ziele, Zwei-Finger-Zoom und ein Layout, das auch auf dem Eis gut lesbar bleibt.',
|
||||
|
||||
'downloads.kicker' => 'Test-Build',
|
||||
'downloads.title' => 'Rinkplanner herunterladen',
|
||||
'downloads.lede' => 'macOS- und Windows-Installer vom 12.11.2026. Wähle deine Plattform – die Downloads sind direkt einsatzbereit.',
|
||||
'downloads.mac.title' => 'Für den Mac',
|
||||
'downloads.mac.body' => 'Universal Binary für Apple Silicon (macOS 13+) und Intel (macOS 11+).',
|
||||
'downloads.mac.cta' => 'Installer herunterladen',
|
||||
'downloads.mac.hint' => 'DMG öffnen und <code>Rinkplanner.app</code> auf „Programme“ ziehen. Die App ist ad-hoc signiert, nicht notarisiert – beim ersten Start ggf. Rechtsklick → Öffnen, danach genügt ein Doppelklick.',
|
||||
'downloads.windows.title' => 'Für Windows',
|
||||
'downloads.windows.body' => 'Für Windows 10 und Windows 11 (64-Bit). Installation ohne Administratorrechte.',
|
||||
'downloads.windows.cta' => 'Installer herunterladen',
|
||||
'downloads.windows.hint' => 'Installer ausführen und den Anweisungen folgen – inklusive Startmenü-Verknüpfung und Deinstallation. Beim Start kann Windows SmartScreen warnen: „Weitere Informationen“ → „Trotzdem ausführen“.',
|
||||
'downloads.note' => 'Die Builds sind Testversionen und werden regelmäßig aktualisiert. Feedback und Fehlerberichte sind willkommen.',
|
||||
|
||||
'news.kicker' => 'Was ist neu',
|
||||
'news.title' => 'Letzte Änderungen',
|
||||
'news.lede' => 'Die Test-Builds wachsen in kleinen Schritten. Hier steht, was zuletzt dazugekommen ist.',
|
||||
|
||||
'release.0.version' => '0.2.1',
|
||||
'release.0.date' => '12.11.2026 · macOS und Windows',
|
||||
'release.0.badge' => 'Aktuell',
|
||||
'release.0.item.0' => 'Neue Läuferin im Kürkleid, mit deutlich saubererem Gesicht und feineren Konturen.',
|
||||
'release.0.item.1' => '3D-Bande mit Sockel und Fugen – Eisfläche und Bande sind jetzt klar getrennt.',
|
||||
'release.0.item.2' => 'Bei einer Step Sequence werden beim Auswählen alle zugehörigen Teilstrecken mitmarkiert.',
|
||||
'release.0.item.3' => 'Deutlich kleinerer Download: 29 statt 35 MB (Windows) und 65 statt 68 MB (macOS), weil alte Modellvarianten entfernt wurden.',
|
||||
|
||||
'release.1.version' => '0.2.0',
|
||||
'release.1.date' => '11.11.2026 · macOS und Windows',
|
||||
'release.1.item.0' => 'Die App prüft beim Start und über das Datei-Menü, ob eine neue Version bereitsteht.',
|
||||
'release.1.item.1' => 'Neuer Windows-Installer (ohne Administratorrechte) und macOS-Installer als DMG.',
|
||||
'release.1.item.2' => 'Sport-Theme, zentrale Küren-Verwaltung und automatische Auflösung von Sync-Konflikten.',
|
||||
|
||||
'release.2.version' => '0.1.0',
|
||||
'release.2.date' => '10.11.2026 · macOS und Windows',
|
||||
'release.2.item.0' => 'Erste verteilte Test-Builds als DMG und Setup-EXE.',
|
||||
'release.2.item.1' => 'Musikdateien werden mit der Kür synchronisiert; M4A/AAC läuft auf macOS über WAV.',
|
||||
|
||||
'rights.kicker' => 'Gut zu wissen',
|
||||
'rights.title' => 'Deine Daten bleiben bei dir.',
|
||||
'rights.cloud.title' => 'Eigenes Cloud-Konto',
|
||||
'rights.cloud.body' => 'Der Sync läuft über dein persönliches Dropbox-Konto. Es gibt keinen zentralen Rinkplanner-Speicher.',
|
||||
'rights.music.title' => 'Musik in deiner Hand',
|
||||
'rights.music.body' => 'Musikdateien liegen im eigenen Cloud-Ordner. Für die Nutzungsrechte an der Musik bist du selbst verantwortlich.',
|
||||
'rights.care.title' => 'Mit Liebe zum Detail',
|
||||
'rights.care.body' => 'Entwickelt für Eiskunstlauf-Trainer, Läuferinnen und Läufer, die ihre Kür strukturiert planen und teilen möchten.',
|
||||
|
||||
'footer.copyright' => '© 2026 programmschmiede.de',
|
||||
'footer.home' => 'Zur Startseite',
|
||||
'footer.contact' => 'Kontakt',
|
||||
],
|
||||
|
||||
'en' => [
|
||||
'meta.title' => 'Rinkplanner – programme planner for figure skating',
|
||||
'meta.description' => 'Rinkplanner: the programme planner for figure skating. Place elements, plan timings, 3D preview and cloud sync. Test builds for macOS and Windows.',
|
||||
|
||||
'nav.label' => 'Site navigation',
|
||||
'nav.features' => 'Features',
|
||||
'nav.downloads' => 'Downloads',
|
||||
'nav.news' => 'What’s new',
|
||||
'nav.home' => 'Home',
|
||||
|
||||
'hero.eyebrow' => 'Figure skating · Programme planning',
|
||||
'hero.lede' => 'From the first idea to the finished programme: place elements, plan timings, check jump combinations and bring your programme to life on a tablet or desktop.',
|
||||
'hero.cta_download' => 'Download now',
|
||||
'hero.cta_features' => 'See the features',
|
||||
'hero.meta' => 'Free test build · macOS & Windows · 12 Nov 2026',
|
||||
|
||||
'features.kicker' => 'Everything for your programme',
|
||||
'features.title' => 'Your programme. Your lines.',
|
||||
'features.lede' => 'Rinkplanner brings drawing, ISU elements and timing together in one calm interface – for planning at your desk and for sign-off on the ice.',
|
||||
|
||||
'feature.editor.title' => 'Programme editor',
|
||||
'feature.editor.body' => 'Draw lines, curves and sections freely. Edit start, direction, edge and depth right on the segment.',
|
||||
'feature.elements.title' => 'ISU elements',
|
||||
'feature.elements.body' => 'Plan jumps, spins, sequences and jump combinations with abbreviation, level and hold time.',
|
||||
'feature.preview.title' => '3D preview',
|
||||
'feature.preview.body' => 'Watch the planned programme as an animated preview – with skater, blade trail and camera view.',
|
||||
'feature.sync.title' => 'Cloud sync',
|
||||
'feature.sync.body' => 'Sync programme files and music between desktop and tablet through your own Dropbox account.',
|
||||
'feature.export.title' => 'Export',
|
||||
'feature.export.body' => 'Clear PDF and SVG sheets for training, competition and for talking things through with your coach.',
|
||||
'feature.tablet.title' => 'Built for tablets',
|
||||
'feature.tablet.body' => 'Large touch targets, two-finger zoom and a layout that stays readable on the ice.',
|
||||
|
||||
'downloads.kicker' => 'Test build',
|
||||
'downloads.title' => 'Download Rinkplanner',
|
||||
'downloads.lede' => 'macOS and Windows installers from 12 Nov 2026. Pick your platform – the downloads are ready to use.',
|
||||
'downloads.mac.title' => 'For your Mac',
|
||||
'downloads.mac.body' => 'Universal binary for Apple Silicon (macOS 13+) and Intel (macOS 11+).',
|
||||
'downloads.mac.cta' => 'Download installer',
|
||||
'downloads.mac.hint' => 'Open the DMG and drag <code>Rinkplanner.app</code> into Applications. The app is ad-hoc signed, not notarised – on first launch you may need to right-click → Open; after that a double-click is enough.',
|
||||
'downloads.windows.title' => 'For Windows',
|
||||
'downloads.windows.body' => 'For Windows 10 and Windows 11 (64-bit). Installs without administrator rights.',
|
||||
'downloads.windows.cta' => 'Download installer',
|
||||
'downloads.windows.hint' => 'Run the installer and follow the steps – including the Start menu shortcut and uninstaller. On launch, Windows SmartScreen may warn you: “More info” → “Run anyway”.',
|
||||
'downloads.note' => 'These builds are test versions and are updated regularly. Feedback and bug reports are welcome.',
|
||||
|
||||
'news.kicker' => 'What’s new',
|
||||
'news.title' => 'Recent changes',
|
||||
'news.lede' => 'The test builds grow in small steps. Here is what was added most recently.',
|
||||
|
||||
'release.0.version' => '0.2.1',
|
||||
'release.0.date' => '12 Nov 2026 · macOS and Windows',
|
||||
'release.0.badge' => 'Current',
|
||||
'release.0.item.0' => 'A new skater in a competition dress, with a noticeably cleaner face and finer contours.',
|
||||
'release.0.item.1' => '3D boards with plinth and joints – the ice surface and the boards are now clearly separated.',
|
||||
'release.0.item.2' => 'When you select a step sequence, all of its segments are highlighted as well.',
|
||||
'release.0.item.3' => 'A much smaller download: 29 instead of 35 MB (Windows) and 65 instead of 68 MB (macOS), because old model variants were removed.',
|
||||
|
||||
'release.1.version' => '0.2.0',
|
||||
'release.1.date' => '11 Nov 2026 · macOS and Windows',
|
||||
'release.1.item.0' => 'The app checks at startup and from the File menu whether a new version is available.',
|
||||
'release.1.item.1' => 'New Windows installer (no administrator rights) and a macOS installer as a DMG.',
|
||||
'release.1.item.2' => 'Sports theme, central programme management and automatic resolution of sync conflicts.',
|
||||
|
||||
'release.2.version' => '0.1.0',
|
||||
'release.2.date' => '10 Nov 2026 · macOS and Windows',
|
||||
'release.2.item.0' => 'First distributed test builds as a DMG and a setup EXE.',
|
||||
'release.2.item.1' => 'Music files are synced with the programme; M4A/AAC plays via WAV on macOS.',
|
||||
|
||||
'rights.kicker' => 'Good to know',
|
||||
'rights.title' => 'Your data stays with you.',
|
||||
'rights.cloud.title' => 'Your own cloud account',
|
||||
'rights.cloud.body' => 'Sync runs through your personal Dropbox account. There is no central Rinkplanner storage.',
|
||||
'rights.music.title' => 'Music in your hands',
|
||||
'rights.music.body' => 'Music files live in your own cloud folder. You are responsible for the rights to use the music.',
|
||||
'rights.care.title' => 'Made with care',
|
||||
'rights.care.body' => 'Built for figure skating coaches and skaters who want to plan and share their programme in a structured way.',
|
||||
|
||||
'footer.copyright' => '© 2026 programmschmiede.de',
|
||||
'footer.home' => 'Back to the home page',
|
||||
'footer.contact' => 'Contact',
|
||||
],
|
||||
];
|
||||
17
web/index.html
Normal file
17
web/index.html
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Rinkplanner</title>
|
||||
<link rel="canonical" href="https://rinkplanner.programmschmiede.de/" />
|
||||
<!-- Alte Adresse aus der Zeit vor der Sprachweiche. Der Host erlaubt weder
|
||||
mod_alias noch mod_rewrite, deshalb leitet diese Seite im Browser weiter.
|
||||
Ziel ist /de/ statt /, damit hier keine Weiterleitungsschleife entsteht,
|
||||
falls index.php einmal fehlt. -->
|
||||
<meta http-equiv="refresh" content="0; url=/de/" />
|
||||
<script>window.location.replace("/de/" + window.location.search);</script>
|
||||
</head>
|
||||
<body>
|
||||
<p><a href="/de/">Rinkplanner – zur Startseite</a></p>
|
||||
</body>
|
||||
</html>
|
||||
14
web/index.php
Normal file
14
web/index.php
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
// Einstiegspunkt: erkennt die Sprache und leitet auf /de/ oder /en/ weiter.
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require __DIR__ . '/bootstrap.php';
|
||||
|
||||
$requested = requested_lang();
|
||||
if ($requested !== null) {
|
||||
set_lang_cookie($requested);
|
||||
redirect_lang($requested);
|
||||
}
|
||||
|
||||
redirect_lang(cookie_lang() ?? accept_language() ?? DEFAULT_LANG);
|
||||
234
web/template.php
Normal file
234
web/template.php
Normal file
|
|
@ -0,0 +1,234 @@
|
|||
<?php
|
||||
// Gemeinsames Markup für /de/ und /en/. Texte kommen aus i18n.php.
|
||||
// Erwartet: $lang ('de'|'en'), $alt (andere Sprache), $t (Texte dieser Sprache).
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
$site = 'https://rinkplanner.programmschmiede.de';
|
||||
|
||||
$features = [
|
||||
['icon' => '✎', 'title' => 'feature.editor.title', 'body' => 'feature.editor.body'],
|
||||
['icon' => '✦', 'title' => 'feature.elements.title', 'body' => 'feature.elements.body'],
|
||||
['icon' => '▶', 'title' => 'feature.preview.title', 'body' => 'feature.preview.body'],
|
||||
['icon' => '☁', 'title' => 'feature.sync.title', 'body' => 'feature.sync.body'],
|
||||
['icon' => '⇩', 'title' => 'feature.export.title', 'body' => 'feature.export.body'],
|
||||
['icon' => '★', 'title' => 'feature.tablet.title', 'body' => 'feature.tablet.body'],
|
||||
];
|
||||
|
||||
$releases = [];
|
||||
for ($i = 0; isset($t["release.$i.version"]); $i++) {
|
||||
$items = [];
|
||||
for ($j = 0; isset($t["release.$i.item.$j"]); $j++) {
|
||||
$items[] = $t["release.$i.item.$j"];
|
||||
}
|
||||
$releases[] = [
|
||||
'version' => $t["release.$i.version"],
|
||||
'date' => $t["release.$i.date"],
|
||||
'badge' => $t["release.$i.badge"] ?? null,
|
||||
'items' => $items,
|
||||
];
|
||||
}
|
||||
|
||||
$langLabels = ['de' => 'DE', 'en' => 'EN'];
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<?= $lang ?>">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="#050d19" />
|
||||
<title><?= $t['meta.title'] ?></title>
|
||||
<meta name="description" content="<?= $t['meta.description'] ?>" />
|
||||
<link rel="canonical" href="<?= $site ?>/<?= $lang ?>/" />
|
||||
<link rel="alternate" hreflang="de" href="<?= $site ?>/de/" />
|
||||
<link rel="alternate" hreflang="en" href="<?= $site ?>/en/" />
|
||||
<link rel="alternate" hreflang="x-default" href="<?= $site ?>/" />
|
||||
<link rel="stylesheet" href="/fonts/fonts.css" />
|
||||
<link rel="stylesheet" href="/assets/site.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="bg-media" aria-hidden="true">
|
||||
<video class="bg-video" autoplay muted loop playsinline preload="auto" poster="/media/hero-poster.jpg">
|
||||
<source src="/media/hero.mp4" type="video/mp4" />
|
||||
</video>
|
||||
<div class="bg-shade"></div>
|
||||
<div class="bg-aurora"></div>
|
||||
</div>
|
||||
|
||||
<div class="trail" aria-hidden="true">
|
||||
<svg viewBox="0 0 1440 900" preserveAspectRatio="none">
|
||||
<path class="trail-line one" d="M-80,720 C220,540 350,780 620,630 S980,340 1180,470 S1320,690 1520,540" />
|
||||
<path class="trail-line two" d="M-60,300 C180,180 360,400 600,250 S980,120 1200,260 S1380,430 1520,300" />
|
||||
<path class="trail-line three" d="M-40,820 C300,700 520,860 760,700 S1100,560 1260,660 S1400,780 1520,700" />
|
||||
</svg>
|
||||
</div>
|
||||
<div class="grain" aria-hidden="true"></div>
|
||||
|
||||
<header class="site-header">
|
||||
<a class="brand" href="https://programmschmiede.de/">programmschmiede<span>.de</span></a>
|
||||
<nav class="site-nav" aria-label="<?= $t['nav.label'] ?>">
|
||||
<a href="#features"><?= $t['nav.features'] ?></a>
|
||||
<a href="#downloads"><?= $t['nav.downloads'] ?></a>
|
||||
<a href="#neu"><?= $t['nav.news'] ?></a>
|
||||
<a class="nav-back" href="https://programmschmiede.de/"><?= $t['nav.home'] ?></a>
|
||||
<div class="lang-switch">
|
||||
<?php foreach ($langLabels as $code => $label): ?>
|
||||
<a href="/index.php?lang=<?= $code ?>" lang="<?= $code ?>" hreflang="<?= $code ?>"<?= $code === $lang ? ' aria-current="page"' : '' ?>><?= $label ?></a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<section class="hero">
|
||||
<p class="eyebrow"><?= $t['hero.eyebrow'] ?></p>
|
||||
<h1>Rinkplanner</h1>
|
||||
<p class="lede">
|
||||
<?= $t['hero.lede'] ?>
|
||||
</p>
|
||||
<div class="hero-actions">
|
||||
<a class="button button-primary" href="#downloads"><?= $t['hero.cta_download'] ?></a>
|
||||
<a class="button button-ghost" href="#features"><?= $t['hero.cta_features'] ?></a>
|
||||
</div>
|
||||
<p class="hero-meta"><?= $t['hero.meta'] ?></p>
|
||||
</section>
|
||||
|
||||
<section id="features" class="section">
|
||||
<div class="centered">
|
||||
<p class="section-kicker"><?= $t['features.kicker'] ?></p>
|
||||
<h2><?= $t['features.title'] ?></h2>
|
||||
<p class="section-lede">
|
||||
<?= $t['features.lede'] ?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="feature-grid">
|
||||
<?php foreach ($features as $feature): ?>
|
||||
<article class="feature-card">
|
||||
<div class="feature-icon" aria-hidden="true"><?= $feature['icon'] ?></div>
|
||||
<h3><?= $t[$feature['title']] ?></h3>
|
||||
<p><?= $t[$feature['body']] ?></p>
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="downloads" class="section downloads">
|
||||
<div class="centered">
|
||||
<p class="section-kicker"><?= $t['downloads.kicker'] ?></p>
|
||||
<h2><?= $t['downloads.title'] ?></h2>
|
||||
<p class="section-lede">
|
||||
<?= $t['downloads.lede'] ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="download-grid">
|
||||
<article class="download-card">
|
||||
<span class="os-badge">macOS</span>
|
||||
<h3><?= $t['downloads.mac.title'] ?></h3>
|
||||
<p><?= $t['downloads.mac.body'] ?></p>
|
||||
<a class="button button-primary" href="https://programmschmiede.de/rinkplanner/download/rinkplanner-setup.dmg" download>
|
||||
<?= $t['downloads.mac.cta'] ?> <span>65 MB</span>
|
||||
</a>
|
||||
<p class="hint">
|
||||
<?= $t['downloads.mac.hint'] ?>
|
||||
</p>
|
||||
</article>
|
||||
|
||||
<article class="download-card">
|
||||
<span class="os-badge">Windows</span>
|
||||
<h3><?= $t['downloads.windows.title'] ?></h3>
|
||||
<p><?= $t['downloads.windows.body'] ?></p>
|
||||
<a class="button button-primary" href="https://programmschmiede.de/rinkplanner/download/rinkplanner-setup.exe" download>
|
||||
<?= $t['downloads.windows.cta'] ?> <span>29 MB</span>
|
||||
</a>
|
||||
<p class="hint">
|
||||
<?= $t['downloads.windows.hint'] ?>
|
||||
</p>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
<p class="download-note">
|
||||
<?= $t['downloads.note'] ?>
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section id="neu" class="section">
|
||||
<div class="centered">
|
||||
<p class="section-kicker"><?= $t['news.kicker'] ?></p>
|
||||
<h2><?= $t['news.title'] ?></h2>
|
||||
<p class="section-lede">
|
||||
<?= $t['news.lede'] ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="release-list">
|
||||
<?php foreach ($releases as $release): ?>
|
||||
<article class="release-card">
|
||||
<div class="release-head">
|
||||
<span class="release-version"><?= $release['version'] ?></span>
|
||||
<span class="release-date"><?= $release['date'] ?></span>
|
||||
<?php if ($release['badge'] !== null): ?>
|
||||
<span class="release-badge"><?= $release['badge'] ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<ul>
|
||||
<?php foreach ($release['items'] as $item): ?>
|
||||
<li><?= $item ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="centered">
|
||||
<p class="section-kicker"><?= $t['rights.kicker'] ?></p>
|
||||
<h2><?= $t['rights.title'] ?></h2>
|
||||
</div>
|
||||
<div class="notes-grid">
|
||||
<article class="note-card">
|
||||
<h3><?= $t['rights.cloud.title'] ?></h3>
|
||||
<p><?= $t['rights.cloud.body'] ?></p>
|
||||
</article>
|
||||
<article class="note-card">
|
||||
<h3><?= $t['rights.music.title'] ?></h3>
|
||||
<p><?= $t['rights.music.body'] ?></p>
|
||||
</article>
|
||||
<article class="note-card">
|
||||
<h3><?= $t['rights.care.title'] ?></h3>
|
||||
<p><?= $t['rights.care.body'] ?></p>
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<footer class="site-footer">
|
||||
<span><?= $t['footer.copyright'] ?></span>
|
||||
<a href="https://programmschmiede.de/"><?= $t['footer.home'] ?></a>
|
||||
<a href="mailto:kontakt@programmschmiede.de"><?= $t['footer.contact'] ?></a>
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
(() => {
|
||||
const video = document.querySelector(".bg-video");
|
||||
if (!video) {
|
||||
return;
|
||||
}
|
||||
const reduceMotion = window.matchMedia("(prefers-reduced-motion: reduce)");
|
||||
const updateMotion = () => {
|
||||
if (reduceMotion.matches) {
|
||||
video.pause();
|
||||
} else {
|
||||
video.play().catch(() => {});
|
||||
}
|
||||
};
|
||||
video.addEventListener("error", () => document.body.classList.add("no-video"));
|
||||
if (reduceMotion.addEventListener) {
|
||||
reduceMotion.addEventListener("change", updateMotion);
|
||||
}
|
||||
updateMotion();
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue