Private
Public Access
1
0

chg: usr: add filter to the Profile page's recent plays and an infite list too #7

This commit is contained in:
2026-04-19 22:11:58 +02:00
parent e0495d182e
commit 5f856e4d70
4 changed files with 120 additions and 3 deletions

View File

@@ -120,7 +120,12 @@
<h2 class="profile-section__title">
<i class="fas fa-clock-rotate-left"></i> Recent battles
</h2>
<div class="profile-games">
<div class="profile-games__filter-wrap">
<i class="fas fa-search profile-games__filter-icon"></i>
<input type="text" class="profile-games__filter" data-filter
placeholder="Filter by opponent…" autocomplete="off">
</div>
<div class="profile-games" data-batch-size="5">
{% for game in recent %}
{% set is_red = game.red and game.red.id == app.user.id %}
{% set my_points = is_red ? game.redPoints : game.bluePoints %}
@@ -149,7 +154,7 @@
{% endif %}
{% endif %}
<div class="profile-game profile-game--{{ result }}{% if not is_finished and not is_anonymous %} profile-game--ongoing{% elseif is_anonymous %} profile-game--abandoned{% endif %}" data-game-index="{{ loop.index0 }}">
<div class="profile-game profile-game--{{ result }}{% if not is_finished and not is_anonymous %} profile-game--ongoing{% elseif is_anonymous %} profile-game--abandoned{% endif %}{% if loop.index0 >= 5 %} profile-game--hidden{% endif %}" data-game-index="{{ loop.index0 }}">
<span class="profile-game__badge">
{% if is_finished %}
{{ result == 'win' ? 'Win' : (result == 'loss' ? 'Loss' : 'Draw') }}
@@ -181,6 +186,11 @@
</div>
{% endfor %}
</div>
{% if recent|length > 5 %}
<button type="button" class="profile-games__load-more" data-load-more>
<i class="fas fa-chevron-down"></i> Load more
</button>
{% endif %}
</div>
{% else %}
<div class="profile-empty">