modified: templates/user_giveaways.html

This commit is contained in:
SimolZimol
2024-10-29 10:55:03 +01:00
parent 7c6214d74e
commit fb8d12c267

View File

@@ -5,64 +5,81 @@
<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">
<div class="text-center mb-4">
<h1>{{ g.user_info['username'] }}'s Won Giveaways</h1>
<p class="text-muted">Server: <strong>{{ g.guild_name }}</strong> (ID: {{ g.guild_id }})</p>
<!-- 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>
{% if won_giveaways %}
<div class="table-responsive">
<table class="table table-hover table-bordered mt-4">
<thead class="thead-dark">
<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>
{% if giveaway.aktiv %}
<span class="badge badge-success">Redeemed <i class="fas fa-check-circle"></i></span>
{% else %}
<span class="badge badge-warning">Not Redeemed <i class="fas fa-hourglass-half"></i></span>
{% endif %}
</td>
<td>
{% 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">
<i class="fas fa-eye"></i> 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">
<i class="fas fa-gift"></i> Redeem
</a>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<!-- 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>
{% else %}
<div class="alert alert-info text-center" role="alert">
You have not won any giveaways on this server yet.
</div>
{% endif %}
<!-- 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>
<!-- Optional: Include FontAwesome for icons -->
<script src="https://kit.fontawesome.com/a076d05399.js"></script>
</body>
</html>