Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mise à jour "éligible au bonus réparation" + mutualisation dans une constante #1039

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
"filename": "core/settings.py",
"hashed_secret": "1ee34e26aeaf89c64ecc2c85efe6a961b75a50e9",
"is_verified": false,
"line_number": 208
"line_number": 209
}
],
"docker-compose.yml": [
Expand Down Expand Up @@ -207,5 +207,5 @@
}
]
},
"generated_at": "2024-11-14T16:27:43Z"
"generated_at": "2024-11-19T08:59:11Z"
}
1 change: 1 addition & 0 deletions core/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bonus_reparation = "Propose le bonus réparation"
6 changes: 6 additions & 0 deletions core/context_processors.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
from django.conf import settings

from . import constants


def environment(request):
return {
"ENVIRONMENT": settings.ENVIRONMENT,
"DEBUG": settings.DEBUG,
"is_embedded": True,
}


def content(request):
return vars(constants)
1 change: 1 addition & 0 deletions core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def context_processors():
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
"core.context_processors.environment",
"core.context_processors.content",
"dsfr.context_processors.site_config",
]

Expand Down
2 changes: 1 addition & 1 deletion integration_tests/qfdmo/test_acteur_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class TestDisplayLabel:
),
(
[("label", "Mon label", False, True)],
"Éligible au bonus réparation",
"Propose le bonus réparation",
True,
),
],
Expand Down
2 changes: 1 addition & 1 deletion jinja2/qfdmo/acteur/_labels/bonus.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{% with content="Éligible au bonus réparation",icon="fr-icon-percent-line" %}
{% with content=bonus_reparation,icon="fr-icon-percent-line" %}
{% include "qfdmo/shared/tag.html" %}
{% endwith %}
2 changes: 1 addition & 1 deletion jinja2/qfdmo/acteur/tabs/sections/bonus.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{% block title %}
{# TODO : icone #}
<span class="fr-icon qfdmo-mr-1w fr-icon-percent-line"></span>Éligible au bonus réparation
<span class="fr-icon qfdmo-mr-1w fr-icon-percent-line"></span>{{ bonus_reparation }}
{% endblock title %}

{% block content %}
Expand Down
3 changes: 2 additions & 1 deletion qfdmo/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from django.utils.safestring import mark_safe
from dsfr.forms import DsfrBaseForm

from core.constants import bonus_reparation
from qfdmo.fields import GroupeActionChoiceField
from qfdmo.geo_api import epcis_from, formatted_epcis_as_list_of_tuple
from qfdmo.models import DagRun, DagRunStatus, SousCategorieObjet
Expand Down Expand Up @@ -179,7 +180,7 @@ def load_choices(self, request: HttpRequest, **kwargs) -> None:
),
label=mark_safe(
"<span class='fr-icon--sm fr-icon-percent-line'></span>"
"&nbsp;Éligible au bonus réparation"
f"&nbsp;{bonus_reparation}"
),
help_text=mark_safe(
"Afficher uniquement les adresses éligibles (uniquement valable lorsque l'"
Expand Down
Loading