d47feda2f42a889a17e25220294ad942d00eba23
[spip_souscriptions.git] / formulaires / editer_souscription_campagne.html
1 <div class="formulaire_spip formulaire_editer formulaire_#FORM formulaire_#FORM-#ENV{id_souscription_campagne,nouveau}">
2   [<p class="reponse_formulaire reponse_formulaire_ok">(#ENV**{message_ok})</p>]
3   [<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
4
5   [(#ENV{editable})
6   <form method="post" action="#ENV{action}"><div>
7       #ACTION_FORMULAIRE{#ENV{action}}
8
9       <ul>
10               #SET{name,titre}#SET{obli,'obligatoire'}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
11         <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
12           <label for="#GET{name}"><:souscription:label_titre:> <:info_obligatoire_02:></label>[
13           <span class='erreur_message'>(#GET{erreurs})</span>
14           ]<input type="text" name="#GET{name}" class="text" value="#ENV*{#GET{name},#GET{defaut}}" id="#GET{name}" [(#HTML5|et{#GET{obli}})required='required']/>
15         </li>
16               #SET{name,type_objectif}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
17         <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
18           <label for="#GET{name}"><:souscription:label_type_objectif:></label>[
19           <span class='erreur_message'>(#GET{erreurs})</span>
20           ]<select name="#GET{name}" class="select" id="#GET{name}">
21             #SET{val,don}
22             <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]><:souscription_campagne:label_type_objectif_dons:></option>
23             #SET{val,adhesion}
24             <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]><:souscription_campagne:label_type_objectif_adhesions:></option>
25           </select>
26                 <p class="explication"><:souscription:explication_type_objectif:></p>
27         </li>
28               #SET{name,texte}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
29                                 <li class="editer pleine_largeur editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
30                                         <label for="#GET{name}"><:souscription:label_description:></label>[
31                                         <span class='erreur_message'>(#GET{erreurs})</span>
32                                         ]<textarea name="#GET{name}" class="textarea" rows="10">
33 #ENV*{#GET{name},#GET{defaut}}</textarea>
34                                 </li>
35               #SET{name,objectif_oui_non}#SET{obli,''}#SET{defaut,#ENV{_defaut_objectif,''}}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
36               <li class="editer pleine_largeur editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">[
37                         <span class='erreur_message'>(#GET{erreurs})</span>
38                         ]
39                         #SET{val,'off'}
40                         <input type="hidden" name="#GET{name}" value="#GET{val}" />
41                         #SET{val,on}
42                         <div class="choix">
43                                 <input type="checkbox" name="#GET{name}" class="checkbox" id="#GET{name}_#GET{val}" value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)checked="checked"] />
44                                 <label for="#GET{name}_#GET{val}"><:souscription:label_objectif_oui_non:></label>
45                         </div>
46                 </li>
47               <li class="suite fieldset limite[(#ENV{#GET{name},#GET{defaut}}|=={on}|non)none]">
48                         <fieldset>
49                                 <legend><:souscription:label_objectif_groupe:></legend>
50                                 <ul>
51                                       #SET{name,objectif}#SET{obli,'obligatoire'}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
52                                 <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
53                                   <label for="#GET{name}"><:souscription:label_objectif:> <:info_obligatoire_02:></label>[
54                                   <span class='erreur_message'>(#GET{erreurs})</span>
55                                   ]<input type="text" name="#GET{name}" class="text" value="#ENV*{#GET{name},#GET{defaut}}" id="#GET{name}"/>
56                                         <p class="explication"><:souscription:explication_campagne_objectif:></p>
57                                 </li>
58                                       #SET{name,objectif_initial}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
59                                 <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
60                                   <label for="#GET{name}"><:souscription:label_objectif_initial:></label>[
61                                   <span class='erreur_message'>(#GET{erreurs})</span>
62                                   ]<input type="text" name="#GET{name}" class="text" value="#ENV*{#GET{name},#GET{defaut}}" id="#GET{name}" [(#HTML5|et{#GET{obli}})required='required']/>
63                                         <p class="explication"><:souscription:explication_campagne_objectif_initial:></p>
64                                 </li>
65                                       #SET{name,objectif_limiter}#SET{obli,''}#SET{defaut,#ENV{_defaut_objectif,''}}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
66                                       <li class="editer pleine_largeur editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">[
67                                                 <span class='erreur_message'>(#GET{erreurs})</span>
68                                                 ]
69                                                 #SET{val,'off'}
70                                                 <input type="hidden" name="#GET{name}" value="#GET{val}" />
71                                                 #SET{val,on}
72                                                 <div class="choix">
73                                                         <input type="checkbox" name="#GET{name}" class="checkbox" id="#GET{name}_#GET{val}" value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)checked="checked"] />
74                                                         <label for="#GET{name}_#GET{val}"><:souscription:label_objectif_limite:></label>
75                                                 </div>
76                                               <p class="explication"><:souscription:explication_campagne_objectif_limite:></p>
77                                         </li>
78                               </ul>
79                       </fieldset>
80               </li>
81               #SET{name,configuration_specifique}#SET{obli,''}#SET{defaut,#ENV{_defaut_objectif,''}}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
82               <li class="editer pleine_largeur editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">[
83                         <span class='erreur_message'>(#GET{erreurs})</span>
84                         ]
85                         #SET{val,'off'}
86                         <input type="hidden" name="#GET{name}" value="#GET{val}" />
87                         #SET{val,on}
88                         <div class="choix">
89                                 <input type="checkbox" name="#GET{name}" class="checkbox" id="#GET{name}_#GET{val}" value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)checked="checked"] />
90                                 <label for="#GET{name}_#GET{val}"><:souscription:label_configuration_specifique:></label>
91                         </div>
92                       <p class="explication"><:souscription:explication_configuration_specifique:></p>
93                 </li>
94               <li class="suite fieldset configuration_specifique[(#ENV{#GET{name},#GET{defaut}}|=={on}|non)none]">
95                         <fieldset>
96                                 <legend><:souscription:label_objectif_groupe:></legend>
97                                 <ul>
98                                       #SET{name,type_saisie}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
99                           <li class="editer editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
100                             <label for="#GET{name}"><:souscription:label_type_saisie:></label>[
101                             <span class='erreur_message'>(#GET{erreurs})</span>
102                             ]<select name="#GET{name}" class="select" id="#GET{name}">
103                               #SET{val,input}
104                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]><:souscription:configurer_type_saisie_input:></option>
105                               #SET{val,radio}
106                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]><:souscription:configurer_type_saisie_radio:></option>
107                               #SET{val,selection}
108                               <option value="#GET{val}"[(#ENV{#GET{name},#GET{defaut}}|=={#GET{val}}|oui)selected="selected"]><:souscription:configurer_type_saisie_selection:></option>
109                             </select>
110                                   <p class="explication"><:souscription:explication_type_saisie:></p>
111                           </li>
112                                       #SET{name,montants}#SET{obli,''}#SET{defaut,''}#SET{erreurs,#ENV**{erreurs}|table_valeur{#GET{name}}}
113                           <li class="editer pleine_largeur editer_[(#GET{name})][ (#GET{obli})][ (#GET{erreurs}|oui)erreur]">
114                             <label for="#GET{name}"><:souscription:label_montants:></label>[
115                             <span class='erreur_message'>(#GET{erreurs})</span>
116                             ]<textarea name="#GET{name}" class="textarea" rows="4">
117 #ENV*{#GET{name},#GET{defaut}}</textarea>
118                             <p class="explication"><:souscription:explication_montants:></p>
119                           </li>
120                               </ul>
121                       </fieldset>
122               </li>
123       </ul>
124
125       <p class="boutons"><input type="submit" class="submit" value="<:souscription:confirmer_creation_campagne:>" /></p>
126     </div>
127   </form>
128   ]
129 </div>
130 <INCLURE{fond=formulaires/inc-formulaires-suite} />
131 <script type="application/javascript">
132 function up_visibility_montants(){
133         var val = jQuery('select[name="type_saisie"]').val();
134         console.log(val);
135         if (val=="input")
136                 jQuery(".editer_montants").hide('fast');
137         else
138                 jQuery(".editer_montants").show('fast');
139 }
140 jQuery(function(){
141         up_visibility_montants();
142         jQuery('select[name="type_saisie"],input.checkbox[name="configuration_specifique"]').change(up_visibility_montants);
143 });
144 </script>