restore loop.index in voters.html

pull/29/head
Aevann1 2022-11-28 03:52:58 +02:00
parent 1475383549
commit e8b4ef24ea
2 changed files with 4 additions and 1 deletions

View File

@ -66,5 +66,5 @@ def inject_constants():
"HOUSE_JOIN_COST":HOUSE_JOIN_COST, "HOUSE_SWITCH_COST":HOUSE_SWITCH_COST, "IMAGE_FORMATS":IMAGE_FORMATS,
"PAGE_SIZES":PAGE_SIZES, "THEMES":THEMES, "COMMENT_SORTS":COMMENT_SORTS, "SORTS":SORTS,
"TIME_FILTERS":TIME_FILTERS, "HOUSES":HOUSES, "TIERS_ID_TO_NAME":TIERS_ID_TO_NAME,
"DEFAULT_CONFIG_VALUE":DEFAULT_CONFIG_VALUE, "IS_LOCALHOST":IS_LOCALHOST, "BACKGROUND_CATEGORIES":BACKGROUND_CATEGORIES,
"DEFAULT_CONFIG_VALUE":DEFAULT_CONFIG_VALUE, "IS_LOCALHOST":IS_LOCALHOST, "BACKGROUND_CATEGORIES":BACKGROUND_CATEGORIES, "PAGE_SIZE":PAGE_SIZE,
}

View File

@ -6,6 +6,7 @@
<div class="mt-1 overflow-x-auto"><table class="table table-striped mb-5">
<thead class="bg-primary text-white">
<tr>
<th>#</th>
<th>Name</th>
<th>{{name}}votes</th>
</tr>
@ -13,12 +14,14 @@
<tbody id="followers-table">
{% for user, num in users %}
<tr {% if v.id == user.id %}class="self"{% endif %}>
<td>{{loop.index+PAGE_SIZE*(page-1)}}</td>
<td>{% include "user_in_table.html" %}</td>
<td><a href="{{request.path}}/{{user.id}}/posts">{{num}}</a></td>
</tr>
{% endfor %}
{% if pos and (pos[0] > 25 or not pos[1]) %}
<tr style="border-top:2px solid var(--primary)">
<td>{{pos[0]}}</td>
<td>
{% with user=v %}
{% include "user_in_table.html" %}