Éligibilité : Amélioration des badges indiquant la certification - #6755
Conversation
682c93c to
f4c26e3
Compare
8243194 to
b54a352
Compare
| if selected_criterion.certified_at: | ||
| if selected_criterion.certified is True: | ||
| template = "eligibility/includes/badge_certified.html" | ||
| elif selected_criterion.certified is False: | ||
| template = "eligibility/includes/badge_not_certified.html" | ||
| else: | ||
| template = "eligibility/includes/badge_certification_error.html" | ||
| else: | ||
| template = "eligibility/includes/badge_not_certified.html" | ||
| template = "eligibility/includes/badge_in_progress.html" |
There was a problem hiding this comment.
Ce diff me fait me poser la question de si a terme (avec la recertification des critères) ça sera pas une bonne idée d'avoir l'état dans un champ pour simplifier la visualisation dans le front et l'admin et limiter les branches dans le code 🤔.
There was a problem hiding this comment.
On ne pourra pas recertifier les critères avec l’API particulier, puisqu’elle ne donne l’état d’une personne qu’à l’instant où on l’interroge.
Mais on pourra probablement avoir une propriété sur le modèle pour mapper les champs à un état virtuel.
6846339 to
366944c
Compare
366944c to
34138d3
Compare
|
🥁 La recette jetable est prête ! 👉 Je veux tester cette PR ! |
1f24f63 to
b75aa29
Compare
b75aa29 to
f536cc8
Compare
f536cc8 to
66dee39
Compare
|
|
||
| if selected_criterion.certified_at: | ||
| if selected_criterion.certified is True: | ||
| template = "eligibility/includes/badge_certified.html" |
There was a problem hiding this comment.
A terme (et si on arrive à l'utiliser pour siae_evaluations/includes/criterion_infos.html) je trouve la version pure-python (comme pour approval_state_badge & job_application_state_badge) plus facile à maintenir plutôt que de devoir aller modifier 4 templates pour rajouter/modifier une classe...
There was a problem hiding this comment.
Je n’avais pas trop d’idées rusées pour le faire fonctionner pour itou/templates/apply/includes/certification_info_box.html, mais je suis preneur.
Après, sed marche bien pour les quelques fois où on en aura besoin 🤷.
66dee39 to
1e077ae
Compare
The certified badges are about to get smarter, depending on the API responses. Instead of writing the logic in a template, move that to Python through a template tag.
Helps communicating what criteria are certifiable and their state.
1e077ae to
8f706c6
Compare
🤔 Pourquoi ?
Mieux communiquer aux utilisateurs quels critères peuvent être certifiés, et leur statut de certification.
🏝️ Comment tester ?
📸 Captures d’écran