fdsfds
This commit is contained in:
parent
20270afebf
commit
84684be2dc
2 changed files with 3 additions and 3 deletions
|
@ -28,8 +28,8 @@ def votes2(v, id):
|
|||
|
||||
voters=[x[0] for x in votes]
|
||||
counts=[x[1] for x in votes]
|
||||
users = g.db.query(User.id, User.username).filter(User.id.in_(voters)).all()
|
||||
users = [x[1] for x in sorted(users, key=lambda x: voters.index(x[0]))]
|
||||
users = g.db.query(User).filter(User.id.in_(voters)).all()
|
||||
users = sorted(users, key=lambda x: voters.index(x.id))
|
||||
users2 = []
|
||||
for idx, user in enumerate(users): users2.append((user, counts[idx]))
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
{% for user in users %}
|
||||
<tr>
|
||||
<td style="font-weight: bold">{{loop.index}}</td>
|
||||
<td style="font-weight: bold">{{user[0]}}</td>
|
||||
<td><a style="color:#{{user[0].namecolor}}; font-weight:bold;" href="/@{{user[0].username}}"><img loading="lazy" src="/uid/{{user[0].id}}/pic" class="pp20"><span {% if user[0].patron %}class="patron" style="background-color:#{{user[0].namecolor}};"{% endif %}>{{user[0].username}}</span></a></td>
|
||||
<td style="font-weight: bold">{{user[1]}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue