forked from rDrama/rDrama
1
0
Fork 0

per carp request, dont use user_cards for badge owners and hat owners

master
Aevann 2023-08-08 17:49:00 +03:00
parent 144132cbb5
commit 5f8bc0442b
3 changed files with 31 additions and 16 deletions

View File

@ -160,16 +160,10 @@ def hat_owners(v, hat_id):
page = get_page()
users = g.db.query(User).join(Hat.owners).filter(Hat.hat_id == hat_id)
users = g.db.query(User, Hat.created_utc).join(Hat.owners).filter(Hat.hat_id == hat_id)
total = users.count()
users = users.order_by(Hat.created_utc.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
return render_template("user_cards.html",
v=v,
users=users,
total=total,
page=page,
user_cards_title="Hat Owners",
)
return render_template("owners.html", v=v, users=users, page=page, total=total, kind="Hat")

View File

@ -1396,19 +1396,14 @@ def bid_list(v, bid):
page = get_page()
users = g.db.query(User).join(User.badges).filter(Badge.badge_id==bid)
users = g.db.query(User, Badge.created_utc).join(User.badges).filter(Badge.badge_id==bid)
total = users.count()
users = users.order_by(Badge.created_utc.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
return render_template("user_cards.html",
v=v,
users=users,
total=total,
page=page,
user_cards_title="Badge Owners",
)
return render_template("owners.html", v=v, users=users, page=page, total=total, kind="Badge")
KOFI_TOKEN = environ.get("KOFI_TOKEN", "").strip()
if KOFI_TOKEN:

View File

@ -0,0 +1,26 @@
{% extends "default.html" %}
{% block pagetitle %}{{kind}} Owners{% endblock %}
{% block content %}
<h5 class="my-3">{{kind}} Owners</h5>
<div class="overflow-x-auto mt-1"><table class="table table-striped mb-5">
<thead class="bg-primary text-white">
<tr>
<th>Name</th>
<th class="disable-sort-click">Owned since</td>
</tr>
</thead>
<tbody id="owners-table">
{% for user, created_utc in users %}
<tr>
<td>{% include "user_in_table.html" %}</td>
<td {% if created_utc > 1599343262 %}data-time="{{created_utc}}"{% endif %}></td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}
{% block pagenav %}
{% include "pagination.html" %}
{% endblock %}