2013-11-05 10:36:54 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<openerp>
|
|
|
|
<data>
|
|
|
|
<!-- List of all the surveys -->
|
|
|
|
<template id="list" name="Survey List">
|
|
|
|
<t t-call="website.layout">
|
|
|
|
<div class="wrap">
|
|
|
|
<div class="container">
|
|
|
|
<h1>Open surveys</h1>
|
|
|
|
<div class="table-responsive">
|
|
|
|
<table class="table table-hover">
|
|
|
|
<tr><th>Title</th><th>Category</th><th>Description</th><th>Public URL</th></tr>
|
|
|
|
<t t-foreach="surveys" t-as="survey">
|
|
|
|
<tr>
|
|
|
|
<td><t t-esc="survey.title" /></td>
|
|
|
|
<td><t t-esc="survey.category"/></td>
|
|
|
|
<td><t t-if="survey.description is not False"><t t-esc="survey.description"/></t></td>
|
|
|
|
<td><a t-att-href="survey.public_url"><t t-esc="survey.id" /></a></td>
|
|
|
|
</tr>
|
|
|
|
</t>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</t>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<!-- A survey -->
|
|
|
|
<template id="survey" name="Survey">
|
|
|
|
<t t-call="website.layout">
|
|
|
|
<div class="wrap">
|
|
|
|
<div class="container">
|
2013-11-05 15:28:21 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-1"> </div>
|
|
|
|
<div class="col-md-1"> </div>
|
|
|
|
<div class="col-md-8">
|
|
|
|
<div class='jumbotron'>
|
|
|
|
<h1>
|
|
|
|
<t t-esc='survey.title'/>
|
|
|
|
<t t-if="survey.description is not False">
|
|
|
|
<br/>
|
|
|
|
<small><t t-esc='survey.description'/></small>
|
|
|
|
</t>
|
|
|
|
</h1>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<t t-foreach="survey.page_ids" t-as="page">
|
|
|
|
<t t-call='survey.page' />
|
|
|
|
</t>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-1"> </div>
|
|
|
|
<div class="col-md-1"> </div>
|
|
|
|
|
2013-11-05 10:36:54 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</t>
|
|
|
|
</template>
|
2013-11-05 15:28:21 +00:00
|
|
|
|
|
|
|
<!-- A page -->
|
|
|
|
<template id="page" name="Page">
|
|
|
|
<div>
|
|
|
|
<h2><t t-esc='page.title' /></h2>
|
|
|
|
<p><t t-esc='page.description'/></p>
|
|
|
|
</div>
|
|
|
|
<form role="form">
|
|
|
|
<t t-foreach='page.question_ids' t-as='question'>
|
|
|
|
<t t-call='survey.question'/>
|
|
|
|
</t>
|
|
|
|
<button type="button" class="btn btn-primary">Next page</button>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<p class="text-info">Questions marked with <span class="glyphicon glyphicon-exclamation-sign"></span> are mandatory.</p>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<!-- A question -->
|
|
|
|
<template id='question' name='Question'>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<h3>
|
|
|
|
|
|
|
|
<t t-if="question.constr_mandatory"><span class="glyphicon glyphicon-exclamation-sign"></span></t>
|
|
|
|
<t t-esc='question.sequence'/>. <t t-esc='question.question'/><br/>
|
|
|
|
|
|
|
|
<small><t t-esc='question.description'/> -- [ <t t-esc='question.type'/> ]</small></h3>
|
|
|
|
|
|
|
|
<!-- instanciating different types of questions -->
|
|
|
|
<t t-if="question.type in ['free_text']">
|
|
|
|
<textarea class="form-control" rows="3"></textarea>
|
|
|
|
</t>
|
|
|
|
|
|
|
|
<t t-if="question.type in ['textbox']">
|
|
|
|
<input type="text" class="form-control" placeholder="Your answer" />
|
|
|
|
</t>
|
|
|
|
|
|
|
|
<t t-if="question.type in ['numerical_box']">
|
|
|
|
<input type="number" class="form-control"/>
|
|
|
|
</t>
|
|
|
|
|
|
|
|
<t t-if="question.type in ['datetime']">
|
|
|
|
<input type="datetime-local" class="form-control" />
|
|
|
|
/!\ Datetime ne fonctionne pas sur tous les navigateurs... patch en JS ?
|
|
|
|
</t>
|
|
|
|
|
|
|
|
<t t-if="question.type in ['checkbox']">
|
|
|
|
Ici il faudrait afficher qqch ?
|
|
|
|
<input type="checkbox" class="form-control" />
|
|
|
|
</t>
|
|
|
|
|
|
|
|
<t t-if="question.type in ['simple_choice_scale']">
|
|
|
|
<t t-foreach='question.suggested_answers_ids' t-as='suggestion'>
|
|
|
|
<div class="radio-inline">
|
|
|
|
<label>
|
|
|
|
<input type="radio" t-att-name="suggestion.question_id" t-att-value='suggestion.value' />
|
|
|
|
<t t-esc='suggestion.value'/>
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
</t>
|
|
|
|
</t>
|
|
|
|
|
|
|
|
<t t-if="question.type in ['simple_choice_dropdown']">
|
|
|
|
<select class="form-control">
|
|
|
|
<t t-foreach='question.suggested_answers_ids' t-as='suggestion'>
|
|
|
|
<option><t t-esc='suggestion.value'/></option>
|
|
|
|
</t>
|
|
|
|
</select>
|
|
|
|
</t>
|
|
|
|
|
|
|
|
<t t-if="question.type in ['multiple_choice']">
|
|
|
|
<t t-foreach='question.suggested_answers_ids' t-as='suggestion'>
|
|
|
|
<div class="checkbox">
|
|
|
|
<label>
|
|
|
|
<input type="checkbox" t-att-name="suggestion.question_id" t-att-value='suggestion.value' />
|
|
|
|
<t t-esc='suggestion.value'/>
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
</t>
|
|
|
|
</t>
|
|
|
|
|
|
|
|
<t t-if="question.type in ['vector']">
|
|
|
|
TODO afficher les vector correctement
|
|
|
|
<t t-foreach='question.children_ids' t-as='question'>
|
|
|
|
<t t-call='survey.question' />
|
|
|
|
</t>
|
|
|
|
</t>
|
|
|
|
|
|
|
|
<t t-if="question.type in ['matrix']">
|
|
|
|
TODO afficher les matrix correctement
|
|
|
|
<t t-foreach='question.children_ids' t-as='question'>
|
|
|
|
<t t-call='survey.question' />
|
|
|
|
</t>
|
|
|
|
</t>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Comments -->
|
|
|
|
|
|
|
|
<t t-if="question.comments_allowed">
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">Any comments ?</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
TODO afficher la boîte à commentaires
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</t>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</data>
|
2013-11-05 10:36:54 +00:00
|
|
|
</openerp>
|