chg: usr: add filter to the Profile page's recent plays and an infite list too #7
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user