forked from MarseyWorld/MarseyWorld
leaderboards: show user as last row if not in lb
parent
3aac8f1f24
commit
efd63b8666
|
@ -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):
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue