{% extends 'base.html.twig' %} {% set category = prompt.categoryData %} {% set cardColor = category ? category.colorHex : '#6366F1' %} {% set cardIcon = category ? category.icon : 'magic-stick' %} {% set authorFN = prompt.author.firstName ?? '' %} {% set authorLN = prompt.author.lastName ?? '' %} {% set authorName = (authorFN ~ ' ' ~ authorLN)|trim %} {% set fieldNames = prompt.fieldNames %} {% set fieldCount = fieldNames|length %} {% block title %}{{ prompt.title }} — Promptly{% endblock %} {% block body %} {% set ptColor = tool_color_details['promptly'] %} {% if from == 'mes-prompts' %} {% set backHref = folderParam ? path('app_promptly_my_prompts', { folder: folderParam }) : path('app_promptly_my_prompts') %} {% set backLabel = 'Mes prompts' %} {% else %} {% set backHref = path('app_promptly') %} {% set backLabel = 'Bibliothèque' %} {% endif %}
{# ── Hero ── #}
{% include '_atoms/icon/icon.html.twig' with { name: cardIcon, size: 'xl', color: 'current' } only %}

{{ prompt.title }}

{% if prompt.description %}

{{ prompt.description }}

{% endif %} {# Méta #}
{% if prompt.author.isAdmin() %} {% include '_atoms/logo/logo.html.twig' with { variant: 'simple', size: 'fluid', class: 'w-4 h-4' } only %} Bubul {% else %} par {{ authorName }} {% endif %} {% if prompt.isDraft %} Brouillon {% elseif prompt.visibility == 'public' %} Public {% else %} {% include '_atoms/icon/icon.html.twig' with { name: 'lock', size: 'xs', color: 'current' } only %} Privé {% endif %} {% if prompt.aiModelLabel %} {{ prompt.aiModelLabel }} {% endif %} {% if category %} {{ category.name }} {% endif %} {% include '_atoms/icon/icon.html.twig' with { name: 'chart', size: 'xs', color: 'current' } only %} {{ prompt.usesCount }} {% include '_atoms/icon/icon.html.twig' with { name: 'heart', size: 'xs', color: 'current' } only %} {{ favoriteCounts[prompt.id] ?? 0 }}
{# /flex items-start gap-5 #} {# Boutons alignés avec le titre #}
{% include '_atoms/button/button.html.twig' with { label: 'Retour', variant: 'back', size: 'md', icon: 'arrow-left', href: backHref } only %} {% if isOwner %} {% include '_atoms/button/button.html.twig' with { label: 'Modifier', variant: 'primary', size: 'md', icon: 'edit', gradientFrom: ptColor.primary, gradientTo: ptColor.secondary, href: path('app_promptly_edit_page', { id: prompt.id }) } only %} {% endif %}
{# ================================================================ CORPS ================================================================ #} {% if fieldNames is not empty %}
✎ à compléter
0/{{ fieldCount }} complété{{ fieldCount > 1 ? 's' : '' }}
{% else %}
{% include '_atoms/icon/icon.html.twig' with { name: cardIcon, size: 'sm', color: 'current' } only %}
Prompt prêt à utiliser ● Prêt
{% endif %}
{# /max-w-4xl #} {# ── Footer sticky ── #}
{# Contexte #}
{# Actions #}
{% include '_atoms/button/button.html.twig' with { label: 'Ouvrir dans Serenia', gradientFrom: '#8B5CF6', gradientTo: '#7C3AED', size: 'md', icon: 'send', iconPosition: 'right', type: 'button', attr: { 'data-action': 'click->promptly--detail#sendToSerenia', 'data-promptly--detail-target': 'sereniaBtn' } } only %} {% include '_atoms/button/button.html.twig' with { label: 'Copier le prompt', variant: 'primary', size: 'md', icon: 'copy', gradientFrom: ptColor.primary, gradientTo: ptColor.secondary, type: 'button', attr: { 'data-action': 'click->promptly--detail#copyPrompt', 'data-promptly--detail-target': 'copyBtn' } } only %}
{# /data-controller #} {% endblock %}