master
Aevann1 2022-01-18 14:06:58 +02:00
parent 14dcf208fb
commit 7a766fb35b
2 changed files with 25 additions and 4 deletions

View File

@ -58,10 +58,17 @@ users4 = users.order_by(User.comment_count.desc()).all()
pos4 = users4.index(v)
users4 = users4[:25]
users5 = users.order_by(User.received_award_count.desc()).limit(25).all()
users5 = users.order_by(User.received_award_count.desc()).all()
pos5 = users5.index(v)
users5 = users5[:25]
if request.host == 'pcmemes.net': users6 = users.order_by(User.basedcount.desc()).limit(10).all()
else: users6 = None
if request.host == 'pcmemes.net':
users6 = users.order_by(User.basedcount.desc()).all()
pos6 = users6.index(v)
users6 = users6[:25]
else:
users6 = None
pos6 = None
users7 = users.order_by(User.coins_spent.desc()).all()
pos7 = users7.index(v)
@ -349,7 +356,7 @@ def transfer_bux(v, username):
@app.get("/leaderboard")
@auth_required
def leaderboard(v):
return render_template("leaderboard.html", v=v, users1=users1, pos1=pos1, users2=users2, pos2=pos2, users3=users3, pos3=pos3, users4=users4, pos4=pos4, users5=users5, users6=users6, users7=users7, pos7=pos7, users9=users9, users10=users10, pos10=pos10, users12=users12, users13=users13, users15=users15)
return render_template("leaderboard.html", v=v, users1=users1, pos1=pos1, users2=users2, pos2=pos2, users3=users3, pos3=pos3, users4=users4, pos4=pos4, users5=users5, pos5=pos5, users6=users6, pos6=pos6, users7=users7, pos7=pos7, users9=users9, users10=users10, pos10=pos10, users12=users12, users13=users13, users15=users15)
@app.get("/@<username>/css")

View File

@ -223,6 +223,13 @@
<td style="font-weight:bold; text-align:right;">{{user.received_award_count}}</td>
</tr>
{% endfor %}
{% if pos5 > 25 %}
<tr style="border-top:2px solid var(--primary)">
<td style="font-weight:bold;">{{pos5}}</td>
<td><a style="color:#{{v.namecolor}}; font-weight:bold;" href="/@{{v.username}}"><img alt="@{{v.username}}'s profile picture" loading="lazy" src="{{v.profile_url}}" class="pp20"><span {% if v.patron %}class="patron" style="background-color:#{{v.namecolor}}"{% endif %}>{{v.username}}</span></a></td>
<td style="font-weight:bold; text-align:right;">{{v.received_award_count}}</td>
</tr>
{% endif %}
</table>
@ -312,6 +319,13 @@
<td style="font-weight:bold; text-align:right;">{{user.basedcount}}</td>
</tr>
{% endfor %}
{% if pos6 > 25 %}
<tr style="border-top:2px solid var(--primary)">
<td style="font-weight:bold;">{{pos6}}</td>
<td><a style="color:#{{v.namecolor}}; font-weight:bold;" href="/@{{v.username}}"><img alt="@{{v.username}}'s profile picture" loading="lazy" src="{{v.profile_url}}" class="pp20"><span {% if v.patron %}class="patron" style="background-color:#{{v.namecolor}}"{% endif %}>{{v.username}}</span></a></td>
<td style="font-weight:bold; text-align:right;">{{v.basedcount}}</td>
</tr>
{% endif %}
</table>
{% endif %}