From bf65153163a1ffef83ffb73e77d9b57bd85b35a5 Mon Sep 17 00:00:00 2001 From: Serghei Mihai Date: Tue, 30 May 2023 11:38:26 +0200 Subject: [PATCH] est-ensemble: allow picture for form link cell (#77991) --- static/est-ensemble/_custom.scss | 21 +++++++++++++++++++ static/est-ensemble/config.json | 5 +++++ .../variants/est-ensemble/combo/wcs/form.html | 14 +++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 templates/variants/est-ensemble/combo/wcs/form.html diff --git a/static/est-ensemble/_custom.scss b/static/est-ensemble/_custom.scss index dbca7d97..e35b5e86 100644 --- a/static/est-ensemble/_custom.scss +++ b/static/est-ensemble/_custom.scss @@ -60,6 +60,27 @@ div.gru-nav { } } +div.wcsformcell.has-asset-picture { + a { + text-decoration: none; + &:hover { + color: $cell-entry-hover-color; + } + } + img { + padding: $cell-image-padding; + } + span.form--title { + display: block; + padding: 0 $cell-image-padding; + font-weight: 600; + } + div.description { + padding: 0 1rem; + font-size: 0.9em; + } +} + /* custom est-ensemble menu entry */ li.menu-est-ensemble a { background: $ee-red; diff --git a/static/est-ensemble/config.json b/static/est-ensemble/config.json index 7e03a406..219a72a4 100644 --- a/static/est-ensemble/config.json +++ b/static/est-ensemble/config.json @@ -10,6 +10,11 @@ "header:background": {"label": "Têtière : image de fond"}, "header:logo": {"label": "Têtière : logo"}, "emails:logo": {"label": "Emails : logo"} + }, + "COMBO_CELL_ASSET_SLOTS.update": { + "wcs_wcsformcell": { + "picture": {"prefix": "Image"} + } } } } diff --git a/templates/variants/est-ensemble/combo/wcs/form.html b/templates/variants/est-ensemble/combo/wcs/form.html new file mode 100644 index 00000000..dfca1e2f --- /dev/null +++ b/templates/variants/est-ensemble/combo/wcs/form.html @@ -0,0 +1,14 @@ +{% extends "combo/wcs/form_link_fragment.html" %} +{% load assets %} + +{% block form-link-title %} + {% get_asset cell=cell type='picture' as asset %} + {% if asset.asset.url %} + {% include "combo/asset_picture_fragment.html" %} + {% endif %} + {{ title }} +{% endblock %} + +{% block form-link-description %} + {{ description|safe }} +{% endblock %}