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