change: selecteurs/ (html) en API select2.

pull/3/head
Matthieu Marcillaud 5 months ago
parent 69aa7aeb7e
commit 5b9c36a79a

@ -12,23 +12,25 @@
- _s1 : Chercher les auteurs correspondant a la requete
- _s2 : Si aucun, on recherche dans l'ensemble du texte
]
\[
{
"results": \[
<BOUCLE_e(AUTEURS auteurs_liens){tout}{objet}{id_objet}{doublons}></BOUCLE_e>
<BOUCLE_s1(AUTEURS){tout}{contenu_auteur_select strict}{0,20}{par nom}{doublons}{","}>
[(#SET{label,[(#STATUT|puce_statut{auteur}|liens_absolus) ]#NOM[ - (#BIO|textebrut|couper{20})][ ((#EMAIL))]})]
{
"label": [(#GET{label}|json_encode)],
"value": [(#ID_AUTEUR|json_encode)],
"nom": [(#NOM|json_encode)]
"id": [(#ID_AUTEUR|json_encode)],
"long_text": [(#GET{label}|json_encode)],
"text": [(#NOM|json_encode)]
}
</BOUCLE_s1>
<BOUCLE_s2(AUTEURS){tout}{contenu_auteur_select}{0,20}{par nom}{doublons}{","}>
[(#SET{label,[(#STATUT|puce_statut{auteur}|liens_absolus) ]#NOM[ - (#BIO|textebrut|couper{20})][ ((#EMAIL))]})]
{
"label": [(#GET{label}|json_encode)],
"value": [(#ID_AUTEUR|json_encode)],
"nom": [(#NOM|json_encode)]
"id": [(#ID_AUTEUR|json_encode)],
"long_text": [(#GET{label}|json_encode)],
"text": [(#NOM|json_encode)]
}
</BOUCLE_s2>
<//B_s1>
\]
\]
}

@ -17,16 +17,17 @@
- Param `groupes`. Uses id_groupe.
]
[(#ENV{groupes}|oui)[(#ENV{groupes}|explode{','}|setenv{id_groupe})]]
\[
{
"results": \[
<BOUCLE_e(MOTS){tout}{objet}{id_objet}{doublons} />
<BOUCLE_s1(MOTS){titre LIKE (#ENV*{q})%}{","}
{id_groupe ?IN #ENV{id_groupe}}
{0,20}{par titre}{doublons}{tout}>
[(#SET{label,#TITRE[ - (#DESCRIPTIF|textebrut|couper{20})][ ((#TYPE|textebrut))]})]
{
"label": [(#GET{label}|json_encode)],
"value": [(#ID_MOT|json_encode)],
"titre": [(#TITRE|textebrut|json_encode)]
"id": [(#ID_MOT|json_encode)],
"long_text": [(#GET{label}|json_encode)],
"text": [(#TITRE|textebrut|json_encode)]
}
</BOUCLE_s1>
<BOUCLE_s2(MOTS){recherche (#ENV*{q})*}{","}
@ -34,10 +35,11 @@
{0,20}{!par points}{doublons}{tout}>
[(#SET{label,#TITRE[ - (#DESCRIPTIF|textebrut|couper{20})][ ((#TYPE|textebrut))]})]
{
"label": [(#GET{label}|json_encode)],
"value": [(#ID_MOT|json_encode)],
"titre": [(#TITRE|textebrut|json_encode)]
"id": [(#ID_MOT|json_encode)],
"long_text": [(#GET{label}|json_encode)],
"text": [(#TITRE|textebrut|json_encode)]
}
</BOUCLE_s2>
<//B_s1>
\]
\]
}

@ -5,15 +5,16 @@
Chercher les rubriques correspondant a la requete
]
\[
{
"results": \[
<BOUCLE_s(RUBRIQUES){statut==.}{titre LIKE (#ENV{q})%}{0,20}{par multi titre}{","}>
#SET{label,''}
<BOUCLE_h(HIERARCHIE){statut==.}{n-3,3}>[(#SET{label,#GET{label}|concat{#TITRE|couper{12},' > '}})]</BOUCLE_h>
[(#SET{label,#GET{label}|concat{#TITRE|textebrut}})]
{
"label": [(#GET{label}|json_encode)],
"value": [(#ID_RUBRIQUE|json_encode)],
"titre": [(#TITRE|textebrut|json_encode)]
"id": [(#ID_RUBRIQUE|json_encode)],
"long_text": [(#GET{label}|json_encode)],
"text": [(#TITRE|textebrut|json_encode)]
}
</BOUCLE_s>
<BOUCLE_s1(RUBRIQUES){statut==.}{titre LIKE %(#ENV{q})%}{0,20}{par multi titre}{","}>
@ -21,9 +22,10 @@
<BOUCLE_h1(HIERARCHIE){statut==.}{n-3,3}>[(#SET{label,#GET{label}|concat{#TITRE|couper{12},' > '}})]</BOUCLE_h1>
[(#SET{label,#GET{label}|concat{#TITRE|textebrut}})]
{
"label": [(#GET{label}|json_encode)],
"value": [(#ID_RUBRIQUE|json_encode)],
"titre": [(#TITRE|textebrut|json_encode)]
"id": [(#ID_RUBRIQUE|json_encode)],
"long_text": [(#GET{label}|json_encode)],
"text": [(#TITRE|textebrut|json_encode)]
}</BOUCLE_s1>
<//B_s>
\]
}

Loading…
Cancel
Save