Skip to content

Commit

Permalink
photo album details #2095
Browse files Browse the repository at this point in the history
  • Loading branch information
emilschn committed Jan 30, 2024
1 parent f2c164a commit dcc1f54
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/Entity/Enum/DocumentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,29 @@ enum DocumentType: String
case AUTRE = 'AUTRE';
case SITUATION = 'SITUATION';
case VISITE = 'VISITE';

public function label(): string
{
return self::getLabel($this);
}

public static function getLabel(self $value): string
{
return match ($value) {
self::SITUATION_FOYER_BAIL => 'Bail',
self::SITUATION_FOYER_DPE => 'DPE',
self::SITUATION_FOYER_ETAT_DES_LIEUX => 'Etat des lieux',
self::SITUATION_DIAGNOSTIC_PLOMB_AMIANTE => 'Diagnostic plomb-amiante',
self::PROCEDURE_MISE_EN_DEMEURE => 'Mise en demeure',
self::PROCEDURE_RAPPORT_DE_VISITE => 'Rapport de visite',
self::PROCEDURE_ARRETE_MUNICIPAL => 'Arrêté municipal',
self::PROCEDURE_ARRETE_PREFECTORAL => 'Arrêté préfectoral',
self::PROCEDURE_SAISINE => 'Saisine',
self::BAILLEUR_DEVIS_POUR_TRAVAUX => 'Devis pour travaux',
self::BAILLEUR_REPONSE_BAILLEUR => 'Réponse du bailleur',
self::AUTRE => 'Autre',
self::SITUATION => 'Désordre',
self::VISITE => 'Visite',
};
}
}
17 changes: 17 additions & 0 deletions templates/back/signalement/view/photos-album.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,23 @@
>
</div>
<div>
{% if photo.documentType is not same as null
and photo.documentType is not same as enum('App\\Entity\\Enum\\DocumentType').AUTRE %}

{% if photo.documentType is same as enum('App\\Entity\\Enum\\DocumentType').SITUATION
and photo.desordreSlug is not same as null %}
{% for key, photoList in photos %}
{% for desordrePhoto in photoList %}
{% if desordrePhoto.id is same as photo.id %}
{{ key }}
{% endif %}
{% endfor %}
{% endfor %}
{% else %}
{{ photo.documentType.label() }}
{% endif %}
<br>
{% endif %}
Photo ajoutée par {{ photo.uploadedBy.nomComplet ?? 'l\'usager' }}
</div>
</div>
Expand Down

0 comments on commit dcc1f54

Please sign in to comment.