85 lines
3.0 KiB
HTML
85 lines
3.0 KiB
HTML
{{* =========================================================================
|
|
MODULE SONDAGE
|
|
|
|
ADMINISTRATION : accès admin géré par les permissions Paheko réelles
|
|
(membre connecté avec droit d'écriture sur la section "web"), via
|
|
{{#restrict}} ci-dessous.
|
|
========================================================================= *}}
|
|
{{#restrict section="web" level="admin"}}
|
|
{{:assign est_admin=true son_style="admin"}}
|
|
{{:assign _url="%sindex.html"|args:$module.url}}
|
|
{{else}}
|
|
{{#restrict section="users" level="admin"}}
|
|
{{:assign est_admin=false son_style="prive"}}
|
|
{{else}}
|
|
{{if $is_logged}}
|
|
{{:assign est_admin=false son_style="membre"}}
|
|
{{else}}
|
|
{{:assign est_admin=false son_style="public"}}
|
|
{{/if}}
|
|
{{/restrict}}
|
|
{{/restrict}}
|
|
|
|
{{if $est_admin==true}}
|
|
{{:admin_header title="Sondages" custom_css="/m/vote/sondage.css" layout="" current="module_vote"}}
|
|
{{if $est_admin}}<span class="badge-admin">mode admin</span>{{/if}}
|
|
{{* TODO membre logué
|
|
<link rel='stylesheet' id='agenda-css' href='agenda.css' media='all'/>*}}
|
|
{{else}}
|
|
{{:admin_header title="Sondages" custom_css="/m/vote/sondage.css" layout="" current="module_vote"}}
|
|
{{/if}}
|
|
|
|
{{* Si edition ou suppression de sondages *}}
|
|
{{if $est_admin==true}}
|
|
{{if $_GET.id > 0}}
|
|
{{:assign _nav="conf" _conf="edit_son"}}
|
|
{{/if}}
|
|
{{:assign _nav=$_GET.nav _conf=$_GET.conf}}
|
|
{{else}}
|
|
{{:assign _nav=$_GET.nav}}
|
|
{{:assign _conf=$_GET.conf}}
|
|
{{/if}}
|
|
|
|
{{* Charge le sondage choisi si dispo *}}
|
|
{{#load assign="s" id=$_GET.id|intval}}
|
|
{{else}}
|
|
{{#load assign="s" id=$_POST.id|intval}}{{/load}}
|
|
{{/load}}
|
|
{{:assign vue=$_GET.vue}}
|
|
|
|
{{* ---------- Ajout/modification/suppression d'un sondage (admin) ---------- *}}
|
|
{{if $_POST.create_son || $_POST.del_son || $_POST.save_son}}
|
|
{{:include file="manage/_sondage.html"}}
|
|
{{/if}}
|
|
|
|
{{* ---------- Ajout/suppression d'une option ou d'un vote (sondage simple, admin) ---------- *}}
|
|
{{if $_POST.add_opt_son || $_POST.del_opt_son || $_POST.del_vot_son}}
|
|
{{:include file="manage/_sondage_simple.html"}}
|
|
{{/if}}
|
|
|
|
{{* ---------- Voter sondage (public) ---------- *}}
|
|
{{if $_POST.voter_simple || $_POST.voter_creneau}}
|
|
{{:include file="manage/_vote.html"}}
|
|
{{/if}}
|
|
|
|
{{* ---------- Manage créneaux (admin) ---------- *}}
|
|
{{if $_POST.add_creneau || $_POST.ajout_multiple || $_POST.generer_creneaux || $_POST.rename_creneau || $_POST.suppr_creneau || $_POST.suppr_nom|| $_POST.enregistrer}}
|
|
{{:include file="manage/_sondage_creneaux.html"}}
|
|
{{/if}}
|
|
|
|
{{* Navigation config (admin) *}}
|
|
{{if $_nav == "conf"}}
|
|
{{if !$_conf}}
|
|
{{:include file="_nav.html" current="config" subcurrent="new_son"}}
|
|
{{:assign _conf="new_son"}}
|
|
{{else}}
|
|
{{:include file="_nav.html" current="config" subcurrent="%s"|args:$_conf}}
|
|
{{:assign _conf=$_conf}}
|
|
{{/if}}
|
|
{{:include file="_config.html" subconf=$_conf}}
|
|
{{* Navigation normale (tous) *}}
|
|
{{else}}
|
|
{{:include file="_nav.html" current="sondage" subcurrent="%s"|args:$vue}}
|
|
{{:include file="_sondage.html" _vue="%s"|args:$vue}}
|
|
{{/if}}
|
|
{{:debug get=$_GET post=$_POST cur=$current sub=$subcurrent subconf=$subconf}} |