modified: app.py

new file:   templates/redeem_giveaway.html
	modified:   templates/user_giveaways.html
This commit is contained in:
SimolZimol
2024-09-12 15:53:25 +02:00
parent 72eb412f09
commit 3d7be7c533
3 changed files with 60 additions and 61 deletions

View File

@@ -4,55 +4,34 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>User Giveaways</title>
<title>Your Giveaways</title>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="#">Giveaways</a>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="{{ url_for('user_dashboard') }}">User Dashboard</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url_for('logout') }}">Logout</a>
</li>
</ul>
</div>
</nav>
<div class="container mt-5">
<h1 class="text-center">Your Won Giveaways</h1>
{% if giveaways %}
<table class="table table-striped">
<thead>
<tr>
<th>Platform</th>
<th>Game</th>
<th>Redeem</th>
</tr>
</thead>
<tbody>
{% for giveaway in giveaways %}
<tr>
<td>{{ giveaway.platform }}</td>
<td>{{ giveaway.name }}</td>
<td>
<form method="POST" action="{{ url_for('redeem_giveaway', giveaway_uuid=giveaway.uuid) }}">
<button type="submit" class="btn btn-success">Redeem</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p class="text-center">You have not won any giveaways yet.</p>
{% endif %}
</div>
<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>
</div>
</body>
</html>