From 3bf047c7f860cb394d8dc56fb2601e481b9ae19f Mon Sep 17 00:00:00 2001
From: yoho <test@yohooo.org>
Date: Mon, 13 Nov 2023 15:49:53 +0100
Subject: [PATCH] =?UTF-8?q?feat(#4914):=20Possibilit=C3=A9=20de=20masquer?=
 =?UTF-8?q?=20la=20l=C3=A9gende,=20en=20tout=20ou=20partie.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Pour ce faire :
- un paramètre `masquer`
- plusieurs valeurs possibles, séparables par virgule :
  * `legende` pour masquer l'intégralité de la légende
  * `titre` pour masquer le titre
  * `descriptif` pour masquer le `descriptif`
  * `credits` pour masquer les crédits

fix #4914
---
 modeles/document_legende.html | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/modeles/document_legende.html b/modeles/document_legende.html
index 07812138..da554c06 100644
--- a/modeles/document_legende.html
+++ b/modeles/document_legende.html
@@ -1,11 +1,12 @@
 [(#REM)
 	Legende pour les documents
-]<BOUCLE_legendaire (DOCUMENTS) {id_document=#ENV{id,#ENV{id_document}}} {tout}>
+	]#SET{masquer,#VAL{trim}|array_map{#ENV{masquer}|explode{','}|}}
+<BOUCLE_legendaire (DOCUMENTS) {id_document=#ENV{id,#ENV{id_document}}} {tout} {si #GET{masquer}|find{legende}|non}>
 [(#ENV*{titre,#TITRE}|trim|sinon{#ENV*{descriptif,#DESCRIPTIF}|trim}|sinon{#ENV*{credits,#CREDITS}|trim}|oui)
 <figcaption class='spip_doc_legende'>
-	[<div class='spip_doc_titre [(#ENV{titre}|non)#EDIT{titre}]'><strong>(#ENV*{titre,#TITRE*|supprimer_numero}|propre|ptobr)</strong></div>]
-	[<div class='spip_doc_descriptif [(#ENV{descriptif}|non)#EDIT{descriptif}]'>(#ENV*{descriptif,#DESCRIPTIF*}|propre|PtoBR)[(#NOTES|PtoBR)]</div>]
-	[<div class='spip_doc_credits [(#ENV{credits}|non)#EDIT{credits}]'>(#ENV*{credits,#CREDITS*}|propre|PtoBR)</div>]
+	[(#GET{masquer}|find{titre}|non)[<div class='spip_doc_titre [(#ENV{titre}|non)#EDIT{titre}]'><strong>(#ENV*{titre,#TITRE*|supprimer_numero}|propre|ptobr)</strong></div>]]
+	[(#GET{masquer}|find{descriptif}|non)[<div class='spip_doc_descriptif [(#ENV{descriptif}|non)#EDIT{descriptif}]'>(#ENV*{descriptif,#DESCRIPTIF*}|propre|PtoBR)[(#NOTES|PtoBR)]</div>]]
+	[(#GET{masquer}|find{credits}|non)[<div class='spip_doc_credits [(#ENV{credits}|non)#EDIT{credits}]'>(#ENV*{credits,#CREDITS*}|propre|PtoBR)</div>]]
 </figcaption>
 ]
 </BOUCLE_legendaire>
-- 
GitLab