forked from rDrama/rDrama
per carp request, dont use user_cards for badge owners and hat owners
parent
144132cbb5
commit
5f8bc0442b
|
@ -160,16 +160,10 @@ def hat_owners(v, hat_id):
|
||||||
|
|
||||||
page = get_page()
|
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()
|
total = users.count()
|
||||||
|
|
||||||
users = users.order_by(Hat.created_utc.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
|
users = users.order_by(Hat.created_utc.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
|
||||||
|
|
||||||
return render_template("user_cards.html",
|
return render_template("owners.html", v=v, users=users, page=page, total=total, kind="Hat")
|
||||||
v=v,
|
|
||||||
users=users,
|
|
||||||
total=total,
|
|
||||||
page=page,
|
|
||||||
user_cards_title="Hat Owners",
|
|
||||||
)
|
|
||||||
|
|
|
@ -1396,19 +1396,14 @@ def bid_list(v, bid):
|
||||||
|
|
||||||
page = get_page()
|
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()
|
total = users.count()
|
||||||
|
|
||||||
users = users.order_by(Badge.created_utc.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
|
users = users.order_by(Badge.created_utc.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
|
||||||
|
|
||||||
return render_template("user_cards.html",
|
return render_template("owners.html", v=v, users=users, page=page, total=total, kind="Badge")
|
||||||
v=v,
|
|
||||||
users=users,
|
|
||||||
total=total,
|
|
||||||
page=page,
|
|
||||||
user_cards_title="Badge Owners",
|
|
||||||
)
|
|
||||||
|
|
||||||
KOFI_TOKEN = environ.get("KOFI_TOKEN", "").strip()
|
KOFI_TOKEN = environ.get("KOFI_TOKEN", "").strip()
|
||||||
if KOFI_TOKEN:
|
if KOFI_TOKEN:
|
||||||
|
|
|
@ -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 %}
|
Loading…
Reference in New Issue