Skip to content

Commit a10bb04

Browse files
authored
Gestion des retours à la ligne de la descriptiion (#1588)
1 parent 275fd82 commit a10bb04

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

core/jinja2_handler.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from django.http import HttpRequest
55
from django.templatetags.static import static
66
from django.urls import reverse
7+
from django.utils.html import linebreaks
78

89
from core.templatetags.seo_tags import get_sharer_content
910
from core.utils import get_direction
@@ -77,4 +78,5 @@ def environment(**options):
7778
),
7879
}
7980
)
81+
env.filters.update({"linebreaks": linebreaks})
8082
return env

jinja2/qfdmo/acteur/tabs/sections/description.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
{% endblock title %}
66

77
{% block content %}
8-
{{ object.description }}
8+
{{ object.description|linebreaks|safe }}
99
{% endblock content %}

jinja2/qfdmo/acteur/tabs/sections/horaires.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
</p>
1313
{% endif %}
1414

15-
{% if object.uniquement_sur_rdv and object.horaires_description|safe %}
15+
{% if object.uniquement_sur_rdv and object.horaires_description %}
1616
{% include "qfdmo/acteur/tabs/_separator.html" %}
1717
{% endif %}
1818

19-
{{ object.horaires_description|replace("\n", "<br>")|safe }}
19+
{{ object.horaires_description|linebreaks|safe }}
2020
</div>
2121
{% endblock content %}

0 commit comments

Comments
 (0)