leaderboards: show user as last row if not in lb

master
justcool393 2022-10-28 04:38:52 -05:00
parent 3aac8f1f24
commit efd63b8666
2 changed files with 3 additions and 2 deletions

View File

@ -37,7 +37,7 @@ class Leaderboard:
self.value_func = value_func
self.v_value = value_func(v)
else:
self.value_func = lambda u: u[1]
self.value_func = lambda u: u[1] or 0
@classmethod
def get_simple_lb(cls, order_by, v:User, db:scoped_session, users, limit:int):

View File

@ -39,10 +39,11 @@
{% for user in lb.all_users %}
{% if v.id == user.id %}
{% set style="class=\"self\"" %}
{% set has_seen_v=true %}
{% endif %}
{{format_user_in_table(user, style, loop.index, lb.value_func(user))}}
{% endfor %}
{% if position %}
{% if position or not has_seen_v %}
{{format_user_in_table(v, "style=\"border-top:2px solid var(--primary)\"", lb.v_position, lb.v_value)}}
{% endif %}
</tbody>