modified: app.py

modified:   templates/redeem_giveaway.html
	modified:   templates/server_giveaways.html
	modified:   templates/user_giveaways.html
This commit is contained in:
SimolZimol
2024-10-29 10:09:44 +01:00
parent 476b0bc586
commit 364be4f769
4 changed files with 138 additions and 69 deletions

View File

@@ -8,38 +8,19 @@
</head>
<body>
{% include 'navigation.html' %}
<div class="container mt-5">
<h1 class="text-center">Giveaway Prize</h1>
<p class="text-center">Congratulations! You have won the giveaway for <strong>{{ giveaway.name }}</strong> on
<strong>{{ giveaway.platform }}</strong>.</p>
<h2>Redeem Giveaway - {{ giveaway.name }}</h2>
<p><strong>Platform:</strong> {{ giveaway.platform }}</p>
{% if key %}
<!-- Wenn der Key aufgedeckt wurde -->
<div class="card mt-4">
<div class="card-body">
<h5 class="card-title">Your Key</h5>
<p class="card-text">{{ key }}</p>
<div class="alert alert-success">
<strong>Game Key:</strong> {{ key }}
</div>
</div>
<a href="{{ url_for('user_giveaways') }}" class="btn btn-primary mt-4">Back to Giveaways</a>
{% else %}
<!-- Wenn der Key noch nicht aufgedeckt wurde -->
<div class="card mt-4">
<div class="card-body">
<h5 class="card-title">Claim Your Key</h5>
<p class="card-text">Do you want to reveal your game key? Once revealed, it will be marked as claimed and cannot be undone.</p>
<form method="POST">
<button type="submit" class="btn btn-success">Reveal Key</button>
</form>
</div>
</div>
<a href="{{ url_for('user_giveaways') }}" class="btn btn-secondary mt-4">Back to Giveaways</a>
<form method="post">
<button type="submit" class="btn btn-primary">Redeem Giveaway</button>
</form>
{% endif %}
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.2/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>

View File

@@ -28,7 +28,7 @@
<td>{{ giveaway.platform }}</td>
<td>{{ giveaway.winner_dc_id }}</td>
<td>
<a href="{{ url_for('edit_giveaway', giveaway_id=giveaway.id, guild_id=g.guild_id) }}" class="btn btn-warning">Edit</a>
<a href="{{ url_for('edit_giveaway', guild_id=guild_id, uuid=giveaway['uuid']) }}" class="btn btn-primary">Edit Giveaway</a>
<a href="{{ url_for('delete_giveaway', giveaway_id=giveaway.id, guild_id=g.guild_id) }}" class="btn btn-danger">Delete</a>
</td>
</tr>

View File

@@ -3,36 +3,37 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Your Giveaways</title>
<title>Your Won Giveaways</title>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
{% include 'navigation.html' %}
<div class="container mt-5">
<h1 class="text-center">Your Giveaways</h1>
<p class="text-center">Here you can view the giveaways you've won.</p>
<div class="row mt-4">
{% if giveaways %}
{% for giveaway in giveaways %}
<div class="col-md-4">
<div class="card">
<div class="card-body">
<h5 class="card-title">{{ giveaway.name }}</h5>
<p class="card-text">Platform: {{ giveaway.platform }}</p>
<a href="{{ url_for('redeem_giveaway', uuid=giveaway.uuid) }}" class="btn btn-primary">Claim Your Key</a>
</div>
</div>
</div>
{% endfor %}
{% else %}
<p class="text-center">You haven't won any giveaways yet.</p>
{% endif %}
</div>
<h2>Your Won Giveaways on Server {{ guild_id }}</h2>
<table class="table table-bordered mt-4">
<thead>
<tr>
<th>Name</th>
<th>Platform</th>
<th>Redeem</th>
</tr>
</thead>
<tbody>
{% for giveaway in won_giveaways %}
<tr>
<td>{{ giveaway.name }}</td>
<td>{{ giveaway.platform }}</td>
<td>
{% if giveaway.aktiv %}
<span class="badge badge-success">Redeemed</span>
{% else %}
<a href="{{ url_for('redeem_giveaway', guild_id=guild_id, uuid=giveaway['uuid']) }}" class="btn btn-primary btn-sm">Redeem</a>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.2/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>