2026-04-11 20:45:51 +02:00
|
|
|
{% extends 'Game/index.html.twig' %}
|
|
|
|
|
|
|
|
|
|
{% block title %} - Profile{% endblock %}
|
|
|
|
|
|
2026-04-14 18:54:44 +02:00
|
|
|
{% block metas %}
|
|
|
|
|
{%- set _ogImage = app.request.getSchemeAndHttpHost() ~ asset('images/mine-1600x627.png') -%}
|
|
|
|
|
<meta name="robots" content="noindex,nofollow"/>
|
|
|
|
|
<meta property="og:url" content="{{ url('MineSeekerBundle_profile') }}"/>
|
|
|
|
|
<meta property="og:type" content="profile"/>
|
|
|
|
|
<meta property="og:site_name" content="MineSeeker"/>
|
|
|
|
|
<meta property="og:title" content="{{ app.user.username }} · MineSeeker"/>
|
|
|
|
|
<meta property="og:description"
|
|
|
|
|
content="View {{ app.user.username }}'s battle stats, win rate and recent games on MineSeeker."/>
|
|
|
|
|
<meta property="og:image" content="{{ _ogImage }}"/>
|
|
|
|
|
<meta property="og:image:width" content="1600"/>
|
|
|
|
|
<meta property="og:image:height" content="627"/>
|
|
|
|
|
<meta name="twitter:card" content="summary_large_image"/>
|
|
|
|
|
<meta name="twitter:title" content="{{ app.user.username }} · MineSeeker"/>
|
|
|
|
|
<meta name="twitter:description"
|
|
|
|
|
content="View {{ app.user.username }}'s battle stats, win rate and recent games on MineSeeker."/>
|
|
|
|
|
<meta name="twitter:image" content="{{ _ogImage }}"/>
|
|
|
|
|
{% endblock %}
|
|
|
|
|
|
2026-04-11 20:45:51 +02:00
|
|
|
{% block body %}
|
2026-04-12 08:49:47 +02:00
|
|
|
<div class="profile-page">
|
|
|
|
|
<div class="profile-header">
|
2026-04-13 15:50:28 +02:00
|
|
|
<div id="profile-avatar-root"
|
|
|
|
|
data-upload-url="{{ path('MineSeekerBundle_profile_avatar') }}"
|
|
|
|
|
data-thumb-url="{{ app.user.avatarPath ? app.user.avatarPath|imagine_filter('avatar_thumb') : '' }}"
|
|
|
|
|
data-initials="{{ app.user.username|slice(0, 2)|upper }}">
|
2026-04-12 08:49:47 +02:00
|
|
|
</div>
|
|
|
|
|
<div class="profile-info">
|
|
|
|
|
<h1 class="profile-name">{{ app.user.username }}</h1>
|
|
|
|
|
{% if app.user.email %}
|
|
|
|
|
<p class="profile-email">
|
2026-04-13 20:38:22 +02:00
|
|
|
<i class="fas fa-envelope"></i>
|
2026-04-12 08:49:47 +02:00
|
|
|
{{ app.user.email }}
|
|
|
|
|
</p>
|
|
|
|
|
{% endif %}
|
|
|
|
|
<p class="profile-role">
|
2026-04-13 20:38:22 +02:00
|
|
|
<i class="fas fa-shield"></i> Registered commander
|
2026-04-12 08:49:47 +02:00
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="profile-stats">
|
|
|
|
|
<div class="profile-stat">
|
2026-04-13 20:38:22 +02:00
|
|
|
<i class="fas fa-gamepad profile-stat__icon"></i>
|
2026-04-12 08:49:47 +02:00
|
|
|
<span class="profile-stat__value">{{ stats.total }}</span>
|
|
|
|
|
<span class="profile-stat__label">Games played</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="profile-stat profile-stat--win">
|
2026-04-13 20:38:22 +02:00
|
|
|
<i class="fas fa-trophy profile-stat__icon"></i>
|
2026-04-12 08:49:47 +02:00
|
|
|
<span class="profile-stat__value">{{ stats.wins }}</span>
|
|
|
|
|
<span class="profile-stat__label">Victories</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="profile-stat profile-stat--loss">
|
2026-04-13 20:38:22 +02:00
|
|
|
<i class="fas fa-flag profile-stat__icon"></i>
|
2026-04-12 08:49:47 +02:00
|
|
|
<span class="profile-stat__value">{{ stats.losses }}</span>
|
|
|
|
|
<span class="profile-stat__label">Defeats</span>
|
|
|
|
|
</div>
|
2026-04-12 20:03:20 +02:00
|
|
|
<div class="profile-stat profile-stat--draw">
|
2026-04-13 20:38:22 +02:00
|
|
|
<i class="fas fa-minus profile-stat__icon"></i>
|
2026-04-12 20:03:20 +02:00
|
|
|
<span class="profile-stat__value">{{ stats.draws }}</span>
|
|
|
|
|
<span class="profile-stat__label">Draws</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="profile-stat profile-stat--rate">
|
2026-04-13 20:38:22 +02:00
|
|
|
<i class="fas fa-percent profile-stat__icon"></i>
|
2026-04-12 20:03:20 +02:00
|
|
|
<span class="profile-stat__value">{{ stats.winRate }}<small>%</small></span>
|
|
|
|
|
<span class="profile-stat__label">Win rate</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="profile-stat profile-stat--avg">
|
2026-04-13 20:38:22 +02:00
|
|
|
<i class="fas fa-chart-line profile-stat__icon"></i>
|
2026-04-12 20:03:20 +02:00
|
|
|
<span class="profile-stat__value">{{ stats.avgScore }}</span>
|
|
|
|
|
<span class="profile-stat__label">Avg score</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="profile-stat profile-stat--best">
|
2026-04-13 20:38:22 +02:00
|
|
|
<i class="fas fa-star profile-stat__icon"></i>
|
2026-04-12 20:03:20 +02:00
|
|
|
<span class="profile-stat__value">{{ stats.bestScore }}</span>
|
|
|
|
|
<span class="profile-stat__label">Best score</span>
|
|
|
|
|
</div>
|
2026-04-12 08:49:47 +02:00
|
|
|
<div class="profile-stat profile-stat--bomb">
|
2026-04-13 20:38:22 +02:00
|
|
|
<i class="fas fa-bomb profile-stat__icon"></i>
|
2026-04-12 08:49:47 +02:00
|
|
|
<span class="profile-stat__value">{{ stats.bombs }}</span>
|
|
|
|
|
<span class="profile-stat__label">Mines hit</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-04-11 20:45:51 +02:00
|
|
|
|
2026-04-12 20:03:20 +02:00
|
|
|
{% if stats.total > 0 %}
|
|
|
|
|
<div id="profile-charts-root" data-chart-data="{{ chartData|json_encode|e('html') }}"></div>
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
<div id="profile-battle-root" data-games="{{ gamesData|json_encode|e('html') }}"></div>
|
2026-04-12 08:49:47 +02:00
|
|
|
{% if recent|length > 0 %}
|
|
|
|
|
<div class="profile-section">
|
|
|
|
|
<h2 class="profile-section__title">
|
2026-04-13 20:38:22 +02:00
|
|
|
<i class="fas fa-clock-rotate-left"></i> Recent battles
|
2026-04-12 08:49:47 +02:00
|
|
|
</h2>
|
|
|
|
|
<div class="profile-games">
|
|
|
|
|
{% 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 %}
|
|
|
|
|
{% set opp_points = is_red ? game.bluePoints : game.redPoints %}
|
|
|
|
|
{% set opp = is_red ? game.blue : game.red %}
|
|
|
|
|
{% set opp_anon = is_red ? game.blueAnon : game.redAnon %}
|
2026-04-11 20:45:51 +02:00
|
|
|
|
2026-04-12 08:49:47 +02:00
|
|
|
{% set result = 'draw' %}
|
|
|
|
|
{% if game.resign == (is_red ? 'red' : 'blue') %}
|
|
|
|
|
{% set result = 'loss' %}
|
|
|
|
|
{% elseif game.resign == (is_red ? 'blue' : 'red') %}
|
|
|
|
|
{% set result = 'win' %}
|
|
|
|
|
{% elseif my_points is not null and opp_points is not null %}
|
|
|
|
|
{% if my_points > opp_points %}
|
|
|
|
|
{% set result = 'win' %}
|
|
|
|
|
{% elseif my_points < opp_points %}
|
|
|
|
|
{% set result = 'loss' %}
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% endif %}
|
2026-04-11 20:45:51 +02:00
|
|
|
|
2026-04-12 20:03:20 +02:00
|
|
|
<div class="profile-game profile-game--{{ result }}" data-game-index="{{ loop.index0 }}">
|
2026-04-12 08:49:47 +02:00
|
|
|
<span class="profile-game__badge">
|
|
|
|
|
{{ result == 'win' ? 'W' : (result == 'loss' ? 'L' : 'D') }}
|
|
|
|
|
</span>
|
|
|
|
|
<span class="profile-game__score">
|
|
|
|
|
{{ my_points ?? '—' }} : {{ opp_points ?? '—' }}
|
|
|
|
|
</span>
|
|
|
|
|
<span class="profile-game__vs">vs</span>
|
|
|
|
|
<span class="profile-game__opponent">
|
|
|
|
|
{% if opp %}
|
|
|
|
|
{{ opp.username }}
|
|
|
|
|
{% elseif opp_anon %}
|
|
|
|
|
{{ opp_anon.userName }}
|
|
|
|
|
{% else %}
|
|
|
|
|
Guest
|
|
|
|
|
{% endif %}
|
|
|
|
|
</span>
|
|
|
|
|
<span class="profile-game__color">
|
2026-04-13 20:38:22 +02:00
|
|
|
<i class="fas fa-circle" style="color: {{ is_red ? '#c0392b' : '#2980b9' }}"></i>
|
2026-04-12 08:49:47 +02:00
|
|
|
</span>
|
|
|
|
|
<span class="profile-game__date">
|
|
|
|
|
{{ game.updated ? game.updated|date('Y-m-d') : '' }}
|
|
|
|
|
</span>
|
2026-04-11 20:45:51 +02:00
|
|
|
</div>
|
2026-04-12 08:49:47 +02:00
|
|
|
{% endfor %}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{% else %}
|
|
|
|
|
<div class="profile-empty">
|
2026-04-13 20:38:22 +02:00
|
|
|
<i class="fas fa-inbox"></i>
|
2026-04-12 08:49:47 +02:00
|
|
|
<p>No games recorded yet. <a href="{{ path('MineSeekerBundle_gamePlay') }}">Start playing!</a></p>
|
|
|
|
|
</div>
|
|
|
|
|
{% endif %}
|
|
|
|
|
</div>
|
|
|
|
|
{% endblock %}
|
2026-04-12 20:03:20 +02:00
|
|
|
|
|
|
|
|
{% block javascripts %}
|
|
|
|
|
{{ parent() }}
|
|
|
|
|
{{ vite_entry_script_tags('profile') }}
|
|
|
|
|
{% endblock %}
|