modified: templates/server_settings.html

This commit is contained in:
SimolZimol
2025-08-19 18:38:41 +02:00
parent 196d2ac570
commit 02537b78d7

View File

@@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Server-Einstellungen - {{ guild_name }}</title> <title>Server Settings - {{ guild_name }}</title>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"> <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet"> <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<style> <style>
@@ -226,7 +226,7 @@
<div class="header-section"> <div class="header-section">
<h1 class="header-title"> <h1 class="header-title">
<i class="fas fa-cogs header-icon"></i> <i class="fas fa-cogs header-icon"></i>
Server-Einstellungen Server Settings
</h1> </h1>
<p class="server-name">{{ guild_name }}</p> <p class="server-name">{{ guild_name }}</p>
</div> </div>
@@ -244,38 +244,38 @@
{% endwith %} {% endwith %}
<form method="POST"> <form method="POST">
<!-- Mute-Einstellungen --> <!-- Mute Settings -->
<div class="settings-section"> <div class="settings-section">
<h3 class="section-title"> <h3 class="section-title">
<i class="fas fa-volume-mute section-icon"></i> <i class="fas fa-volume-mute section-icon"></i>
Mute-Einstellungen Mute Settings
</h3> </h3>
<div class="info-card"> <div class="info-card">
<div class="info-card-title"> <div class="info-card-title">
<i class="fas fa-info-circle"></i> <i class="fas fa-info-circle"></i>
Hinweis zu Rollen-IDs Role ID Information
</div> </div>
<p class="info-card-text"> <p class="info-card-text">
Um eine Rollen-ID zu finden: Rechtsklick auf die Rolle → "ID kopieren" (Entwicklermodus muss aktiviert sein) To find a role ID: Right-click on the role → "Copy ID" (Developer mode must be enabled)
</p> </p>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group"> <div class="form-group">
<label for="mute_role_id">Mute-Rollen-ID</label> <label for="mute_role_id">Mute Role ID</label>
<input type="text" class="form-control" id="mute_role_id" name="mute_role_id" <input type="text" class="form-control" id="mute_role_id" name="mute_role_id"
value="{{ settings.mute_role_id or '' }}" placeholder="z.B. 123456789012345678"> value="{{ settings.mute_role_id or '' }}" placeholder="e.g. 123456789012345678">
<small class="help-text">Leer lassen für automatische Suche nach Name</small> <small class="help-text">Leave empty for automatic search by name</small>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group"> <div class="form-group">
<label for="mute_role_name">Mute-Rollen-Name</label> <label for="mute_role_name">Mute Role Name</label>
<input type="text" class="form-control" id="mute_role_name" name="mute_role_name" <input type="text" class="form-control" id="mute_role_name" name="mute_role_name"
value="{{ settings.mute_role_name }}" placeholder="Muted" required> value="{{ settings.mute_role_name }}" placeholder="Muted" required>
<small class="help-text">Name für automatisch erstellte Mute-Rollen</small> <small class="help-text">Name for automatically created mute roles</small>
</div> </div>
</div> </div>
</div> </div>
@@ -284,34 +284,34 @@
<input class="form-check-input" type="checkbox" id="auto_create_mute_role" <input class="form-check-input" type="checkbox" id="auto_create_mute_role"
name="auto_create_mute_role" {% if settings.auto_create_mute_role %}checked{% endif %}> name="auto_create_mute_role" {% if settings.auto_create_mute_role %}checked{% endif %}>
<label class="form-check-label" for="auto_create_mute_role"> <label class="form-check-label" for="auto_create_mute_role">
Mute-Rolle automatisch erstellen Auto-create mute role
</label> </label>
<small class="help-text d-block">Erstellt automatisch eine Mute-Rolle, falls keine gefunden wird</small> <small class="help-text d-block">Automatically creates a mute role if none is found</small>
</div> </div>
</div> </div>
<!-- Warn-Einstellungen --> <!-- Warning Settings -->
<div class="settings-section"> <div class="settings-section">
<h3 class="section-title"> <h3 class="section-title">
<i class="fas fa-exclamation-triangle section-icon"></i> <i class="fas fa-exclamation-triangle section-icon"></i>
Warn-Einstellungen Warning Settings
</h3> </h3>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group"> <div class="form-group">
<label for="max_warn_threshold">Maximale Warnungen</label> <label for="max_warn_threshold">Maximum Warnings</label>
<input type="number" class="form-control" id="max_warn_threshold" name="max_warn_threshold" <input type="number" class="form-control" id="max_warn_threshold" name="max_warn_threshold"
value="{{ settings.max_warn_threshold }}" min="1" max="10" required> value="{{ settings.max_warn_threshold }}" min="1" max="10" required>
<small class="help-text">Anzahl Warnungen vor automatischen Aktionen</small> <small class="help-text">Number of warnings before automatic actions</small>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group"> <div class="form-group">
<label for="auto_mute_duration">Auto-Mute-Dauer</label> <label for="auto_mute_duration">Auto-Mute Duration</label>
<input type="text" class="form-control" id="auto_mute_duration" name="auto_mute_duration" <input type="text" class="form-control" id="auto_mute_duration" name="auto_mute_duration"
value="{{ settings.auto_mute_duration }}" placeholder="1h" required> value="{{ settings.auto_mute_duration }}" placeholder="1h" required>
<small class="help-text">Format: 10m, 1h, 2d (Minuten, Stunden, Tage)</small> <small class="help-text">Format: 10m, 1h, 2d (minutes, hours, days)</small>
</div> </div>
</div> </div>
</div> </div>
@@ -320,43 +320,43 @@
<input class="form-check-input" type="checkbox" id="auto_mute_on_warns" <input class="form-check-input" type="checkbox" id="auto_mute_on_warns"
name="auto_mute_on_warns" {% if settings.auto_mute_on_warns %}checked{% endif %}> name="auto_mute_on_warns" {% if settings.auto_mute_on_warns %}checked{% endif %}>
<label class="form-check-label" for="auto_mute_on_warns"> <label class="form-check-label" for="auto_mute_on_warns">
Automatischer Mute bei zu vielen Warnungen Automatic mute on too many warnings
</label> </label>
<small class="help-text d-block">Mutet Benutzer automatisch bei Erreichen des Warn-Limits</small> <small class="help-text d-block">Automatically mutes users when they reach the warning limit</small>
</div> </div>
</div> </div>
<!-- Log-Einstellungen --> <!-- Log Settings -->
<div class="settings-section"> <div class="settings-section">
<h3 class="section-title"> <h3 class="section-title">
<i class="fas fa-clipboard-list section-icon"></i> <i class="fas fa-clipboard-list section-icon"></i>
Log-Einstellungen Log Settings
</h3> </h3>
<div class="form-group"> <div class="form-group">
<label for="log_channel_id">Log-Kanal-ID</label> <label for="log_channel_id">Log Channel ID</label>
<input type="text" class="form-control" id="log_channel_id" name="log_channel_id" <input type="text" class="form-control" id="log_channel_id" name="log_channel_id"
value="{{ settings.log_channel_id or '' }}" placeholder="z.B. 123456789012345678"> value="{{ settings.log_channel_id or '' }}" placeholder="e.g. 123456789012345678">
<small class="help-text">Kanal für Moderations-Logs (leer lassen zum Deaktivieren)</small> <small class="help-text">Channel for moderation logs (leave empty to disable)</small>
</div> </div>
<div class="form-check"> <div class="form-check">
<input class="form-check-input" type="checkbox" id="mod_log_enabled" <input class="form-check-input" type="checkbox" id="mod_log_enabled"
name="mod_log_enabled" {% if settings.mod_log_enabled %}checked{% endif %}> name="mod_log_enabled" {% if settings.mod_log_enabled %}checked{% endif %}>
<label class="form-check-label" for="mod_log_enabled"> <label class="form-check-label" for="mod_log_enabled">
Moderations-Logs aktiviert Moderation logs enabled
</label> </label>
<small class="help-text d-block">Protokolliert alle Moderationsaktionen</small> <small class="help-text d-block">Logs all moderation actions</small>
</div> </div>
</div> </div>
<!-- Action Buttons --> <!-- Action Buttons -->
<div class="text-center"> <div class="text-center">
<button type="submit" class="btn btn-primary mr-3"> <button type="submit" class="btn btn-primary mr-3">
<i class="fas fa-save"></i> Einstellungen speichern <i class="fas fa-save"></i> Save Settings
</button> </button>
<a href="{{ url_for('server_admin_dashboard', guild_id=guild_id) }}" class="btn btn-secondary"> <a href="{{ url_for('server_admin_dashboard', guild_id=guild_id) }}" class="btn btn-secondary">
<i class="fas fa-arrow-left"></i> Zurück zum Dashboard <i class="fas fa-arrow-left"></i> Back to Dashboard
</a> </a>
</div> </div>
</form> </form>
@@ -366,29 +366,29 @@
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.2/dist/js/bootstrap.bundle.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.2/dist/js/bootstrap.bundle.min.js"></script>
<script> <script>
// Formular-Validierung // Form validation
document.querySelector('form').addEventListener('submit', function(e) { document.querySelector('form').addEventListener('submit', function(e) {
const muteRoleId = document.getElementById('mute_role_id').value; const muteRoleId = document.getElementById('mute_role_id').value;
const logChannelId = document.getElementById('log_channel_id').value; const logChannelId = document.getElementById('log_channel_id').value;
const muteDuration = document.getElementById('auto_mute_duration').value; const muteDuration = document.getElementById('auto_mute_duration').value;
// Validiere Rollen-ID Format (falls angegeben) // Validate role ID format (if provided)
if (muteRoleId && !/^\d{17,19}$/.test(muteRoleId)) { if (muteRoleId && !/^\d{17,19}$/.test(muteRoleId)) {
alert('Mute-Rollen-ID muss eine 17-19 stellige Zahl sein'); alert('Mute Role ID must be a 17-19 digit number');
e.preventDefault(); e.preventDefault();
return; return;
} }
// Validiere Log-Kanal-ID Format (falls angegeben) // Validate log channel ID format (if provided)
if (logChannelId && !/^\d{17,19}$/.test(logChannelId)) { if (logChannelId && !/^\d{17,19}$/.test(logChannelId)) {
alert('Log-Kanal-ID muss eine 17-19 stellige Zahl sein'); alert('Log Channel ID must be a 17-19 digit number');
e.preventDefault(); e.preventDefault();
return; return;
} }
// Validiere Zeitformat // Validate time format
if (muteDuration && !/^\d+[mhd]$/.test(muteDuration)) { if (muteDuration && !/^\d+[mhd]$/.test(muteDuration)) {
alert('Auto-Mute-Dauer muss im Format "10m", "1h" oder "2d" sein'); alert('Auto-Mute Duration must be in format "10m", "1h" or "2d"');
e.preventDefault(); e.preventDefault();
return; return;
} }