{# # Fragment: Castia Podcast Card # NE PAS étendre base.html.twig — utilisé via include et renderView() # Requiert: podcast (CastiaPodcast) #} {% set barHeights = [30,55,80,45,90,35,70,60,85,40,75,50,95,30,65,80,45,90,35,70,55,85,40,75,60,50,80,35,90,45,70,55,85,30,65,75,50,90,40,80,35,70,60,85,45,75,55,90,30,65,80,40,85,50,70,35,90,45,75,60,55,80,30,65,90,40,70,55,85,35,75,50,80,45,60,90,30,70,55,85,40,65,75,50,90,35,80,45,70,60,85,30,75,55,65,80] %}
{# ── Ligne 1 : Titre + actions ── #}
{# Titre #}

{{ podcast.title }}

{{- podcast.voiceLabel }} · {{ podcast.formattedDate -}}

{# Menu contextuel #} {% include '_molecules/action-menu/action-menu.html.twig' with { withTrigger: true, items: [ {label: 'Télécharger', icon: 'download', href: path('app_castia_download', {id: podcast.id})}, {label: 'Ajouter à Moodia', icon: 'bubul-moodia', attr: {'data-action': 'click->shared--add-to-moodia#open', 'data-podcast-id': podcast.id, 'data-podcast-title': podcast.title}}, {label: 'Renommer', icon: 'edit', attr: {'data-action': 'click->castia--generator#openRenameModal', 'data-podcast-id': podcast.id, 'data-current-title': podcast.title, 'data-csrf-token': csrf_token('rename-podcast-' ~ podcast.id)}} ], dangerItems: [ {label: 'Supprimer', icon: 'trash', formAction: path('app_castia_delete', {id: podcast.id}), csrfToken: csrf_token('delete-podcast-' ~ podcast.id), formAttr: {'data-action': 'submit->castia--generator#requestDelete', 'data-podcast-id': podcast.id, 'data-podcast-name': podcast.title}} ], accentHex: tool_color_details['castia'].primary } only %}
{# ── Ligne 2 : Lecteur audio ── #}
{# Bouton play/pause #} {# Waveform pleine largeur #}
{% for h in barHeights %}
{% endfor %}
{# Temps actuel / durée totale #} 0:00 / --:--
{# ── Pied de carte : script + stats ── #} {% if podcast.script or podcast.tokensUsed %}
{# Bouton script (gauche) #} {% if podcast.script %} {% else %} {% endif %} {# Tokens + énergie (droite) #} {% if podcast.tokensUsed %}
{% include '_atoms/icon/icon.html.twig' with {name: 'token', size: 'xs', color: 'current'} only %} {{ podcast.tokensUsed|format_tokens }} · {% include '_atoms/icon/icon.html.twig' with {name: 'bolt', size: 'xs', color: 'current'} only %} {{ podcast.energyConsumptionWh|format_energy }}
{% endif %}
{% endif %}