modified: Dockerfile
modified: app.py modified: bot.py new file: templates/admin_giveaways.html new file: templates/edit_giveaway.html new file: templates/user_giveaways.html
This commit is contained in:
74
templates/admin_giveaways.html
Normal file
74
templates/admin_giveaways.html
Normal file
@@ -0,0 +1,74 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Admin - Giveaways</title>
|
||||
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
|
||||
<style>
|
||||
th a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
||||
<a class="navbar-brand" href="#">Multus Bot - Admin 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('admin_dashboard') }}">Admin 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">Giveaways Management</h1>
|
||||
<table class="table table-bordered table-hover mt-4">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th><a href="{{ url_for('admin_giveaways', sort='id', order='asc' if sort_field == 'id' and order == 'desc' else 'desc') }}">ID</a></th>
|
||||
<th><a href="{{ url_for('admin_giveaways', sort='platform', order='asc' if sort_field == 'platform' and order == 'desc' else 'desc') }}">Platform</a></th>
|
||||
<th><a href="{{ url_for('admin_giveaways', sort='name', order='asc' if sort_field == 'name' and order == 'desc' else 'desc') }}">Name</a></th>
|
||||
<th>Game Key</th>
|
||||
<th>Winner Discord ID</th>
|
||||
<th>Active</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for giveaway in giveaways %}
|
||||
<tr>
|
||||
<td>{{ giveaway.id }}</td>
|
||||
<td>{{ giveaway.platform }}</td>
|
||||
<td>{{ giveaway.name }}</td>
|
||||
<td>{{ giveaway.game_key }}</td>
|
||||
<td>{{ giveaway.winner_dc_id or 'Not Assigned' }}</td>
|
||||
<td>
|
||||
{% if giveaway.aktiv %}
|
||||
<span class="badge badge-success">Active</span>
|
||||
{% else %}
|
||||
<span class="badge badge-danger">Inactive</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ url_for('edit_giveaway', giveaway_id=giveaway.id) }}" class="btn btn-primary btn-sm">Edit</a>
|
||||
</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>
|
||||
57
templates/edit_giveaway.html
Normal file
57
templates/edit_giveaway.html
Normal file
@@ -0,0 +1,57 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Edit Giveaway</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="#">Multus Bot - Edit Giveaway</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('admin_giveaways') }}">Back to Giveaways</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">Edit Giveaway: {{ giveaway.name }}</h1>
|
||||
<form method="POST">
|
||||
<div class="form-group">
|
||||
<label for="platform">Platform</label>
|
||||
<input type="text" class="form-control" id="platform" name="platform" value="{{ giveaway.platform }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="name">Giveaway Name</label>
|
||||
<input type="text" class="form-control" id="name" name="name" value="{{ giveaway.name }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="game_key">Game Key</label>
|
||||
<input type="text" class="form-control" id="game_key" name="game_key" value="{{ giveaway.game_key }}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="winner_dc_id">Winner Discord ID</label>
|
||||
<input type="number" class="form-control" id="winner_dc_id" name="winner_dc_id" value="{{ giveaway.winner_dc_id }}">
|
||||
</div>
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" id="aktiv" name="aktiv" {% if giveaway.aktiv %}checked{% endif %}>
|
||||
<label class="form-check-label" for="aktiv">Active</label>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Save Changes</button>
|
||||
</form>
|
||||
</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>
|
||||
75
templates/user_giveaways.html
Normal file
75
templates/user_giveaways.html
Normal file
@@ -0,0 +1,75 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>My Giveaways</title>
|
||||
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
|
||||
<style>
|
||||
.container {
|
||||
margin-top: 50px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Navbar -->
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
||||
<a class="navbar-brand" href="#">Multus Bot - My 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>
|
||||
|
||||
<!-- Giveaways List -->
|
||||
<div class="container">
|
||||
<h1 class="text-center">Giveaways You've Won</h1>
|
||||
<div class="row mt-5">
|
||||
<div class="col-md-12">
|
||||
{% if giveaways %}
|
||||
<table class="table table-bordered">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Platform</th>
|
||||
<th>Name</th>
|
||||
<th>Game Key</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for giveaway in giveaways %}
|
||||
<tr>
|
||||
<td>{{ giveaway.id }}</td>
|
||||
<td>{{ giveaway.platform }}</td>
|
||||
<td>{{ giveaway.name }}</td>
|
||||
<td>{{ giveaway.game_key }}</td>
|
||||
<td>
|
||||
<form method="POST" action="{{ url_for('redeem_giveaway', giveaway_id=giveaway.id) }}">
|
||||
<button type="submit" class="btn btn-success">Redeem Prize</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p class="text-center">You have not won any giveaways yet.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</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>
|
||||
Reference in New Issue
Block a user