forked from MarseyWorld/MarseyWorld
add owned hats to user page per fish request
parent
7025cbe983
commit
491d71a9b5
|
@ -994,6 +994,11 @@ def u_username(username, v=None):
|
|||
|
||||
listing = get_posts(ids, v=v)
|
||||
|
||||
# this is probably totalllly inefficient but maybe someone can fix it later
|
||||
total_num_of_hats = g.db.query(HatDef).filter(HatDef.submitter_id == None).count()
|
||||
owned_hats = len(u.owned_hats)
|
||||
owned_hats_pct = f'{owned_hats / total_num_of_hats:.0%}'
|
||||
|
||||
if u.unban_utc:
|
||||
if request.headers.get("Authorization") or request.path.endswith(".json"):
|
||||
return {"data": [x.json for x in listing]}
|
||||
|
@ -1007,7 +1012,10 @@ def u_username(username, v=None):
|
|||
sort=sort,
|
||||
t=t,
|
||||
next_exists=next_exists,
|
||||
is_following=is_following)
|
||||
is_following=is_following,
|
||||
owned_hats=owned_hats,
|
||||
owned_hats_pct=owned_hats_pct,
|
||||
total_num_of_hats=total_num_of_hats)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -253,6 +253,7 @@
|
|||
<p id="profile--info--spent">Coins spent: {{u.coins_spent}}</p>
|
||||
<p id="profile--info--truescore">True score: {{u.truecoins}}</p>
|
||||
<p id="profile--info--winnings">Winnings: {{u.winnings}}</p>
|
||||
<p id="profile--info--hats-owned">{{owned_hats}}/{{total_num_of_hats}} ({{owned_hats_pct}})</p>
|
||||
{% if u.is_private %}
|
||||
<p id="profile--info--private">User has private mode enabled</p>
|
||||
{% endif %}
|
||||
|
@ -496,6 +497,7 @@
|
|||
<p id="profile-mobile--info--spent">Coins spent: {{u.coins_spent}}</p>
|
||||
<p id="profile-mobile--info--truescore">True score: {{u.truecoins}}</p>
|
||||
<p id="profile-mobile--info--winnings">Winnings: {{u.winnings}}</p>
|
||||
<p id="profile--info--hats-owned">{{owned_hats}}/{{total_num_of_hats}} ({{owned_hats_pct}})</p>
|
||||
{% if u.is_private %}
|
||||
<p id="profile-mobile--info--private">User has private mode enabled</p>
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in New Issue