2022-09-07 16:44:59 +02:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
2022-09-08 13:17:58 +02:00
|
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
2023-03-14 16:26:04 +01:00
|
|
|
|
2022-09-07 16:44:59 +02:00
|
|
|
<head>
|
|
|
|
<title>Redeems Dashboard</title>
|
|
|
|
</head>
|
2022-11-09 14:35:45 +01:00
|
|
|
<div id="script">
|
2022-10-18 14:04:15 +02:00
|
|
|
|
2023-03-14 16:26:04 +01:00
|
|
|
<script src="/static/dashboard.js"></script>
|
2022-10-12 15:48:57 +02:00
|
|
|
|
2022-11-09 14:35:45 +01:00
|
|
|
<div class="tab">
|
2023-03-14 16:26:04 +01:00
|
|
|
<button class="tablinks" onclick="openTab(event, 'dashboard')" , id="defaultOpen">Tlapbot dashboard</button>
|
2023-03-13 15:22:40 +01:00
|
|
|
{% if not passive %}
|
2023-03-14 15:42:14 +01:00
|
|
|
{% if queue %}
|
|
|
|
<button class="tablinks" onclick="openTab(event, 'redeem-queue')">Redeem queue</button>
|
|
|
|
{% endif %}
|
2022-11-09 14:54:00 +01:00
|
|
|
<button class="tablinks" onclick="openTab(event, 'redeems-list')">Redeems help</button>
|
2023-03-13 15:22:40 +01:00
|
|
|
{% endif %}
|
2022-11-09 14:35:45 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id='dashboard' class="tabcontent">
|
2023-03-14 16:26:04 +01:00
|
|
|
|
2022-11-09 14:35:45 +01:00
|
|
|
<body>
|
|
|
|
<h3>Redeems Dashboard</h3>
|
|
|
|
{% if (username and users ) %}
|
|
|
|
<table>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2022-11-09 14:40:27 +01:00
|
|
|
<th>Your points balance</th>
|
2022-11-09 14:35:45 +01:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2024-02-03 18:47:42 +01:00
|
|
|
{% for user in users %}
|
|
|
|
<tr>
|
|
|
|
<td> {{ user[0] }} </td>
|
|
|
|
<td> {{ user[1] }} </td>
|
|
|
|
</tr>
|
2022-11-09 14:35:45 +01:00
|
|
|
{% endfor %}
|
2024-02-03 18:47:42 +01:00
|
|
|
</tbody>
|
2022-11-09 14:35:45 +01:00
|
|
|
</table>
|
2022-10-13 14:09:12 +02:00
|
|
|
{% endif %}
|
2022-11-09 14:35:45 +01:00
|
|
|
|
2023-03-13 15:22:40 +01:00
|
|
|
{% if passive %}
|
|
|
|
<h3>Tlapbot is currently in passive mode.</h3>
|
|
|
|
<p>You can't make any redeems, but you will receive points for watching.</p>
|
2022-11-07 17:30:00 +01:00
|
|
|
{% endif %}
|
2022-11-09 14:35:45 +01:00
|
|
|
|
2023-03-13 15:22:40 +01:00
|
|
|
{% if not passive %}
|
2023-03-14 15:42:14 +01:00
|
|
|
{% if counters %}
|
|
|
|
<table>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Active counters</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
2023-03-13 15:22:40 +01:00
|
|
|
<tbody>
|
2024-02-03 18:47:42 +01:00
|
|
|
{% for counter in counters %}
|
|
|
|
<tr>
|
|
|
|
<td> {{ counter[0] }} </td>
|
|
|
|
<td> {{ counter[1] }} </td>
|
|
|
|
</tr>
|
2023-03-14 15:42:14 +01:00
|
|
|
{% endfor %}
|
2024-02-03 18:47:42 +01:00
|
|
|
</tbody>
|
2023-03-14 15:42:14 +01:00
|
|
|
</table>
|
|
|
|
{% endif %}
|
|
|
|
{% if milestones %}
|
2023-03-14 16:26:04 +01:00
|
|
|
<table>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2023-03-14 16:43:26 +01:00
|
|
|
<th colspan="2">Active milestones</th>
|
|
|
|
<th>Progress</th>
|
2023-03-14 16:26:04 +01:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2024-02-03 18:47:42 +01:00
|
|
|
{% for milestone in milestones %}
|
|
|
|
<tr>
|
|
|
|
<td> {{ milestone[0] }} </td>
|
|
|
|
<td> <progress id="file" max={{ milestone[2] }} value={{ milestone[1] }}></progress></td>
|
|
|
|
<td> {{ milestone[1] }} / {{ milestone[2] }}</td>
|
|
|
|
</tr>
|
2023-03-14 16:26:04 +01:00
|
|
|
{% endfor %}
|
2024-02-03 18:47:42 +01:00
|
|
|
</tbody>
|
2023-03-14 16:28:45 +01:00
|
|
|
</table>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2023-03-14 15:42:14 +01:00
|
|
|
</body>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id='redeem-queue' class="tabcontent">
|
2023-03-14 16:26:04 +01:00
|
|
|
|
2023-03-14 15:42:14 +01:00
|
|
|
<body>
|
|
|
|
<h3>Redeems Queue</h3>
|
2023-03-14 16:43:26 +01:00
|
|
|
<p>Past redeemed redeems with timestamps and notes.</p>
|
2023-03-14 15:42:14 +01:00
|
|
|
{% if queue %}
|
|
|
|
<table>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th colspan="2">Recent redeems</th>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>Time</th>
|
|
|
|
<th>Redeem</th>
|
|
|
|
<th>Redeemer</th>
|
|
|
|
<th>Note</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
2023-03-14 16:26:04 +01:00
|
|
|
<tbody>
|
2024-02-03 18:47:42 +01:00
|
|
|
{% for row in queue %}
|
|
|
|
<tr>
|
|
|
|
<td>{{ row[0].replace(tzinfo=utc_timezone).astimezone().strftime("%H:%M") }}</td>
|
|
|
|
<td>{{ row[1] }}</td>
|
|
|
|
<td>{{ row[3] }}</td>
|
|
|
|
{% if row[2] %}
|
|
|
|
<td>{{ row[2] }}</td>
|
|
|
|
{% endif %}
|
|
|
|
</tr>
|
2023-03-14 15:42:14 +01:00
|
|
|
{% endfor %}
|
2024-02-03 18:47:42 +01:00
|
|
|
</tbody>
|
2023-03-14 15:42:14 +01:00
|
|
|
</table>
|
2022-11-09 14:35:45 +01:00
|
|
|
{% endif %}
|
|
|
|
</body>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id='redeems-list' class="tabcontent">
|
2022-11-09 14:40:27 +01:00
|
|
|
<h3>Currently active redeems</h3>
|
2022-11-09 14:54:00 +01:00
|
|
|
<p>If you have enough points, you can redeem those redeems by typing the command in chat.</p>
|
|
|
|
<ul>
|
|
|
|
<li><strong>Counter</strong> redeems add +1 to their counter.</li>
|
|
|
|
<li><strong>List</strong> redeems get added to the list of recent redeems (without a note).</li>
|
|
|
|
<li><strong>Note</strong> redeems require you to send a message together with the redeem.</li>
|
2023-03-14 16:26:04 +01:00
|
|
|
<li><strong>Milestone</strong> redeems are long-term goals to which you can donate any amount of points you
|
2023-03-14 16:31:28 +01:00
|
|
|
want. They will be completed once the amount of points donated reaches the goal.</li>
|
2022-11-09 14:54:00 +01:00
|
|
|
</ul>
|
2023-03-14 16:26:04 +01:00
|
|
|
|
2022-11-09 14:35:45 +01:00
|
|
|
<body>
|
|
|
|
{% if redeems %}
|
|
|
|
<table>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Redeem</th>
|
|
|
|
<th>Price</th>
|
|
|
|
<th>Type</th>
|
|
|
|
<th>Description</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2024-02-03 18:47:42 +01:00
|
|
|
{% for redeem, redeem_info in redeems.items() %}
|
|
|
|
<tr>
|
|
|
|
<td>{{ prefix }}{{ redeem }}</td>
|
|
|
|
{% if redeem_info["type"] == "milestone" %}
|
|
|
|
<td></td>
|
|
|
|
{% else %}
|
|
|
|
<td>{{ redeem_info["price"] }}</td>
|
|
|
|
{% endif %}
|
|
|
|
<td>{{ redeem_info["type"] }}</td>
|
|
|
|
{% if redeem_info["info"] %}
|
|
|
|
<td>{{ redeem_info["info"] }}</td>
|
|
|
|
{% endif %}
|
|
|
|
</tr>
|
2022-11-09 14:35:45 +01:00
|
|
|
{% endfor %}
|
2024-02-03 18:47:42 +01:00
|
|
|
</tbody>
|
2022-11-09 14:35:45 +01:00
|
|
|
</table>
|
|
|
|
{% endif %}
|
|
|
|
</body>
|
|
|
|
</div>
|
|
|
|
|
2023-01-16 13:30:43 +01:00
|
|
|
<script>
|
|
|
|
document.getElementById("defaultOpen").click();
|
|
|
|
setTimeout(refreshPage, 30 * 1000);
|
|
|
|
</script>
|
2022-11-09 14:35:45 +01:00
|
|
|
|
2023-01-16 13:30:43 +01:00
|
|
|
</div>
|
2022-11-09 14:35:45 +01:00
|
|
|
|
2023-03-14 16:26:04 +01:00
|
|
|
</html>
|