From 8012c629de412000ef88cb7a4d65dedf006ce317 Mon Sep 17 00:00:00 2001 From: Sylvain Boissel Date: Thu, 23 May 2024 11:35:18 +0200 Subject: [PATCH] Cartes : gestion du ratio de l'image (#147) * Cards: Add ratio management and fix the detail icon class * Update dependencies * Replace gouvernement.fr with info.gouv.fr * Fix documentation * Fix URL --- dsfr/constants.py | 17 + dsfr/locale/fr/LC_MESSAGES/django.po | 16 +- dsfr/templates/dsfr/card.html | 6 +- dsfr/templates/dsfr/footer.html | 4 +- dsfr/templatetags/dsfr_tags.py | 16 + example_app/dsfr_components.py | 3 +- example_app/locale/fr/LC_MESSAGES/django.mo | Bin 1285 -> 1350 bytes example_app/locale/fr/LC_MESSAGES/django.po | 8 +- .../example_app/blocks/main_menu.html | 4 +- .../templates/example_app/page_component.html | 10 +- poetry.lock | 485 +++++++++--------- pyproject.toml | 2 +- 12 files changed, 298 insertions(+), 273 deletions(-) diff --git a/dsfr/constants.py b/dsfr/constants.py index 6255d292d..378db3f06 100644 --- a/dsfr/constants.py +++ b/dsfr/constants.py @@ -56,3 +56,20 @@ (_("System colors"), COLOR_CHOICES_SYSTEM), (_("Illustration colors"), COLOR_CHOICES_ILLUSTRATION), ] + +# Ratio classes used for medias and cards +IMAGE_RATIOS = [ + ("fr-ratio-32x9", "32x9"), + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-3x2", "3x2"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), + ("fr-ratio-3x4", "3x4"), + ("fr-ratio-2x3", "2x3"), +] + +VIDEO_RATIOS = [ + ("fr-ratio-16x9", "16x9"), + ("fr-ratio-4x3", "4x3"), + ("fr-ratio-1x1", "1x1"), +] diff --git a/dsfr/locale/fr/LC_MESSAGES/django.po b/dsfr/locale/fr/LC_MESSAGES/django.po index 3846df56a..bc4ae6836 100644 --- a/dsfr/locale/fr/LC_MESSAGES/django.po +++ b/dsfr/locale/fr/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-10 16:17+0200\n" +"POT-Creation-Date: 2024-05-23 11:01+0200\n" "PO-Revision-Date: 2024-04-10 16:19+0200\n" "Last-Translator: \n" "Language-Team: \n" @@ -276,32 +276,32 @@ msgstr "Suivez-nous
sur les réseaux sociaux" msgid "Back to home page" msgstr "Retour à l’accueil du site" -#: dsfr/templates/dsfr/footer.html:93 +#: dsfr/templates/dsfr/footer.html:92 msgid "Sitemap" msgstr "Plan du site" -#: dsfr/templates/dsfr/footer.html:98 +#: dsfr/templates/dsfr/footer.html:97 #, python-format msgid "Accessibility: %(accessibility_status)s compliant" msgstr "Accessibilité : %(accessibility_status)s conforme" -#: dsfr/templates/dsfr/footer.html:103 +#: dsfr/templates/dsfr/footer.html:102 msgid "Legal notice" msgstr "Mentions légales" -#: dsfr/templates/dsfr/footer.html:106 +#: dsfr/templates/dsfr/footer.html:105 msgid "Personal data" msgstr "Données personnelles" -#: dsfr/templates/dsfr/footer.html:109 +#: dsfr/templates/dsfr/footer.html:108 msgid "Cookie management" msgstr "Gestion des cookies" -#: dsfr/templates/dsfr/footer.html:115 +#: dsfr/templates/dsfr/footer.html:114 msgid "etalab-2.0 license" msgstr "licence etalab-2.0" -#: dsfr/templates/dsfr/footer.html:116 +#: dsfr/templates/dsfr/footer.html:115 msgid "" "Unless explicit mention of intellectual property held by third parties, the " "contents of this site are offered under" diff --git a/dsfr/templates/dsfr/card.html b/dsfr/templates/dsfr/card.html index 000600d04..241291c34 100644 --- a/dsfr/templates/dsfr/card.html +++ b/dsfr/templates/dsfr/card.html @@ -38,7 +38,7 @@ {% endif %} {% if self.top_detail.detail %} -

+

{{ self.top_detail.detail.text }}

{% endif %} @@ -46,7 +46,7 @@ {% endif %} {% if self.bottom_detail %}
-

+

{{ self.bottom_detail.text }}

@@ -77,7 +77,7 @@
{% if self.image_url %}
- {{ self.image_alt }}
diff --git a/dsfr/templates/dsfr/footer.html b/dsfr/templates/dsfr/footer.html index 07ccb1ada..be1655888 100644 --- a/dsfr/templates/dsfr/footer.html +++ b/dsfr/templates/dsfr/footer.html @@ -57,10 +57,10 @@