{# @tailwind-safelist bg-primary/5 bg-cohorts/5 bg-warning/5 bg-error/5 bg-success/5 bg-info/5 bg-pink/5 text-primary text-cohorts text-warning text-error text-success text-info text-pink #} {# ============================================================================ Carte de contrat avec statut coloré Utilise Tailwind CSS et les atomes/molécules Atomic Design ============================================================================ #} {% set status = contract.status %} {# Configuration centralisée via extension Twig #} {% set config = contract_status_config(status) %}
{# Indicateur de statut (barre latérale) #}
{# Header #}

{{ contract.name }}

{% include '_atoms/icon/icon.html.twig' with { name: 'calendar', size: 'xs', color: 'gray' } only %} {{ contract.startDate|date('d/m/Y') }} → {{ contract.endDate|date('d/m/Y') }}
{# Actions #}
{% include '_atoms/icon/icon.html.twig' with { name: 'edit', size: 'sm' } only %}
{# Body #}
{# Badges de statut #}
{% include '_atoms/badge/badge.html.twig' with { preset: 'contract-' ~ status, size: 'sm' } only %} {% if status == 'active' and contract.isExpiringSoon(30) %} {% include '_atoms/badge/badge.html.twig' with { label: 'Expire dans ' ~ contract.daysRemaining ~ ' j', variant: 'warning', dot: true, size: 'sm' } only %} {% endif %}
{# Stats #}
{% include '_atoms/icon/icon.html.twig' with { name: 'users', size: 'sm', color: 'gray' } only %} {{ contract.maxUsers }} utilisateurs
{% include '_atoms/icon/icon.html.twig' with { name: 'token', size: 'sm', color: 'gray' } only %} {{ contract.monthlyTokens|number_format(0, ',', ' ') }} /mois
{# Outils #}
{% for tool in contract.tools %} {% set tlc = tool_colors[tool.code] ?? 'primary' %} {% set tlhex = (tool_color_details[tool.code] ?? {}).primary ?? null %} {% set tlhexSecondary = (tool_color_details[tool.code] ?? {}).secondary ?? null %} {% include '_atoms/icon/icon.html.twig' with { name: 'bubul-' ~ tool.code, size: 'xs', color: tlc, colorPrimary: tlhex, colorSecondary: tlhexSecondary } only %} {{ tool.name }} {% else %} Aucun outil {% endfor %}
{# ================================================================ MODAL DE CONFIRMATION TOGGLE ================================================================ #}