forked from rDrama/rDrama
1
0
Fork 0

give more details in owners.html

master
Aevann 2023-11-04 20:41:47 +02:00
parent e2b00d4b6d
commit 6578150583
3 changed files with 11 additions and 4 deletions

View File

@ -148,6 +148,10 @@ def unequip_hat(v, hat_id):
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID)
@auth_required
def hat_owners(v, hat_id):
name = g.db.query(HatDef.name).filter_by(id=hat_id).one()[0]
href = f'{SITE_FULL_IMAGES}/i/hats/{name}.webp?x=6'
page = get_page()
users = g.db.query(User, Hat.created_utc).join(Hat.owners).filter(Hat.hat_id == hat_id)
@ -156,4 +160,4 @@ def hat_owners(v, hat_id):
users = users.order_by(Hat.created_utc.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
return render_template("owners.html", v=v, users=users, page=page, total=total, kind="Hat")
return render_template("owners.html", v=v, users=users, page=page, total=total, kind="Hat", name=name, href=href)

View File

@ -1308,6 +1308,9 @@ def toggle_pins(hole, sort):
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID)
@auth_required
def bid_list(v, bid):
name = g.db.query(BadgeDef.name).filter_by(id=bid).one()[0]
href = f'{SITE_FULL_IMAGES}/i/{SITE_NAME}/badges/{bid}.webp?b=11'
page = get_page()
@ -1317,7 +1320,7 @@ def bid_list(v, bid):
users = users.order_by(Badge.created_utc.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
return render_template("owners.html", v=v, users=users, page=page, total=total, kind="Badge")
return render_template("owners.html", v=v, users=users, page=page, total=total, kind="Badge", name=name, href=href)
KOFI_TOKEN = environ.get("KOFI_TOKEN", "").strip()

View File

@ -1,7 +1,7 @@
{% extends "default.html" %}
{% block pagetitle %}{{kind}} Owners{% endblock %}
{% block pagetitle %}{{name}} {{kind}} Owners{% endblock %}
{% block content %}
<h5 class="my-3">{{kind}} Owners</h5>
<h5 class="my-3"><a href="{{href}}">{{name}}</a> {{kind}} Owners</h5>
<div class="overflow-x-auto mt-1">
<table class="table table-striped mb-5">
<thead class="bg-primary text-white">