393ebc458efe0e6b0d276162326d78896ab9e573
[platal.git] / templates / survey / edit.questions.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2011 Polytechnique.org                             *}
4 {*  http://opensource.polytechnique.org/                                  *}
5 {*                                                                        *}
6 {*  This program is free software; you can redistribute it and/or modify  *}
7 {*  it under the terms of the GNU General Public License as published by  *}
8 {*  the Free Software Foundation; either version 2 of the License, or     *}
9 {*  (at your option) any later version.                                   *}
10 {*                                                                        *}
11 {*  This program is distributed in the hope that it will be useful,       *}
12 {*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
13 {*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
14 {*  GNU General Public License for more details.                          *}
15 {*                                                                        *}
16 {*  You should have received a copy of the GNU General Public License     *}
17 {*  along with this program; if not, write to the Free Software           *}
18 {*  Foundation, Inc.,                                                     *}
19 {*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
20 {*                                                                        *}
21 {**************************************************************************}
22
23 {literal}
24 <script id="q_edit_new" type="text/x-jquery-tmpl">
25   <div style="clear: both; padding-top: 1em" class="q_edit" id="q_edit[${qid}]">
26     <div>
27       <span class="q_edit_label" style="font-weight: bold">Question ${qid + 1}</span> 
28       (<a onclick="$(this).removeQuestion()" style="text-decoration: none">
29         {/literal}{icon name="delete"}{literal} Supprimer
30       </a>)
31     </div>
32     Titre&nbsp;: <input type="text" name="q_edit[${qid}][label]"
33                         value="{{if label}}${label}{{/if}}" /><br />
34     Type de question&nbsp;: <select name="q_edit[${qid}][type]">
35       <option value=""></option>
36       <option value="section" {{if type}}{{if type == 'section'}}selected="selected"{{/if}}{{/if}}>
37         Section
38       </option>
39       <option value="text" {{if type}}{{if type == 'text'}}selected="selected"{{/if}}{{/if}}>
40         Texte
41       </option>
42       <option value="multiple" {{if type}}{{if type == 'multiple'}}selected="selected"{{/if}}{{/if}}>
43         Question à choix multiples
44       </option>
45     </select>
46     <div class="q_edit_form">
47       {{tmpl "#q_edit_base"}}
48     </div>
49   </div>
50 </script>
51
52 <script id="q_edit_base" type="text/x-jquery-tmpl">
53   {{if type}}
54     {{tmpl "#q_edit_" + type}}
55   {{/if}}
56 </script>
57
58 <script id="q_edit_text" type="text/x-jquery-tmpl">
59 </script>
60
61 <script id="q_edit_section" type="text/x-jquery-tmpl">
62   <div id="q_edit[${qid}][section]" style="padding-left: 4ex; border-left: 1px solid white">
63     <div class="add_question">
64       <a onclick="$(this).addQuestion()" style="text-decoration: none">
65         {/literal}{icon name="add"}{literal} Ajouter une question
66       </a>
67     </div>
68   </div>
69 </script>
70
71 <script id="q_edit_multiple" type="text/x-jquery-tmpl">
72   <div id="q_edit[${qid}][answers]">
73     <div class="add_answer">
74       <a onclick="$(this).multiple_addAnswer()">
75         {/literal}{icon name="add"}{literal} Ajouter une réponse
76       </a>
77     </div>
78     {{if parameters}}{{if parameters.answer}}
79       {{tmpl(parameters.answer) "#q_edit_multiple_answer"}}
80     {{/if}}{{/if}}
81     <div>
82       Permettre la sélection de plusieurs réponses ?
83       <select name="q_edit[${qid}][subtype]">
84         <option value="checkbox">Oui</option>
85         <option value="radio" selected="selected">Non</option>
86       </select>
87     </div>
88     <div>
89       Ajouter une case Autre ?
90       <select name="q_edit[${qid}][allow_other]">
91         <option value="1">Oui</option>
92         <option value="" selected="selected">Non</option>
93       </select>
94     </div>
95   </div>
96 </script>
97
98 <script id="q_edit_multiple_answer" type="text/x-jquery-tmpl">
99   <div>
100     <span class="q_edit_answer_box">
101     </span>
102     Réponse&nbsp;: <input type="text" name="q_edit[${qid}][answer][][value]" value="${value}" />
103   </div>
104 </script>
105
106 {/literal}
107
108 {* vim:set et sw=2 sts=2 ts=8 enc=utf-8: *}