modified: app.py

modified:   templates/user_giveaways.html
This commit is contained in:
SimolZimol
2024-10-29 11:00:38 +01:00
parent 3303398f81
commit 276da56fdb
2 changed files with 8 additions and 3 deletions

7
app.py
View File

@@ -510,10 +510,15 @@ def user_giveaways(guild_id):
""", (user_id, guild_id)) """, (user_id, guild_id))
won_giveaways = cursor.fetchall() won_giveaways = cursor.fetchall()
# Hole den Servernamen aus der guilds-Tabelle
cursor.execute("SELECT name FROM guilds WHERE guild_id = %s", (guild_id,))
guild_name_result = cursor.fetchone()
guild_name = guild_name_result["name"] if guild_name_result else f"Server {guild_id}"
cursor.close() cursor.close()
connection.close() connection.close()
return render_template("user_giveaways.html", won_giveaways=won_giveaways, guild_id=guild_id) return render_template("user_giveaways.html", won_giveaways=won_giveaways, guild_id=guild_id, guild_name=guild_name)
return redirect(url_for("landing_page")) return redirect(url_for("landing_page"))

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>Your Won Giveaways</title> <title>Your Won Giveaways - {{ 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">
<style> <style>
.table-container { .table-container {
@@ -28,7 +28,7 @@
<body> <body>
{% include 'navigation.html' %} {% include 'navigation.html' %}
<div class="container mt-5"> <div class="container mt-5">
<h2 class="text-center">Your Won Giveaways on Server {{ guild_id }}</h2> <h2 class="text-center">Your Won Giveaways on {{ guild_name }}</h2>
<p class="text-center text-muted">Here you can view all the giveaways you've won on this server.</p> <p class="text-center text-muted">Here you can view all the giveaways you've won on this server.</p>
<div class="table-container mt-4"> <div class="table-container mt-4">