modified: templates/user_giveaways.html

This commit is contained in:
SimolZimol
2024-10-29 10:58:14 +01:00
parent fb8d12c267
commit 3303398f81

View File

@@ -6,80 +6,68 @@
<title>Your Won Giveaways</title> <title>Your Won Giveaways</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>
.server-header { .table-container {
display: flex; background-color: #f8f9fa;
align-items: center; padding: 2rem;
margin-bottom: 2rem; border-radius: 10px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
} }
.server-header img { .status-badge {
border-radius: 50%; font-size: 0.9rem;
margin-right: 1rem; padding: 0.5em;
border-radius: 5px;
} }
.user-avatar { .redeem-btn {
width: 50px; font-size: 0.9rem;
height: 50px;
border-radius: 50%;
margin-right: 0.5rem;
} }
.table thead { h2 {
background-color: #343a40; color: #343a40;
color: #fff;
} }
</style> </style>
</head> </head>
<body> <body>
{% include 'navigation.html' %} {% include 'navigation.html' %}
<div class="container mt-5"> <div class="container mt-5">
<!-- Server and User Header --> <h2 class="text-center">Your Won Giveaways on Server {{ guild_id }}</h2>
<div class="server-header"> <p class="text-center text-muted">Here you can view all the giveaways you've won on this server.</p>
<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="table-container mt-4">
<div class="d-flex align-items-center mb-4"> <table class="table table-striped">
<img src="{{ g.user_info['avatar'] }}" alt="User Avatar" class="user-avatar"> <thead>
<h4>{{ g.user_info['username'] }}</h4> <tr>
<th scope="col">Name</th>
<th scope="col">Platform</th>
<th scope="col">Status</th>
<th scope="col" class="text-center">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 status-badge">Redeemed</span>
{% else %}
<span class="badge badge-warning status-badge">Not Redeemed</span>
{% endif %}
</td>
<td class="text-center">
{% if giveaway.aktiv %}
<a href="{{ url_for('redeem_giveaway', guild_id=guild_id, uuid=giveaway['uuid']) }}" class="btn btn-secondary btn-sm redeem-btn">View Key</a>
{% else %}
<a href="{{ url_for('redeem_giveaway', guild_id=guild_id, uuid=giveaway['uuid']) }}" class="btn btn-primary btn-sm redeem-btn">Redeem</a>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if won_giveaways|length == 0 %}
<p class="text-center text-muted">You haven't won any giveaways on this server yet.</p>
{% endif %}
</div> </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> </div>
</body> </body>
</html> </html>