87 lines
2.7 KiB
HTML
87 lines
2.7 KiB
HTML
<div class="formulaire_spip formulaire_#FORM">
|
|
|
|
[<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
|
|
[<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
|
|
|
|
|
|
<form name="formulaire_#FORM" action="#ENV{action}" method="post"><div>
|
|
#ACTION_FORMULAIRE{#ENV{action}}
|
|
|
|
<table id="gestion_autorisations" class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Auteur</th>
|
|
<BOUCLE_nomAuth(DATA){source tableau, #ENV{auth_modele}}>
|
|
<td>#VALEUR{label}</td>
|
|
</BOUCLE_nomAuth>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<BOUCLE_auteurs(AUTEURS)
|
|
{id_auteur ?!IN #ENV{id_auteur}}
|
|
{statut ?!IN #ENV{statut}}
|
|
{pgp ?!IN #ENV{pgp}}
|
|
{webmestre?}
|
|
{tout}>
|
|
[(#SET{nom_modele,#AUT_MODELE|json_decode{true}|table_valeur{name}})]
|
|
<tr id="auteur-#ID_AUTEUR" data-id_auteur="#ID_AUTEUR">
|
|
<td>
|
|
<div>
|
|
[(#PGP|=={boss}|oui)
|
|
<img class="boss" src="[(#CHEMIN{img/boss.png})]" alt="boss"/>
|
|
]
|
|
#NOM
|
|
[(#PGP|=={boss}|non)
|
|
<button class="toggle_save_modele" type="button"
|
|
title="<:auted:sauvegarder_modele:>"
|
|
data-id_auteur="#ID_AUTEUR"
|
|
>
|
|
<svg class="icone_svg [ (#GET{nom_modele}|oui)checked]" alt="">
|
|
<title></title>
|
|
<use xlink:href="[(#CHEMIN{img/toggle.svg})]#toggle" />
|
|
</svg>
|
|
</button>
|
|
]
|
|
</div>
|
|
<div class="enregistrer_modele modele-#ID_AUTEUR[ (#GET{nom_modele}|non)pas_modele]">
|
|
<input id="modele-#ID_AUTEUR" class="" type="text" value="[(#GET{nom_modele})]" name="modele-#ID_AUTEUR"/>
|
|
</div>
|
|
<input type="hidden" name="Tid_auteur[]" value="#ID_AUTEUR" placeholder="Nom modèle">
|
|
</td>
|
|
<BOUCLE_valeurAuth(DATA){source tableau, #ENV{auth_modele}}>
|
|
[(#SET{autorisations,#AUTORISATIONS|json_decode{true}|table_valeur{#VALEUR{type}}})]
|
|
<td>
|
|
[(#PGP|!={boss}|oui)
|
|
<INCLURE{fond=inclure/auth_choix,id_auteur,type=#VALEUR{type},faire=#VALEUR{faire},autorisations=#GET{autorisations}}>
|
|
]
|
|
</td>
|
|
</BOUCLE_valeurAuth>
|
|
</tr>
|
|
</BOUCLE_auteurs>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p class="boutons"><input type="submit" class="submit" value="Valider" ></p>
|
|
</div></form>
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
|
|
jQuery(function() {
|
|
editer_autorisations();
|
|
//onAjaxLoad(editer_autorisations);
|
|
|
|
function editer_autorisations(){
|
|
$('.toggle_save_modele').on('click', function(e){
|
|
e.stopPropagation();
|
|
var id_auteur = $(this).data('id_auteur');
|
|
var nom_modele = $('#modele-'+id_auteur).val().trim();
|
|
if (!nom_modele) {
|
|
$('.modele-'+id_auteur).toggleClass('pas_modele');
|
|
$(this).children('svg').toggleClass('checked');
|
|
}
|
|
})
|
|
}
|
|
});
|
|
|
|
</script>
|