Merge remote branch 'origin/xorg/maint' into xorg/master
[platal.git] / templates / survey / edit.questions.tpl
CommitLineData
47001402
FB
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">
2a0c59cf
FB
25 <fieldset style="clear: both; padding-top: 1em; background: inherit; color: inherit"
26 class="q_edit" id="q_edit[${qid}]">
27 <legend>
5f2f6b6d 28 <span class="q_edit_label" style="font-weight: bold">Question ${qid + 1}</span>
2a0c59cf 29 <input type="text" name="q_edit[${qid}][label]" value="{{if label}}${label}{{/if}}" />
5f2f6b6d
FB
30 (<a onclick="$(this).removeQuestion()" style="text-decoration: none">
31 {/literal}{icon name="delete"}{literal} Supprimer
2a0c59cf
FB
32 </a>)<br />
33 Type de question&nbsp;: <select name="q_edit[${qid}][type]">
34 <option value=""></option>
35 <option value="section" {{if type}}{{if type == 'section'}}selected="selected"{{/if}}{{/if}}>
36 Section
37 </option>
38 <option value="text" {{if type}}{{if type == 'text'}}selected="selected"{{/if}}{{/if}}>
ced5514d 39 Champ libre
2a0c59cf
FB
40 </option>
41 <option value="multiple" {{if type}}{{if type == 'multiple'}}selected="selected"{{/if}}{{/if}}>
42 Question à choix multiples
43 </option>
44 </select>
45 </legend>
5f2f6b6d
FB
46 <div class="q_edit_form">
47 {{tmpl "#q_edit_base"}}
48 </div>
2a0c59cf 49 </fieldset>
47001402
FB
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">
ced5514d
FB
59 Type de texte&nbsp;:
60 <select name="q_edit[${qid}][subtype]">
61 <option value="monoline" {{if subtype}}{{if subtype == 'monoline'}}selected="selected"{{/if}}{{/if}}>
62 Une seule ligne
63 </option>
64 <option value="multiline" {{if subtype}}{{if subtype == 'multiline'}}selected="selected"{{/if}}{{/if}}>
65 Plusieurs lignes
66 </option>
67 </select>
47001402
FB
68</script>
69
70<script id="q_edit_section" type="text/x-jquery-tmpl">
320cde03
FB
71 <div>
72 Type de section&nbsp;:
73 <select name="q_edit[${qid}][subtype]">
74 <option value="group" {{if subtype}}{{if subtype == 'group'}}selected="selected"{{/if}}{{/if}}>
75 Groupe de questions
76 </option>
77 <option value="page" {{if subtype}}{{if subtype == 'page'}}selected="selected"{{/if}}{{/if}}>
78 Nouvelle page
79 </option>
80 </select>
81 </div>
2a0c59cf 82 <div id="q_edit[${qid}][section]">
5f2f6b6d
FB
83 <div class="add_question">
84 <a onclick="$(this).addQuestion()" style="text-decoration: none">
47001402
FB
85 {/literal}{icon name="add"}{literal} Ajouter une question
86 </a>
87 </div>
5aed580a 88 </div>
47001402 89</script>
3ddf2584 90
eb9bea42 91<script id="q_edit_multiple" type="text/x-jquery-tmpl">
3ddf2584 92 <div id="q_edit[${qid}][answers]">
b09bfb14
FB
93 <div>
94 Permettre la sélection de plusieurs réponses ?
95 <select name="q_edit[${qid}][subtype]">
2f854773
FB
96 <option value="checkbox" {{if subtype}}{{if subtype == 'checkbox'}}selected="selected"{{/if}}{{/if}}>
97 Oui
98 </option>
99 <option value="radio" {{if subtype}}{{if subtype == 'radio'}}selected="selected"{{/if}}{{/if}}>
100 Non
101 </option>
b09bfb14
FB
102 </select>
103 </div>
2a0c59cf
FB
104 <div class="add_answer">
105 <a onclick="$(this).multiple_addAnswer()">
106 {/literal}{icon name="add"}{literal} Ajouter une réponse
107 </a>
108 </div>
3ddf2584
FB
109 <div>
110 Ajouter une case Autre ?
111 <select name="q_edit[${qid}][allow_other]">
b5ed03fd
FB
112 <option value="1" {{if $item.allow_other}}selected="selected"{{/if}}>Oui</option>
113 <option value="" {{if !$item.allow_other}}selected="selected"{{/if}}>Non</option>
3ddf2584
FB
114 </select>
115 </div>
116 </div>
117</script>
43f0c040
FB
118
119<script id="q_edit_multiple_answer" type="text/x-jquery-tmpl">
b09bfb14 120 <div>
e1bf2a63 121 <span class="q_edit_answer_box"></span>
2a0c59cf
FB
122 <input type="text" name="q_edit[${qid}][answers][]" value="${value}" />
123 <a onclick="$(this).multiple_removeAnswer()">{/literal}{icon name="delete"}{literal}</a>
b09bfb14 124 </div>
43f0c040 125</script>
47001402
FB
126{/literal}
127
128{* vim:set et sw=2 sts=2 ts=8 enc=utf-8: *}