Skip to content

Éligibilité : Amélioration des badges indiquant la certification - #6755

Merged
francoisfreitag merged 2 commits into
masterfrom
ff/certified-badges
Sep 1, 2025
Merged

Éligibilité : Amélioration des badges indiquant la certification#6755
francoisfreitag merged 2 commits into
masterfrom
ff/certified-badges

Conversation

@francoisfreitag

@francoisfreitag francoisfreitag commented Aug 28, 2025

Copy link
Copy Markdown
Member

🤔 Pourquoi ?

Mieux communiquer aux utilisateurs quels critères peuvent être certifiés, et leur statut de certification.

🏝️ Comment tester ?

  1. Établir un diag d’éligibilité avec un critère certifiable
  2. Voir le nouveau badge « Certification en cours »

📸 Captures d’écran

image

@francoisfreitag francoisfreitag self-assigned this Aug 28, 2025
@francoisfreitag francoisfreitag added the modifié Modifié dans le changelog. label Aug 28, 2025
@francoisfreitag
francoisfreitag marked this pull request as draft August 28, 2025 07:37
Comment thread itou/utils/templatetags/badges.py Outdated
Comment thread itou/utils/templatetags/badges.py Outdated
Comment thread itou/templates/apply/includes/certification_info_box.html Outdated
Comment thread itou/templates/apply/includes/certification_info_box.html Outdated
Comment thread itou/utils/templatetags/badges.py Outdated
Comment on lines +123 to +131
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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 🤔.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@francoisfreitag
francoisfreitag force-pushed the ff/certified-badges branch 2 times, most recently from 6846339 to 366944c Compare August 28, 2025 08:27
@francoisfreitag francoisfreitag added the 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC label Aug 28, 2025
@github-actions

Copy link
Copy Markdown

🥁 La recette jetable est prête ! 👉 Je veux tester cette PR !

Base automatically changed from ff/certified-at to master August 28, 2025 09:38
@francoisfreitag
francoisfreitag force-pushed the ff/certified-badges branch 2 times, most recently from 1f24f63 to b75aa29 Compare August 28, 2025 09:49
@francoisfreitag
francoisfreitag marked this pull request as ready for review August 28, 2025 12:20
Comment thread tests/eligibility/factories.py
Comment thread itou/templates/apply/includes/certification_info_box.html Outdated
Comment thread itou/templates/apply/includes/certification_info_box.html Outdated
Comment thread itou/templates/apply/includes/certification_info_box.html Outdated
Comment thread itou/templates/apply/includes/certification_info_box.html Outdated

if selected_criterion.certified_at:
if selected_criterion.certified is True:
template = "eligibility/includes/badge_certified.html"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 🤷.

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.
@francoisfreitag
francoisfreitag added this pull request to the merge queue Sep 1, 2025
Merged via the queue into master with commit fe1ae71 Sep 1, 2025
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC modifié Modifié dans le changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants