{# # ============================================================================ # PAGE: CASTIA — STUDIO PODCAST # ============================================================================ # # Layout : header sticky · galerie · drawer droit. # # ============================================================================ # COMPOSITION # ============================================================================ # # - _atoms/icon/icon.html.twig # - _atoms/button/button.html.twig # - _atoms/spinner/spinner.html.twig # - _molecules/mini-stat/mini-stat.html.twig # - _molecules/pagination/pagination.html.twig # - castia/_podcast_card.html.twig # # ============================================================================ # DONNÉES REQUISES (CastiaController::index) # ============================================================================ # # | Variable | Type | Description | # |-------------------|--------|------------------------------------| # | tokenStats | array | {remaining, energyConsumptionWh} | # | voices | array | Liste des voix disponibles | # | favoriteVoices | array | Clés des voix favorites | # | defaultVoice | string | Clé de la voix par défaut | # | recommendedVoices | array | Clés des voix recommandées | # | medianTokenCost | int | Coût médian | # | podcasts | array | Collection de CastiaPodcast | # | totalItems | int | Nombre total de podcasts | # | pagination | array | {current, total, totalItems, perPage} | # # ============================================================================ #} {% extends 'base.html.twig' %} {% block title %}Castia — Studio Podcast{% endblock %} {% block main_class %}p-0 bg-[#F5F5F5]{% endblock %} {% block body %} {% set ctColor = tool_color_details['castia'] %} {% set defaultVoiceData = voices[defaultVoice] ?? voices|first %} {% set currentPlanSlug = app.user.company ? 'b2b' : (app.user.plan ? app.user.plan.slug : 'freemium') %} {% set createTooltipHtml %}{% include '_molecules/upgrade-tooltip/upgrade-tooltip.html.twig' with { minTokens: castiaMinTokens, currentPlanSlug: currentPlanSlug, upgradeUrl: path('app_upgrade') } only %}{% endset %}
{# ══════════════════════════════════════════ EN-TÊTE DE PAGE ══════════════════════════════════════════ #}
{# Branding #}
{% include '_atoms/icon/icon.html.twig' with { name: 'bubul-castia', size: 'lg', colorPrimary: ctColor.primary, colorSecondary: ctColor.secondary } only %}

Castia

{{ totalItems }} audio{{ totalItems > 1 ? 's' : '' }} {% if medianTokenCost is defined and medianTokenCost > 0 %} {% endif %}
{# Stats + action #}
{#- Plus d'infobulle « Passer en Pro » ici : ce bouton n'ouvre que le panneau, il ne génère rien. La barrière de tokens vit sur le bouton « Générer », au pied du panneau — c'est là qu'elle s'applique vraiment, et là qu'elle se comprend. -#} {% include '_atoms/button/button.html.twig' with { label: 'Créer', size: 'md', icon: 'plus', gradientFrom: ctColor.primary, gradientTo: ctColor.secondary, attr: { 'data-action': 'click->castia--generator#openDrawer', 'data-tour-step': 'castia-ouvrir' } } only %}
{# ══════════════════════════════════════════ GALERIE ══════════════════════════════════════════ #}
{# Barre de recherche #} {% if totalItems > 0 %}
{% endif %} {# État vide #}
0 %}style="display:none"{% endif %} class="flex flex-col items-center justify-center py-20 text-center">
{% include '_atoms/icon/icon.html.twig' with { name: 'bubul-castia', size: '2xl', colorPrimary: ctColor.primary, colorSecondary: ctColor.secondary } only %}

Votre bibliothèque est vide

Transformez un texte ou un script en podcast audio professionnel avec Castia.

{#- Plus d'infobulle « Passer en Pro » ici : ce bouton n'ouvre que le panneau, il ne génère rien. La barrière de tokens vit sur le bouton « Générer », au pied du panneau — c'est là qu'elle s'applique vraiment, et là qu'elle se comprend. -#} {% include '_atoms/button/button.html.twig' with { label: 'Créer mon premier audio', size: 'lg', icon: 'plus', gradientFrom: ctColor.primary, gradientTo: ctColor.secondary, attr: { 'data-action': 'click->castia--generator#openDrawer', 'data-tour-step': 'castia-ouvrir' } } only %}
{# Grille de podcasts #}
{% for podcast in podcasts %} {% include 'castia/_podcast_card.html.twig' with {podcast: podcast} only %} {% endfor %}
{# Pagination #} {% if pagination.total > 1 %}
{% include '_molecules/pagination/pagination.html.twig' with { pagination: pagination, route: 'app_castia', filters: {} } %}
{% endif %}
{# ══════════════════════════════════════════ BACKDROP DRAWER ══════════════════════════════════════════ #} {# ══════════════════════════════════════════ DRAWER — FORMULAIRE DE CRÉATION ══════════════════════════════════════════ #}
{# Header #}
{% include '_atoms/icon/icon.html.twig' with { name: 'bubul-castia', size: 'sm', colorPrimary: ctColor.primary, colorSecondary: ctColor.secondary } only %}

Nouvel audio

{# Corps scrollable #}
{# Formulaire #}
{# ── 1. Titre ── #}
1 Titre

{# ── 2. Script ── #}
2 Script
{% include '_atoms/button/button.html.twig' with { label: 'Améliorer', variant: 'soft-primary', size: 'sm', icon: 'magic-stick', type: 'button', radius: 'full', attr: { 'data-action': 'click->castia--generator#optimizeScript', 'data-castia--generator-target': 'optimizeBtn' } } only %}
0 / {{ constant('App\\Config\\AppLimits::CASTIA_MAX_SCRIPT_LENGTH')|number_format(0, ',', ' ') }}

{# ── 3. Voix ── #}
3 Voix
{{ voices|length }} disponibles
{# Hero card : voix sélectionnée #}
{% if languages[defaultVoiceData.language] is defined %}{{ languages[defaultVoiceData.language].flag }}{% else %}{{ defaultVoiceData.label|first }}{% endif %}

{{ defaultVoiceData.label }}

{{ defaultVoiceData.description }}

{# Liste déroulante des voix (collapsible) #} {# /voicePicker #}
{# /voix #}
{# État de chargement (remplace le formulaire) #}
{# Bouton générer (ancré en bas) #}
{#- LA BARRIÈRE DE TOKENS EST ICI, et nulle part ailleurs : c'est ce bouton qui déclenche la dépense. Elle était posée sur « Créer », qui n'ouvre que le panneau — l'utilisateur se voyait refuser l'entrée sans avoir vu ce qu'il y avait dedans, et le tutoriel de l'outil devenait inatteignable avec elle. -#}
{# ── Modal script ── #} {% embed '_molecules/modal/modal.html.twig' with { id: 'castia-script-modal', title: 'Script', size: 'md' } %} {% block body %}

{% endblock %} {% block footer %} {% include '_atoms/button/button.html.twig' with { label: 'Fermer', variant: 'ghost', size: 'lg', attr: { onclick: "closeModal('castia-script-modal')", type: 'button' } } only %} {% endblock %} {% endembed %} {# ── Modal : Ajouter dans un cours Moodia ── #} {% include '_molecules/add-to-moodia/add-to-moodia.html.twig' with { submitLabel: "Ajouter l'audio", submitIcon: 'castia', sourceColorPrimary: ctColor.primary, sourceColorBg: ctColor.bg } only %} {# ── Modal de confirmation de suppression ── #} {% embed '_organisms/delete-modal/delete-modal.html.twig' with { title: 'Supprimer cet audio ?', modalAttr: {'data-castia--generator-target': 'deleteModal', 'data-action': 'keydown.esc@window->castia--generator#cancelDelete'}, cancelAttr: {'data-action': 'click->castia--generator#cancelDelete'}, confirmAttr: {'data-action': 'click->castia--generator#confirmDelete'} } only %} {% block description %}

sera supprimé définitivement.

{% endblock %} {% endembed %} {# ══════════════════════════════════════════ MODAL — RENOMMER L'AUDIO ══════════════════════════════════════════ #} {% embed '_organisms/rename-modal/rename-modal.html.twig' with { title: "Renommer l'audio", subtitle: 'Donnez un titre plus parlant à votre audio.', placeholder: "Titre de l'audio...", color: ctColor, modalAttr: {'data-castia--generator-target': 'renameModal'}, inputAttr: { 'data-castia--generator-target': 'renameInput', 'data-action': 'keydown->castia--generator#renameKeydown', 'maxlength': '255' }, cancelAttr: {'data-action': 'click->castia--generator#closeRenameModal'}, confirmAttr: {'data-action': 'click->castia--generator#saveRename'} } only %} {% block hiddenInputs %} {% endblock %} {% endembed %}
{% endblock %}