Update legal documents and localization for compliance and clarity
- Updated .env.example with legal operator details for compliance. - Refactored Impressum, Privacy, and Terms pages to utilize a new LegalDocument component for improved structure and maintainability. - Enhanced localization files to include legal content in both German and English, ensuring accurate representation of legal information. - Improved i18n handling to support locale detection from Accept-Language headers.
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
$config = require __DIR__ . '/config.php';
|
||||
require __DIR__ . '/includes/bootstrap.php';
|
||||
require __DIR__ . '/includes/layout.php';
|
||||
|
||||
$clientId = (string) $config['bot_client_id'];
|
||||
$inviteUrl = 'https://discord.com/api/oauth2/authorize?' . http_build_query([
|
||||
'client_id' => $clientId,
|
||||
'permissions' => '8',
|
||||
'scope' => 'bot applications.commands',
|
||||
], '', '&', PHP_QUERY_RFC3986);
|
||||
$locale = detect_locale();
|
||||
$messages = load_messages($locale);
|
||||
|
||||
$inviteUrl = bot_invite_url($config);
|
||||
$dashboardUrl = rtrim((string) $config['dashboard_url'], '/');
|
||||
$loginUrl = $dashboardUrl . '/login';
|
||||
$supportUrl = isset($config['support_url']) && $config['support_url'] !== ''
|
||||
@@ -18,7 +16,6 @@ $supportUrl = isset($config['support_url']) && $config['support_url'] !== ''
|
||||
|
||||
$guildCount = 0;
|
||||
$userCount = 0;
|
||||
|
||||
$statsApi = (string) ($config['stats_api_url'] ?? '');
|
||||
if ($statsApi !== '') {
|
||||
$ctx = stream_context_create([
|
||||
@@ -37,103 +34,41 @@ if ($statsApi !== '') {
|
||||
}
|
||||
}
|
||||
|
||||
$year = (int) date('Y');
|
||||
$numberLocale = $locale === 'de' ? 'de_DE' : 'en_US';
|
||||
$formatNumber = static function (int $value) use ($numberLocale): string {
|
||||
if (class_exists(NumberFormatter::class)) {
|
||||
$formatter = new NumberFormatter($numberLocale, NumberFormatter::DECIMAL);
|
||||
$formatted = $formatter->format($value);
|
||||
if ($formatted !== false) {
|
||||
return $formatted;
|
||||
}
|
||||
}
|
||||
return number_format($value, 0, $locale === 'de' ? ',' : '.', $locale === 'de' ? '.' : ',');
|
||||
};
|
||||
|
||||
$groups = [
|
||||
'moderation' => [
|
||||
'label' => 'Moderation',
|
||||
'modules' => [
|
||||
['label' => 'Moderation', 'description' => 'Bans, Verwarnungen, Timeouts und das Fall-System'],
|
||||
['label' => 'Auto-Moderation', 'description' => 'Spam-, Raid- und Nuke-Schutz'],
|
||||
['label' => 'Logging', 'description' => 'Log-Kanäle für Server-Events'],
|
||||
],
|
||||
],
|
||||
'engagement' => [
|
||||
'label' => 'Engagement',
|
||||
'modules' => [
|
||||
['label' => 'Willkommen & Abschied', 'description' => 'Join- und Leave-Nachrichten, Autoroles'],
|
||||
['label' => 'Verifizierung', 'description' => 'Button- und Captcha-Verifizierung'],
|
||||
['label' => 'Leveling & XP', 'description' => 'Text- und Voice-XP, Rollen-Belohnungen'],
|
||||
['label' => 'Economy', 'description' => 'Währung, Shop und Spiele'],
|
||||
['label' => 'Fun & Spiele', 'description' => 'Minispiele und Medien-Commands'],
|
||||
],
|
||||
],
|
||||
'community' => [
|
||||
'label' => 'Community',
|
||||
'modules' => [
|
||||
['label' => 'Giveaways', 'description' => 'Button-basierte Giveaways'],
|
||||
['label' => 'Tickets', 'description' => 'Support-Ticket-Panels und Transkripte'],
|
||||
['label' => 'Self Roles', 'description' => 'Reaktions-, Button- und Dropdown-Rollenpanels'],
|
||||
['label' => 'Starboard', 'description' => 'Beliebte Nachrichten hervorheben'],
|
||||
['label' => 'Vorschläge', 'description' => 'Community-Vorschläge mit Abstimmung'],
|
||||
['label' => 'Geburtstage', 'description' => 'Geburtstags-Ankündigungen und -Rollen'],
|
||||
],
|
||||
],
|
||||
'utility' => [
|
||||
'label' => 'Utility',
|
||||
'modules' => [
|
||||
['label' => 'Tags', 'description' => 'Custom Commands und Auto-Responder'],
|
||||
['label' => 'Temp-Voice', 'description' => 'Join-to-Create Voice-Kanäle'],
|
||||
],
|
||||
],
|
||||
'integrations' => [
|
||||
'label' => 'Integrationen',
|
||||
'modules' => [
|
||||
['label' => 'Server-Statistiken', 'description' => 'Automatische Statistik-Kanäle und Invites'],
|
||||
['label' => 'Social Feeds', 'description' => 'Twitch-, YouTube-, RSS- und Reddit-Benachrichtigungen'],
|
||||
['label' => 'Scheduler', 'description' => 'Geplante und wiederkehrende Ankündigungen'],
|
||||
['label' => 'Backups', 'description' => 'Server-Backup und -Wiederherstellung'],
|
||||
],
|
||||
],
|
||||
];
|
||||
/** @var array<string, array{label: string, modules: list<array{label: string, description: string}>}> $groups */
|
||||
$groups = $messages['module_groups'];
|
||||
|
||||
function h(?string $value): string
|
||||
{
|
||||
return htmlspecialchars((string) $value, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
|
||||
}
|
||||
render_header(
|
||||
$config,
|
||||
$messages,
|
||||
$locale,
|
||||
'Nexumi',
|
||||
t($messages, 'meta.description')
|
||||
);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Nexumi</title>
|
||||
<meta name="description" content="Discord-Bot mit Moderations-, Community- und Integrationsmodulen sowie Web-Dashboard.">
|
||||
<link rel="icon" href="assets/nexumi-logo.svg" type="image/svg+xml">
|
||||
<link rel="stylesheet" href="assets/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="shell">
|
||||
<header class="border-b">
|
||||
<div class="container bar">
|
||||
<a class="brand" href="/">
|
||||
<img src="assets/nexumi-logo.svg" alt="Nexumi" width="28" height="28">
|
||||
Nexumi
|
||||
</a>
|
||||
<nav>
|
||||
<a class="btn btn-ghost" href="<?= h((string) $config['status_url']) ?>">Status</a>
|
||||
<a class="btn btn-ghost" href="<?= h($inviteUrl) ?>" target="_blank" rel="noreferrer">Einladen</a>
|
||||
<?php if ($supportUrl): ?>
|
||||
<a class="btn btn-ghost" href="<?= h($supportUrl) ?>" target="_blank" rel="noreferrer">Support</a>
|
||||
<?php endif; ?>
|
||||
<a class="btn btn-primary" href="<?= h($loginUrl) ?>">Anmelden</a>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<section class="border-b">
|
||||
<div class="container hero">
|
||||
<div class="hero-brand">
|
||||
<img src="assets/nexumi-logo.svg" alt="" width="48" height="48">
|
||||
<h1>Nexumi</h1>
|
||||
</div>
|
||||
<p>Discord-Bot mit Moderations-, Community- und Integrationsmodulen sowie Web-Dashboard.</p>
|
||||
<p><?= h(t($messages, 'landing.subtitle')) ?></p>
|
||||
<div class="actions">
|
||||
<a class="btn btn-lg btn-primary" href="<?= h($inviteUrl) ?>" target="_blank" rel="noreferrer">Bot einladen</a>
|
||||
<a class="btn btn-lg btn-secondary" href="<?= h($loginUrl) ?>">Zum Dashboard</a>
|
||||
<a class="btn btn-lg btn-primary" href="<?= h($inviteUrl) ?>" target="_blank" rel="noreferrer"><?= h(t($messages, 'landing.invite')) ?></a>
|
||||
<a class="btn btn-lg btn-secondary" href="<?= h($loginUrl) ?>"><?= h(t($messages, 'landing.login')) ?></a>
|
||||
<?php if ($supportUrl): ?>
|
||||
<a class="btn btn-lg btn-outline" href="<?= h($supportUrl) ?>" target="_blank" rel="noreferrer">Support-Server</a>
|
||||
<a class="btn btn-lg btn-outline" href="<?= h($supportUrl) ?>" target="_blank" rel="noreferrer"><?= h(t($messages, 'landing.support')) ?></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -142,12 +77,12 @@ function h(?string $value): string
|
||||
<section class="border-b">
|
||||
<div class="container stats">
|
||||
<div class="card">
|
||||
<p class="card-label">Server</p>
|
||||
<p class="card-value"><?= h(number_format($guildCount, 0, ',', '.')) ?></p>
|
||||
<p class="card-label"><?= h(t($messages, 'landing.stats_guilds')) ?></p>
|
||||
<p class="card-value"><?= h($formatNumber($guildCount)) ?></p>
|
||||
</div>
|
||||
<div class="card">
|
||||
<p class="card-label">Nutzer (ca.)</p>
|
||||
<p class="card-value"><?= h(number_format($userCount, 0, ',', '.')) ?></p>
|
||||
<p class="card-label"><?= h(t($messages, 'landing.stats_users')) ?></p>
|
||||
<p class="card-value"><?= h($formatNumber($userCount)) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -155,8 +90,8 @@ function h(?string $value): string
|
||||
<section>
|
||||
<div class="container features">
|
||||
<div class="intro">
|
||||
<h2>Module</h2>
|
||||
<p>Funktionen, die Nexumi pro Server bereitstellt.</p>
|
||||
<h2><?= h(t($messages, 'landing.features_title')) ?></h2>
|
||||
<p><?= h(t($messages, 'landing.features_subtitle')) ?></p>
|
||||
</div>
|
||||
<?php foreach ($groups as $group): ?>
|
||||
<div class="group">
|
||||
@@ -173,20 +108,5 @@ function h(?string $value): string
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<footer class="border-t">
|
||||
<div class="container bar">
|
||||
<p>© <?= $year ?> Nexumi</p>
|
||||
<nav>
|
||||
<a href="<?= h((string) $config['status_url']) ?>">Status</a>
|
||||
<a href="<?= h((string) $config['impressum_url']) ?>">Impressum</a>
|
||||
<a href="<?= h((string) $config['privacy_url']) ?>">Datenschutz</a>
|
||||
<a href="<?= h((string) $config['terms_url']) ?>">Nutzungsbedingungen</a>
|
||||
<a href="<?= h($dashboardUrl . '/dashboard') ?>">Dashboard</a>
|
||||
</nav>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
render_footer($config, $messages);
|
||||
|
||||
Reference in New Issue
Block a user