<input type="hidden" value="{{ futurActions.step_actions.step_view is defined ? futurActions.step_actions.step_view.is_last_step }}" id="last-step-is-active" />
<div id="container-futures">
{% if campaign.state not in ["waiting_validation","waiting_resend","closed", "archived",'recurred'] and can_activate_campaign(campaign) and is_granted("ROLE_ADMIN") and is_provisional_campaing(campaign) == false %}
<div class="ctn-bn" id="div-action">
<p>L'action suivante est en attente :</p>
<a type="button" class="btn btn-primary-custom font-weight-bold validate-button" href="{{ path('campaign_transition', {'id': campaign.id, 'transition': 'activated', 'currentRouteName': currentRouteName, 'firstClickedMissionId': mission.id }) }}">
{% if nbr_mission_to_activate(campaign, app.user)< 2 %}
J'accepte la mission
{% else %}
J'accepte toutes les missions
{% endif %}
</a>
</div>
{% elseif futurActions.have_action is defined and futurActions.have_action == true %}
<div class="ctn-bn" id="div-action">
{% if futurActions.mission_to_validate is not empty or futurActions.mission_to_evaluate is not empty or futurActions.mission_to_activate is not empty %}
<p>L'action suivante est en attente :</p>
{% if futurActions.mission_to_evaluate is not empty and futurActions.all_mission_to_evaluate | length == 1 %}
<span class="contenus-item">{{ estimate_income_or_initial_time_ux(campaign, get_mission(futurActions.mission_to_evaluate.id),estimatedIncome,formMissionInitialTimeManually) }}</span>
{% elseif futurActions.all_mission_to_evaluate | length > 1 %}
<button type="button" class="btn btn-primary-custom font-weight-bold validate-button mb-3" data-bs-toggle="modal" data-bs-target="#modal_evaluation_ux">
Évaluer les missions
</button>
{% endif %}
{% if futurActions.mission_to_activate is not empty %}
<button type="button" class="btn btn-primary-custom font-weight-bold validate-button" data-bs-toggle="modal" data-bs-target="#modal_acceptation_ux">
{{futurActions.all_mission_to_activate|length < 2? 'J\'accepte la mission ' :'J\'accepte toutes les missions' }}
</button>
{% endif %}
{% if futurActions.mission_to_validate is not empty %}
<button type="button" class="btn btn-primary-custom font-weight-bold validate-button" data-bs-toggle="modal" data-bs-target="#modal_validation_ux">
Valider la commande
</button>
{% endif %}
{% elseif futurActions.step_actions is not empty %}
<div class="ctn-bnty" {{stimulus_controller('planning--index')}}>
<p>L'action suivante est en attente :
</p>
<span id="txt-next-step" style="display:none;">
{% if futurActions.step_actions.step_view.is_last_step %}
{# <p>Voulez vous cloturer la mission <span class="font-weight-bold">{{futurActions.step_actions.product.name }}</span>.</p>` #}
<p>Êtes-vous sûr de vouloir valider cette étape ? En validant, vous clôturez cette mission.</p>
{% else %}
{# <p>Confirmez-vous le passage à l'étape <span class='font-weight-bold'>{{ futurActions.step_actions.step_view.next_step.name }} </span>pour la mission <span class='font-weight-bold'>{{futurActions.step_actions.product.name }}</span> ?</p><p>Tous les utilisateurs seront notifiés pour faire avancer le workflow.</p>` #}
<p>Êtes-vous sûr de vouloir valider cette étape ? Une fois validée, l'équipe suivante sera notifiée et pourra prendre le relais pour continuer le projet.</p>
{% endif %}
</span>
<button data-next="true" type="button" class="btn btn-primary-custom " data-type="validation" data-stepid="{{futurActions.step_actions.step_view.step.id}}" data-mission={{mission.id}} {{stimulus_action('planning--index','validateStep')}} >
{{ futurActions.step_actions.step_view.is_last_step ? 'Je clôture la mission' : 'J’avance à l’étape suivante' }}
</button>
</div>
{% endif %}
</div>
{% endif %}
</div>