forked from rDrama/rDrama
1
0
Fork 0

make sorting tables less retarded

master
Aevann1 2022-06-27 04:47:49 +02:00
parent 44c588fce3
commit 26d46a9cb9
4 changed files with 101 additions and 92 deletions

View File

@ -4,28 +4,30 @@
{% block content %}
<script src="/assets/js/sort_table.js?v=242"></script>
<script src="/assets/js/sort_table.js?v=243"></script>
<pre class="d-none d-md-inline-block"></pre>
<h5 style="font-weight:bold;">Admins</h5>
<pre></pre>
<div class="overflow-x-auto">
<table id="sortable_table" class="table table-striped mb-5">
<thead class="bg-primary text-white">
<table class="table table-striped mb-5">
<thead class="bg-primary text-white">
<tr>
<th>#</th>
<th>Name</th>
<th role="button" onclick="sort_table(2)" style="text-align:right;">Truescore</th>
<th role="button" onclick="sort_table(3)" style="text-align:right;">Mod actions</th>
</tr>
</thead>
{% for user in admins %}
</thead>
{% for user in admins %}
<tr>
<td>{{loop.index}}</td>
<td><a style="color:#{{user.namecolor}}" href="/@{{user.username}}"><img loading="lazy" src="{{user.profile_url}}" class="pp20"><span {% if user.patron %}class="patron" style="background-color:#{{user.namecolor}}"{% endif %}>{{user.username}}</span></a></td>
<td style="text-align:right;">{{user.truecoins}}</td>
<td style="text-align:right;"><a href="/log?admin={{user.username}}">{{user.modaction_num}}</a></td>
</tr>
{% endfor %}
</table>
{% endfor %}
</table>
</div>
{% endblock %}

View File

@ -1,6 +1,6 @@
{% extends "default.html" %}
{% block content %}
<script src="/assets/js/sort_table.js?v=242"></script>
<script src="/assets/js/sort_table.js?v=243"></script>
<pre>
@ -12,8 +12,8 @@
</pre>
<div class="overflow-x-auto">
<table id="sortable_table" class="table table-striped mb-5">
<thead class="bg-primary text-white">
<table class="table table-striped mb-5">
<thead class="bg-primary text-white">
<tr>
<th>#</th>
<th>Name</th>
@ -22,8 +22,9 @@
<th role="button" onclick="sort_table(4)">#</th>
<th role="button" onclick="sort_table(4)">Rarity</th>
</tr>
</thead>
{% for badge in badges %}
</thead>
{% for badge in badges %}
<tr>
<td>{{loop.index}}</td>
<td>{{badge.name}}</td>
@ -33,7 +34,7 @@
<td class="badges-rarity-qty"><a href="/badge_owners/{{badge.id}}">{{ ct[0] }}</a></td>
<td class="badges-rarity-ratio">{{ "{:0.3f}".format(ct[1]) }}%</td>
</tr>
{% endfor %}
</table>
{% endfor %}
</table>
</div>
{% endblock %}

View File

@ -1,6 +1,6 @@
{% extends "default.html" %}
{% block content %}
<script src="/assets/js/sort_table.js?v=242"></script>
<script src="/assets/js/sort_table.js?v=243"></script>
<pre>
@ -9,7 +9,7 @@
<h5>List of {{HOLE_NAME}}s</h5>
<pre></pre>
<div class="overflow-x-auto">
<table id="sortable_table" class="table table-striped mb-5">
<table class="table table-striped mb-5">
<thead class="bg-primary text-white">
<tr>
<th>#</th>
@ -18,8 +18,9 @@
<th role="button" onclick="sort_table(3)">Followers</th>
<th role="button" onclick="sort_table(4)">Blockers</th>
</tr>
</thead>
{% for sub, count in subs %}
</thead>
{% for sub, count in subs %}
<tr>
<td>{{loop.index}}</td>
<td><a href="/h/{{sub.name}}">{{sub.name}}</a></td>
@ -27,7 +28,7 @@
<td><a href="/h/{{sub.name}}/followers">{{sub.follow_num}}</a></td>
<td><a href="/h/{{sub.name}}/blockers">{{sub.block_num}}</a></td>
</tr>
{% endfor %}
</table>
{% endfor %}
</table>
</div>
{% endblock %}

View File

@ -9,7 +9,7 @@
{% if thing %}
<script src="/assets/js/sort_table.js?v=242"></script>
<script src="/assets/js/sort_table.js?v=243"></script>
<pre>
@ -23,11 +23,14 @@
<p><b>Downvotes: </b>{{downs | length}}</p>
<h2>Upvotes</h2>
<div class="overflow-x-auto"><table class="table table-striped mb-5">
<thead class="bg-primary text-white"><tr>
<div class="overflow-x-auto">
<table class="table table-striped mb-5">
<thead class="bg-primary text-white">
<tr>
<th>User</th>
<th role="button" onclick="sort_table(1)">User truescore</th>
</tr></thead>
</tr>
</thead>
{% for vote in ups %}
<tr>
@ -35,14 +38,18 @@
<td>{{vote.user.truecoins}}</td>
</tr>
{% endfor %}
</table>
</table>
</div>
<h2>Downvotes</h2>
<div class="overflow-x-auto"><table class="table table-striped mb-5">
<thead class="bg-primary text-white"><tr>
<div class="overflow-x-auto">
<table class="table table-striped mb-5">
<thead class="bg-primary text-white">
<tr>
<th>User</th>
<th>User truescore</th>
</tr></thead>
</tr>
</thead>
{% for vote in downs %}
<tr>
@ -50,10 +57,8 @@
<td>{{vote.user.truecoins}}</td>
</tr>
{% endfor %}
</table>
</table>
</div>
{% endif %}