AstraOS Ver. 1.9.2:
- Age Verification löschen hinzugefügt - Wörter abgeändert
This commit is contained in:
parent
1b7a12f8e2
commit
cf8217bd75
|
|
@ -31,7 +31,7 @@
|
|||
</div>
|
||||
<div>
|
||||
<label for="steam_id" class="block text-sm font-medium text-gray-300">SteamID</label>
|
||||
<input type="text" name="steam_id" id="steam_id" placeholder="z.B. STEAM_0:1:23456789" required
|
||||
<input type="text" name="steam_id" id="steam_id" placeholder="z.B. 76561199045670704@steam" required
|
||||
class="mt-1 w-full px-3 py-2 bg-gray-800 border border-gray-700 rounded-lg text-white focus:outline-none focus:ring-2 {% if maintenance_active %}focus:ring-yellow-500{% else %}focus:ring-purple-500{% endif %}">
|
||||
</div>
|
||||
<div>
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
<h4 class="text-xl font-semibold mb-2">Ergebnis</h4>
|
||||
<p class="text-lg">Die Person ist <span class="font-bold {% if result.age < 13 %}text-red-400{% else %}text-green-400{% endif %}">{{ result.age }}</span> Jahre alt.</p>
|
||||
{% if result.age < 13 %}
|
||||
<p class="text-lg mt-2">Diese Person muss für <span class="font-bold text-yellow-400">{{ result.ban_duration_days }}</span> Tage gesperrt werden.</p>
|
||||
<p class="text-lg mt-2">Diese Person muss für <span class="font-bold text-yellow-400">{{ result.ban_duration_days }}</span> Tage gebannt werden.</p>
|
||||
<div class="mt-4">
|
||||
<label for="ban-command" class="block text-sm font-medium text-gray-300">Bann-Befehl</label>
|
||||
<div class="flex items-center gap-2 mt-1">
|
||||
|
|
|
|||
|
|
@ -2,15 +2,20 @@
|
|||
|
||||
{% block title %}AstraOS — Benutzerdetails{% endblock %}
|
||||
|
||||
{% block head %}
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<header class="flex justify-between items-center mb-6">
|
||||
<div x-data="{ showDeleteModal: false }">
|
||||
<header class="flex justify-between items-center mb-6">
|
||||
<h2 class="text-4xl font-bold tracking-wide {% if maintenance_active %}text-yellow-300{% else %}text-purple-300{% endif %}">Benutzerdetails</h2>
|
||||
<a href="{{ url_for('age_verification') }}" class="font-bold py-2 px-4 rounded-lg transition text-white {% if maintenance_active %}bg-yellow-600 hover:bg-yellow-700{% else %}bg-purple-600 hover:bg-purple-700{% endif %}">
|
||||
← Zurück
|
||||
</a>
|
||||
</header>
|
||||
</header>
|
||||
|
||||
<div class="bg-black/40 p-6 rounded-xl backdrop-blur border {% if maintenance_active %}border-yellow-500/30{% else %}border-purple-500/20{% endif %}">
|
||||
<div class="bg-black/40 p-6 rounded-xl backdrop-blur border {% if maintenance_active %}border-yellow-500/30{% else %}border-purple-500/20{% endif %}">
|
||||
<div class="space-y-3">
|
||||
<div>
|
||||
<p class="text-sm text-gray-400">Ingame Name</p>
|
||||
|
|
@ -25,7 +30,7 @@
|
|||
<p class="text-xl font-semibold">{{ user.birthdate }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-sm text-gray-400">Alter bei Überprüfung</p>
|
||||
<p class="text-sm text-gray-400">Aktuelles Alter</p>
|
||||
<p class="text-xl font-bold {% if user.age < 13 %}text-red-400{% else %}text-green-400{% endif %}">{{ user.age }} Jahre</p>
|
||||
</div>
|
||||
<div>
|
||||
|
|
@ -54,6 +59,26 @@
|
|||
<p class="text-lg text-green-400">Keine Sperre erforderlich.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="mt-6 border-t {% if maintenance_active %}border-yellow-500/30{% else %}border-purple-500/20{% endif %} pt-6 flex justify-end">
|
||||
<button @click="showDeleteModal = true" class="font-bold py-2 px-4 rounded-lg transition text-white bg-red-600 hover:bg-red-700">
|
||||
Eintrag löschen
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- DELETE CONFIRMATION MODAL -->
|
||||
<div x-show="showDeleteModal" @keydown.escape.window="showDeleteModal = false" class="fixed inset-0 bg-black/70 backdrop-blur-sm flex items-center justify-center z-50" style="display: none;">
|
||||
<div @click.away="showDeleteModal = false" class="bg-gray-900 border border-red-500/50 rounded-xl shadow-2xl p-8 w-full max-w-md">
|
||||
<h3 class="text-2xl font-bold text-red-400 mb-4">Eintrag löschen</h3>
|
||||
<p class="text-gray-300 mb-6">Möchten Sie diesen Altersnachweis wirklich endgültig löschen?</p>
|
||||
<form action="{{ url_for('delete_age_verification', user_id=user._id) }}" method="POST" class="flex justify-end gap-4">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
||||
<button type="button" @click="showDeleteModal = false" class="px-4 py-2 rounded-lg text-gray-300 hover:bg-gray-700 transition">Abbrechen</button>
|
||||
<button type="submit" class="px-4 py-2 bg-red-600 hover:bg-red-700 text-white font-semibold rounded-lg transition">Löschen</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
|
@ -71,4 +96,3 @@ function copyToClipboard(elementId) {
|
|||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
|||
|
|
@ -693,6 +693,12 @@ def delete_role(role_id):
|
|||
roles_collection.delete_one({'_id': ObjectId(role_id)})
|
||||
flash("Rolle wurde gelöscht.", "success")
|
||||
return redirect(url_for('role_management'))
|
||||
|
||||
def calculate_current_age(birthdate_str):
|
||||
birthdate_dt = datetime.strptime(birthdate_str, '%Y-%m-%d')
|
||||
today = datetime.today()
|
||||
return today.year - birthdate_dt.year - ((today.month, today.day) < (birthdate_dt.month, birthdate_dt.day))
|
||||
|
||||
@app.route('/age_verification', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
@permission_required('view_age_verification')
|
||||
|
|
@ -739,6 +745,9 @@ def age_verification():
|
|||
else:
|
||||
users = list(age_verification_collection.find().sort("timestamp", -1).limit(10))
|
||||
|
||||
for user in users:
|
||||
user['age'] = calculate_current_age(user['birthdate'])
|
||||
|
||||
return render_template('age_verification.html',
|
||||
active_page='age_verification',
|
||||
result=result,
|
||||
|
|
@ -754,6 +763,8 @@ def view_user_age_details(user_id):
|
|||
flash("Benutzer nicht gefunden.", "danger")
|
||||
return redirect(url_for('age_verification'))
|
||||
|
||||
user['age'] = calculate_current_age(user['birthdate'])
|
||||
|
||||
result = None
|
||||
if user.get('age') < 13:
|
||||
today = datetime.today()
|
||||
|
|
@ -770,6 +781,15 @@ def view_user_age_details(user_id):
|
|||
active_page='age_verification',
|
||||
user=user,
|
||||
result=result)
|
||||
|
||||
@app.route('/age_verification/delete/<user_id>', methods=['POST'])
|
||||
@login_required
|
||||
@permission_required('view_age_verification')
|
||||
def delete_age_verification(user_id):
|
||||
age_verification_collection.delete_one({'_id': ObjectId(user_id)})
|
||||
flash("Eintrag zur Altersüberprüfung wurde gelöscht.", "success")
|
||||
return redirect(url_for('age_verification'))
|
||||
|
||||
@app.route('/ip_analyzer', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
@permission_required('view_ip_analyzer')
|
||||
|
|
|
|||
Loading…
Reference in a new issue