Files
Discord-ai-chatbot/templates/user_giveaways.html
2024-10-29 10:55:03 +01:00

86 lines
3.0 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Your Won Giveaways</title>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
<style>
.server-header {
display: flex;
align-items: center;
margin-bottom: 2rem;
}
.server-header img {
border-radius: 50%;
margin-right: 1rem;
}
.user-avatar {
width: 50px;
height: 50px;
border-radius: 50%;
margin-right: 0.5rem;
}
.table thead {
background-color: #343a40;
color: #fff;
}
</style>
</head>
<body>
{% include 'navigation.html' %}
<div class="container mt-5">
<!-- Server and User Header -->
<div class="server-header">
<img src="{{ g.guild_logo }}" alt="Server Logo" width="80" height="80">
<div>
<h2>{{ g.guild_name }}</h2>
<p class="text-muted">Your Won Giveaways on this server</p>
</div>
</div>
<!-- User Avatar and Name -->
<div class="d-flex align-items-center mb-4">
<img src="{{ g.user_info['avatar'] }}" alt="User Avatar" class="user-avatar">
<h4>{{ g.user_info['username'] }}</h4>
</div>
<!-- Giveaways Table -->
<table class="table table-hover table-bordered">
<thead class="text-center">
<tr>
<th>Name</th>
<th>Platform</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{% for giveaway in won_giveaways %}
<tr>
<td>{{ giveaway.name }}</td>
<td>{{ giveaway.platform }}</td>
<td class="text-center">
{% if giveaway.aktiv %}
<span class="badge badge-success">Redeemed</span>
{% else %}
<span class="badge badge-warning">Not Redeemed</span>
{% endif %}
</td>
<td class="text-center">
{% if giveaway.aktiv %}
<!-- Link to view the redeemed key -->
<a href="{{ url_for('redeem_giveaway', guild_id=g.guild_id, uuid=giveaway['uuid']) }}" class="btn btn-secondary btn-sm">View Key</a>
{% else %}
<!-- Link to redeem the giveaway -->
<a href="{{ url_for('redeem_giveaway', guild_id=g.guild_id, uuid=giveaway['uuid']) }}" class="btn btn-primary btn-sm">Redeem</a>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</body>
</html>