{% extends 'base.html.twig' %} {% block title %}Mes Badges — Bubul{% endblock %} {% block body %} {# @tailwind-safelist (classes dynamiques variant) bg-primary/10 bg-success/10 bg-warning/10 bg-error/10 bg-cohorts/10 bg-primary bg-success bg-warning bg-error bg-cohorts text-primary text-success text-warning text-error text-cohorts #}
{% include '_molecules/settings-nav/settings-nav.html.twig' with { user: app.user, activePage: 'badges' } only %}
{# ── Header mobile (sm:hidden) — 2 lignes pour éviter le chevauchement ── #}
{% include '_atoms/icon/icon.html.twig' with { name: 'crown', size: 'lg', color: 'primary' } only %}

Badges

{% include '_molecules/daily-reward-card/daily-reward-card.html.twig' with { canClaim: dailyStatus.canClaim, nextClaimAt: dailyStatus.nextClaimAt, claimUrl: dailyClaimUrl } only %}
{# ── Header desktop (hidden sm:flex) ── #} {# ================================================================ SECTION 1 : Un séparateur par outil ================================================================ #} {% for toolData in toolBadgeData %} {% set toolColor = toolData.tool.colorPrimary ?? '#0C81E4' %} {% set toolBg = toolData.tool.colorBackground ?? '#EFF6FF' %} {% set toolIcon = toolData.tool.getSidebarIcon() %} {% set toolUnlocked = 0 %} {% set toolTotal = toolData.levels|length %} {% for ld in toolData.levels %}{% if ld.unlocked %}{% set toolUnlocked = toolUnlocked + 1 %}{% endif %}{% endfor %} {% for group in toolData.achievementData %} {% set toolTotal = toolTotal + group.levels|length %} {% for ld in group.levels %}{% if ld.unlocked %}{% set toolUnlocked = toolUnlocked + 1 %}{% endif %}{% endfor %} {% endfor %}
{% include '_atoms/icon/icon.html.twig' with { name: toolIcon, size: 'xl', color: 'current' } only %}

{{ toolData.tool.name }}

{{ toolUnlocked }}/{{ toolTotal }} niveaux débloqués

{% include '_molecules/badge-group-card/badge-group-card.html.twig' with { levels: toolData.levels, hexColorInner: toolColor, hexColorOuter: toolBg, } only %} {% for typeData in toolData.achievementData %} {% include '_molecules/badge-group-card/badge-group-card.html.twig' with { levels: typeData.levels, hexColorInner: toolColor, hexColorOuter: toolBg, } only %} {% endfor %}
{% endfor %} {# ================================================================ SECTION 2 : Badges spéciaux ================================================================ #} {%- set specialUnlocked = 0 %} {%- set specialTotal = 0 %} {%- for group in specialData %} {%- set specialTotal = specialTotal + group.levels|length %} {%- for lvl in group.levels %}{% if lvl.unlocked %}{% set specialUnlocked = specialUnlocked + 1 %}{% endif %}{%- endfor %} {%- endfor %} {%- for b in streakData %}{% if b.unlocked %}{% set specialUnlocked = specialUnlocked + 1 %}{% endif %}{%- endfor %} {%- set specialTotal = specialTotal + streakData|length %}
{% include '_atoms/icon/icon.html.twig' with { name: 'star', size: 'sm', color: 'current' } only %}

Badges spéciaux

{{ specialUnlocked }}/{{ specialTotal }} débloqués

{% for group in specialData %} {% include '_molecules/badge-group-card/badge-group-card.html.twig' with { levels: group.levels, hexColorInner: '#F59E0B', hexColorOuter: '#FFF7ED', } only %} {% endfor %} {% if streakData %} {% include '_molecules/badge-group-card/badge-group-card.html.twig' with { levels: streakData, hexColorInner: '#F59E0B', hexColorOuter: '#FFF7ED', } only %} {% endif %}
{% endblock %}