{literal}
<script id="q_edit_new" type="text/x-jquery-tmpl">
- <div style="clear: both; padding-top: 1em" class="q_edit" id="q_edit[${qid}]">
- <div>
+ <fieldset style="clear: both; padding-top: 1em; background: inherit; color: inherit"
+ class="q_edit" id="q_edit[${qid}]">
+ <legend>
<span class="q_edit_label" style="font-weight: bold">Question ${qid + 1}</span>
+ <input type="text" name="q_edit[${qid}][label]" value="{{if label}}${label}{{/if}}" />
(<a onclick="$(this).removeQuestion()" style="text-decoration: none">
{/literal}{icon name="delete"}{literal} Supprimer
- </a>)
- </div>
- Titre : <input type="text" name="q_edit[${qid}][label]"
- value="{{if label}}${label}{{/if}}" /><br />
- Type de question : <select name="q_edit[${qid}][type]">
- <option value=""></option>
- <option value="text" {{if type}}{{if type == 'text'}}selected="selected"{{/if}}{{/if}}>Texte</option>
- <option value="section"{{if type}}{{if type == 'section'}}selected="selected"{{/if}}{{/if}}>Section</option>
- </select>
+ </a>)<br />
+ Type de question : <select name="q_edit[${qid}][type]">
+ <option value=""></option>
+ <option value="section" {{if type}}{{if type == 'section'}}selected="selected"{{/if}}{{/if}}>
+ Section
+ </option>
+ <option value="text" {{if type}}{{if type == 'text'}}selected="selected"{{/if}}{{/if}}>
+ Texte
+ </option>
+ <option value="multiple" {{if type}}{{if type == 'multiple'}}selected="selected"{{/if}}{{/if}}>
+ Question à choix multiples
+ </option>
+ </select>
+ </legend>
<div class="q_edit_form">
{{tmpl "#q_edit_base"}}
</div>
- </div>
+ </fieldset>
</script>
<script id="q_edit_base" type="text/x-jquery-tmpl">
</script>
<script id="q_edit_section" type="text/x-jquery-tmpl">
- <div id="section_${qid}" style="padding-left: 4ex; border-left: 1px solid white">
- {{if children}}
- {{tmpl(children) "#q_edit_new"}}
- {{/if}}
+ <div id="q_edit[${qid}][section]">
<div class="add_question">
<a onclick="$(this).addQuestion()" style="text-decoration: none">
{/literal}{icon name="add"}{literal} Ajouter une question
</a>
</div>
+ </div>
+</script>
+
+<script id="q_edit_multiple" type="text/x-jquery-tmpl">
+ <div id="q_edit[${qid}][answers]">
+ <div>
+ Permettre la sélection de plusieurs réponses ?
+ <select name="q_edit[${qid}][subtype]">
+ <option value="checkbox">Oui</option>
+ <option value="radio" selected="selected">Non</option>
+ </select>
+ </div>
+ <div class="add_answer">
+ <a onclick="$(this).multiple_addAnswer()">
+ {/literal}{icon name="add"}{literal} Ajouter une réponse
+ </a>
+ </div>
+ <div>
+ Ajouter une case Autre ?
+ <select name="q_edit[${qid}][allow_other]">
+ <option value="1">Oui</option>
+ <option value="" selected="selected">Non</option>
+ </select>
+ </div>
+ </div>
+</script>
+
+<script id="q_edit_multiple_answer" type="text/x-jquery-tmpl">
<div>
+ <span class="q_edit_answer_box"></span>
+ <input type="text" name="q_edit[${qid}][answers][]" value="${value}" />
+ <a onclick="$(this).multiple_removeAnswer()">{/literal}{icon name="delete"}{literal}</a>
+ </div>
</script>
+
{/literal}
{* vim:set et sw=2 sts=2 ts=8 enc=utf-8: *}