Skip to content

Commit

Permalink
remove useless test #3100
Browse files Browse the repository at this point in the history
  • Loading branch information
emilschn committed Sep 27, 2024
1 parent a94d907 commit dbb8a7e
Showing 1 changed file with 62 additions and 65 deletions.
127 changes: 62 additions & 65 deletions templates/back/signalement/view/visites/visites-buttons.html.twig
Original file line number Diff line number Diff line change
@@ -1,75 +1,72 @@

{% if signalement.interventions is not empty %}
<div class="signalement-visites-buttons fr-text--right fr-btns-group fr-btns-group--sm fr-btns-group--inline fr-btns-group--right fr-btns-group--icon-left">
{% if intervention.status is same as constant('App\\Entity\\Intervention::STATUS_PLANNED') %}
{% if is_granted('SIGN_EDIT_VISITE', intervention) %}
{% if workflow_can(intervention, 'cancel') %}
<button class="fr-btn fr-btn--danger fr-fi-close-line" aria-controls="cancel-visite-modal-{{intervention.id}}" data-fr-opened="false">
Annuler la visite
</button>
{% endif %}
<button class="fr-btn fr-btn--secondary fr-fi-edit-line" aria-controls="reschedule-visite-modal-{{intervention.id}}" data-fr-opened="false">
Modifier la date
<div class="signalement-visites-buttons fr-text--right fr-btns-group fr-btns-group--sm fr-btns-group--inline fr-btns-group--right fr-btns-group--icon-left">
{% if intervention.status is same as constant('App\\Entity\\Intervention::STATUS_PLANNED') %}
{% if is_granted('SIGN_EDIT_VISITE', intervention) %}
{% if workflow_can(intervention, 'cancel') %}
<button class="fr-btn fr-btn--danger fr-fi-close-line" aria-controls="cancel-visite-modal-{{intervention.id}}" data-fr-opened="false">
Annuler la visite
</button>
{% if workflow_can(intervention, 'confirm') %}
<button class="fr-btn fr-fi-check-line" aria-controls="confirm-visite-modal-{{intervention.id}}" data-fr-opened="false">
Confirmer la visite
</button>
{% endif %}
{% endif %}
{% elseif intervention.status is same as constant('App\\Entity\\Intervention::STATUS_DONE') %}
{% if signalement.interventions is empty or intervention.files is empty or intervention.getRapportDeVisite is empty %}
{% if is_granted('SIGN_EDIT_VISITE', intervention) %}
<button
class="fr-btn fr-btn--secondary fr-fi-file-fill"
aria-controls="edit-visite-modal-{{intervention.id}}"
data-fr-opened="false"
>
Ajouter un rapport de visite
</button>
{% endif %}
{% else %}
{% if is_granted('SIGN_EDIT_VISITE', intervention) %}
<button
class="fr-btn fr-btn--secondary fr-fi-edit-line"
aria-controls="edit-visite-modal-{{intervention.id}}"
data-fr-opened="false">
Editer le rapport
</button>
{% endif %}
<a href="{{ path('show_file', {uuid: intervention.getRapportDeVisite.first.uuid}) }}"
class="fr-btn fr-btn--secondary"
title="Voir le rapport de visite"
rel="noopener"
target="_blank">
<span aria-hidden="true" class="fr-fi-file-line fr-icon--sm"></span> Voir le rapport de visite
</a>
<button class="fr-btn fr-btn--secondary fr-fi-edit-line" aria-controls="reschedule-visite-modal-{{intervention.id}}" data-fr-opened="false">
Modifier la date
</button>
{% if workflow_can(intervention, 'confirm') %}
<button class="fr-btn fr-fi-check-line" aria-controls="confirm-visite-modal-{{intervention.id}}" data-fr-opened="false">
Confirmer la visite
</button>
{% endif %}
{% endif %}
{% elseif intervention.status is same as constant('App\\Entity\\Intervention::STATUS_DONE') %}
{% if signalement.interventions is empty or intervention.files is empty or intervention.getRapportDeVisite is empty %}
{% if is_granted('SIGN_EDIT_VISITE', intervention) %}
<button
class="fr-btn fr-btn--secondary fr-icon-camera-fill open-modal-upload-files-btn"
class="fr-btn fr-btn--secondary fr-fi-file-fill"
aria-controls="edit-visite-modal-{{intervention.id}}"
data-fr-opened="false"
aria-controls="visites-upload-files-{{intervention.id}}"
data-file-type="photo"
data-document-type="PHOTO_VISITE"
data-accepted-type-mimes={{ get_accepted_mime_type('photo')}}
data-accepted-extensions="{{ get_accepted_extensions('photo')}}"
data-intervention-id="{{intervention.id}}">
Ajouter les photos de la visite
>
Ajouter un rapport de visite
</button>
{% endif %}
{% elseif intervention.status is same as constant('App\\Entity\\Intervention::STATUS_NOT_DONE') %}
{% if intervention.getRapportDeVisite is not empty %}
<a href="{{ path('show_file', {uuid: intervention.getRapportDeVisite.first.uuid}) }}"
class="fr-btn fr-btn--secondary"
title="Voir le rapport de visite"
rel="noopener"
target="_blank">
<span aria-hidden="true" class="fr-fi-file-line fr-icon--sm"></span> Voir le rapport de visite
</a>
{% endif %}
{% else %}
&nbsp;
{% if is_granted('SIGN_EDIT_VISITE', intervention) %}
<button
class="fr-btn fr-btn--secondary fr-fi-edit-line"
aria-controls="edit-visite-modal-{{intervention.id}}"
data-fr-opened="false">
Editer le rapport
</button>
{% endif %}
<a href="{{ path('show_file', {uuid: intervention.getRapportDeVisite.first.uuid}) }}"
class="fr-btn fr-btn--secondary"
title="Voir le rapport de visite"
rel="noopener"
target="_blank">
<span aria-hidden="true" class="fr-fi-file-line fr-icon--sm"></span> Voir le rapport de visite
</a>
{% endif %}
{% if is_granted('SIGN_EDIT_VISITE', intervention) %}
<button
class="fr-btn fr-btn--secondary fr-icon-camera-fill open-modal-upload-files-btn"
data-fr-opened="false"
aria-controls="visites-upload-files-{{intervention.id}}"
data-file-type="photo"
data-document-type="PHOTO_VISITE"
data-accepted-type-mimes={{ get_accepted_mime_type('photo')}}
data-accepted-extensions="{{ get_accepted_extensions('photo')}}"
data-intervention-id="{{intervention.id}}">
Ajouter les photos de la visite
</button>
{% endif %}
{% elseif intervention.status is same as constant('App\\Entity\\Intervention::STATUS_NOT_DONE') %}
{% if intervention.getRapportDeVisite is not empty %}
<a href="{{ path('show_file', {uuid: intervention.getRapportDeVisite.first.uuid}) }}"
class="fr-btn fr-btn--secondary"
title="Voir le rapport de visite"
rel="noopener"
target="_blank">
<span aria-hidden="true" class="fr-fi-file-line fr-icon--sm"></span> Voir le rapport de visite
</a>
{% endif %}
</div>
{% endif %}
{% else %}
&nbsp;
{% endif %}
</div>

0 comments on commit dbb8a7e

Please sign in to comment.