2013-11-05 10:36:54 +00:00
<?xml version="1.0" encoding="utf-8"?>
<openerp >
2013-11-25 08:04:46 +00:00
<data >
2013-12-16 15:32:44 +00:00
<!-- "Thank you" message when the survey is completed -->
2013-12-24 15:59:40 +00:00
<template id= "sfinished" name= "Survey Finished" >
2013-11-25 08:04:46 +00:00
<t t-call= "website.layout" >
<div class= "wrap" >
<div class= "container" >
2013-11-26 12:53:03 +00:00
<div class= "jumbotron mt32" >
2013-11-25 08:04:46 +00:00
<h1 > Thank you!</h1>
<div t-field= "survey.thank_you_message" />
2014-02-05 08:16:26 +00:00
<div t-if= 'survey.quizz_mode' > You scored <t t-esc= "user_input.quizz_score" /> points.</div>
2014-04-15 11:50:17 +00:00
<div > If you wish, you can <a t-att-href= "'/survey/print/%s/%s' % (slug(survey), token)" > review your answers</a> .</div>
2013-11-08 07:53:47 +00:00
</div>
</div>
2013-11-25 08:04:46 +00:00
</div>
</t>
</template>
2013-11-08 07:53:47 +00:00
2013-11-25 08:04:46 +00:00
<!-- Message when the survey is not open -->
<template id= "notopen" name= "Survey not open" >
<t t-call= "website.layout" >
<div class= "wrap" >
<div class= "container" >
2013-11-26 12:53:03 +00:00
<div class= "jumbotron mt32" >
2013-11-25 08:04:46 +00:00
<h1 > Not open</h1>
<p > This survey is not open. Thank you for your interest!</p>
2013-11-20 15:13:01 +00:00
</div>
</div>
2013-11-25 08:04:46 +00:00
</div>
</t>
</template>
2013-11-08 07:53:47 +00:00
2014-04-10 14:30:18 +00:00
<!-- Message when the survey has no pages -->
<template id= "nopages" name= "Survey has no pages" >
<t t-call= "website.layout" >
<div class= "wrap" >
<div class= "container" >
<div class= "jumbotron mt32" >
<h1 > Not ready</h1>
<p > This survey has no pages by now!</p>
</div>
</div>
</div>
</t>
</template>
2013-11-25 08:04:46 +00:00
<!-- First page of a survey -->
<template id= "survey_init" name= "Survey" >
<t t-call= "website.layout" >
<div class= "wrap" >
<div class= "oe_structure" />
<div class= "container" >
2014-04-10 13:21:46 +00:00
<div groups= "base.group_website_publisher" t-ignore= "true" class= "text-right" >
<a href= "/web#action=survey.action_survey_form" class= "btn btn-default" > Go back to surveys</a>
</div>
2013-11-25 08:04:46 +00:00
<div class= 'jumbotron mt32' >
<h1 t-field= 'survey.title' />
<div t-field= 'survey.description' />
2014-03-19 14:29:52 +00:00
<a class= "btn btn-primary btn-lg" t-att-href= "'/survey/fill/%s/%s' % (slug(survey), token)" >
2013-11-25 08:04:46 +00:00
Start Survey
</a>
2013-11-05 10:36:54 +00:00
</div>
</div>
2013-11-25 08:04:46 +00:00
<div class= "oe_structure" />
2013-11-06 07:33:53 +00:00
</div>
2013-11-25 08:04:46 +00:00
</t>
</template>
2013-11-06 07:33:53 +00:00
2013-11-25 08:04:46 +00:00
<!-- A survey -->
<template id= "survey" name= "Survey" >
<t t-call= "website.layout" >
<t t-set= "head" >
<script type= "text/javascript" src= "/survey/static/src/js/survey.js" />
</t>
<div class= "wrap" >
<div class= "oe_structure" />
<div class= "container" >
2014-04-10 13:21:46 +00:00
<div groups= "base.group_website_publisher" t-ignore= "true" class= "text-right" >
<a href= "/web#action=survey.action_survey_form" class= "btn btn-default" > Go back to surveys</a>
</div>
2013-11-25 08:04:46 +00:00
<t t-call= "survey.page" />
</div>
<div class= "oe_structure" />
2013-11-05 15:28:21 +00:00
</div>
2013-11-25 08:04:46 +00:00
</t>
</template>
2013-11-05 15:28:21 +00:00
2013-11-25 08:04:46 +00:00
<!-- A page -->
<template id= "page" name= "Page" >
<div class= "page-header" >
2013-11-26 12:53:03 +00:00
<p class= "pull-right" > Page <span t-raw= 'page_nr + 1' /> on <span t-raw= "len(survey.page_ids)" /> </p>
2013-11-25 08:04:46 +00:00
<h1 t-field= 'page.title' />
<div t-field= 'page.description' />
</div>
2013-11-06 15:24:06 +00:00
2014-03-19 14:29:52 +00:00
<form role= "form" method= "post" class= "js_surveyform" t-att-name= "'%s_%s' % (survey.id, page.id)" t-att-action= "'/survey/fill/%s/%s' % (slug(survey), token)" t-att-data-prefill= "'/survey/prefill/%s/%s/%s' % (slug(survey), token, slug(page))" t-att-data-validate= "'/survey/validate/%s' % (slug(survey))" t-att-data-submit= "'/survey/submit/%s' % (slug(survey))" >
2013-11-25 08:04:46 +00:00
<input type= "hidden" name= "page_id" t-att-value= "page.id" />
<input type= "hidden" name= "token" t-att-value= "token" />
<t t-foreach= 'page.question_ids' t-as= 'question' >
<t t-set= "prefix" t-value= "'%s_%s_%s' % (survey.id, page.id, question.id)" />
<div class= "js_question-wrapper" t-att-id= "prefix" >
<h2 >
<span t-field= 'question.question' />
2013-11-26 12:53:03 +00:00
<span t-if= "question.constr_mandatory" class= "text-danger" > *</span>
2013-11-25 08:04:46 +00:00
</h2>
2014-04-09 08:52:16 +00:00
<div t-field= 'question.description' class= "text-muted" />
2013-11-26 12:53:03 +00:00
<t t-if= "question.type == 'free_text'" > <t t-call= "survey.free_text" /> </t>
<t t-if= "question.type == 'textbox'" > <t t-call= "survey.textbox" /> </t>
<t t-if= "question.type == 'numerical_box'" > <t t-call= "survey.numerical_box" /> </t>
<t t-if= "question.type == 'datetime'" > <t t-call= "survey.datetime" /> </t>
<t t-if= "question.type == 'simple_choice'" > <t t-call= "survey.simple_choice" /> </t>
<t t-if= "question.type == 'multiple_choice'" > <t t-call= "survey.multiple_choice" /> </t>
<t t-if= "question.type == 'matrix'" > <t t-call= "survey.matrix" /> </t>
2013-11-25 08:04:46 +00:00
<div class= "js_errzone alert alert-danger" style= "display:none;" > </div>
</div>
</t>
<div class= "text-center mt16 mb16" >
2013-12-12 11:04:35 +00:00
<button t-if= "survey.users_can_go_back and page_nr > 0" type= "submit" class= "btn btn-default" name= "button_submit" value= "previous" > Previous page</button>
<button t-if= "not last" type= "submit" class= "btn btn-primary" name= "button_submit" value= "next" > Next page</button>
<button t-if= "last" type= "submit" class= "btn btn-primary" name= "button_submit" value= "finish" > Submit survey</button>
2013-11-13 13:55:32 +00:00
</div>
2013-11-25 08:04:46 +00:00
</form>
2013-12-09 13:03:26 +00:00
<!-- Modal used to display error message, i.c.o. ajax error -->
<div class= "modal fade" id= "AJAXErrorModal" role= "dialog" aria-labelledby= "AJAXErrorModal" aria-hidden= "true" >
<div class= "modal-dialog" >
<div class= "modal-content" >
<div class= "modal-header" >
<button type= "button" class= "close" data-dismiss= "modal" aria-hidden= "true" > & times;</button>
<h4 class= "modal-title" > A problem has occured</h4>
</div>
<div class= "modal-body" > <p > Something went wrong while contacting survey server. <strong class= "text-danger" > Your answers have probably not been recorded.</strong> Try refreshing.</p> </div>
<div class= "modal-footer" > <button type= "button" class= "btn btn-primary" data-dismiss= "modal" > Close</button> </div>
</div>
</div>
</div>
2013-11-25 08:04:46 +00:00
</template>
2013-11-06 16:11:17 +00:00
2013-11-25 08:04:46 +00:00
<!-- Question widgets -->
<template id= "free_text" name= "Free text box" >
<textarea class= "form-control" rows= "3" t-att-name= "prefix" > </textarea>
</template>
2013-11-15 07:51:50 +00:00
2013-11-25 08:04:46 +00:00
<template id= "textbox" name= "Text box" >
<input type= "text" class= "form-control" t-att-name= "prefix" />
</template>
2013-11-15 07:51:50 +00:00
2013-11-25 08:04:46 +00:00
<template id= "numerical_box" name= "Numerical box" >
2013-12-16 16:09:08 +00:00
<input type= "number" step= "any" class= "form-control" t-att-name= "prefix" />
2013-11-25 08:04:46 +00:00
</template>
2013-11-15 15:14:35 +00:00
2013-11-25 08:04:46 +00:00
<template id= "datetime" name= "Datetime box" >
2014-04-09 13:57:13 +00:00
<input type= "text" class= "form-control" t-att-name= "prefix" placeholder= "yyyy-mm-dd hh:mm:ss" />
2013-11-25 08:04:46 +00:00
</template>
2013-11-15 15:14:35 +00:00
2013-11-25 08:04:46 +00:00
<template id= "simple_choice" name= "Simple choice" >
<div t-if= "question.display_mode == 'dropdown'" class= "js_drop row" >
2013-11-26 16:08:42 +00:00
<div class= "col-md-12" >
<select class= "form-control" t-att-name= "prefix" >
<option disabled= "1" selected= "1" value= "" > Choose...</option>
<t t-foreach= 'question.labels_ids' t-as= 'label' >
<option t-att-value= 'label.id' > <t t-esc= 'label.value' /> </option>
</t>
<t t-if= 'question.comments_allowed and question.comment_count_as_answer' >
2014-04-09 08:52:16 +00:00
<option class= "js_other_option" value= "-1" > <span t-esc= "question.comments_message" /> </option>
2013-11-26 16:08:42 +00:00
</t>
</select>
</div>
<div t-if= 'question.comments_allowed and question.comment_count_as_answer' class= "col-md-6" >
2014-04-09 08:52:16 +00:00
<input type= "text" class= "form-control" t-att-name= "'%s_%s' % (prefix, 'comment')" data-oe-survey-othert= "1" />
2013-11-26 16:08:42 +00:00
</div>
<div t-if= 'question.comments_allowed and not question.comment_count_as_answer' class= "col-md-12 mt16" >
2014-04-09 08:52:16 +00:00
<span t-field= "question.comments_message" />
<input type= "text" class= "form-control" t-att-name= "'%s_%s' % (prefix, 'comment')" />
2013-11-26 16:08:42 +00:00
</div>
2013-11-25 08:04:46 +00:00
</div>
<div t-if= "question.display_mode == 'columns' " class= "row js_radio" >
<div t-foreach= 'question.labels_ids' t-as= 'label' t-attf-class= "col-md-#{question.column_nb}" >
2014-04-16 10:11:29 +00:00
<label t-att-class= "' bg-success ' if quizz_correction and label.quizz_mark > 0.0 else ''" >
2013-11-26 12:53:03 +00:00
<input type= "radio" t-att-name= "prefix" t-att-value= 'label.id' />
2013-11-25 08:04:46 +00:00
<span t-field= 'label.value' />
</label>
</div>
<div t-if= 'question.comments_allowed and question.comment_count_as_answer' class= "js_comments col-md-12" >
<label >
2013-11-26 12:53:03 +00:00
<input type= "radio" t-att-name= "prefix" value= "-1" />
2014-04-09 08:52:16 +00:00
<span t-field= "question.comments_message" />
2013-11-25 08:04:46 +00:00
</label>
2014-04-09 08:52:16 +00:00
<input type= "text" class= "form-control" t-att-name= "'%s_%s' % (prefix, 'comment')" />
2013-11-25 08:04:46 +00:00
</div>
<div t-if= 'question.comments_allowed and not question.comment_count_as_answer' class= "col-md-12" >
2014-04-09 08:52:16 +00:00
<span t-field= "question.comments_message" />
<input type= "text" class= "form-control" t-att-name= "'%s_%s' % (prefix, 'comment')" data-oe-survey-othert= "1" />
2013-11-25 08:04:46 +00:00
</div>
</div>
</template>
2013-11-15 15:14:35 +00:00
2013-11-25 08:04:46 +00:00
<template id= "multiple_choice" name= "Multiple choice" >
<div class= "row" >
<div t-foreach= 'question.labels_ids' t-as= 'label' t-attf-class= "col-md-#{question.column_nb}" >
2014-04-16 10:11:29 +00:00
<label t-att-class= "' bg-success ' if quizz_correction and label.quizz_mark > 0.0 else ''" >
2013-11-26 12:53:03 +00:00
<input type= "checkbox" t-att-name= "'%s_%s' % (prefix, label.id)" t-att-value= 'label.id' />
2013-11-25 08:04:46 +00:00
<span t-field= 'label.value' />
</label>
</div>
<div t-if= 'question.comments_allowed and question.comment_count_as_answer' class= "js_ck_comments col-md-12" >
<label >
2013-11-26 12:53:03 +00:00
<input type= "checkbox" t-att-name= "'%s_%s' % (prefix, -1)" value= "-1" />
2014-04-09 08:52:16 +00:00
<span t-field= "question.comments_message" />
2013-11-25 08:04:46 +00:00
</label>
2014-04-09 08:52:16 +00:00
<input type= "text" class= "form-control" t-att-name= "'%s_%s' % (prefix, 'comment')" />
2013-11-25 08:04:46 +00:00
</div>
<div t-if= 'question.comments_allowed and not question.comment_count_as_answer' class= "col-md-12" >
2014-04-09 08:52:16 +00:00
<span t-field= "question.comments_message" />
<input type= "text" class= "form-control" t-att-name= "'%s_%s' % (prefix, 'comment')" data-oe-survey-othert= "1" />
2013-11-25 08:04:46 +00:00
</div>
</div>
</template>
2013-11-15 15:14:35 +00:00
2013-11-26 12:53:03 +00:00
<template id= "matrix" name= "Matrix" >
<table class= "table table-hover" >
<thead >
<tr >
<th > </th>
<th t-foreach= "question.labels_ids" t-as= "col_label" > <span t-field= "col_label.value" /> </th>
</tr>
</thead>
<tbody >
<tr t-foreach= "question.labels_ids_2" t-as= "row_label" >
<th > <span t-field= "row_label.value" /> </th>
<td t-foreach= "question.labels_ids" t-as= "col_label" >
<input t-if= "question.matrix_subtype == 'simple'" type= "radio" t-att-name= "'%s_%s' % (prefix, row_label.id)" t-att-value= 'col_label.id' />
<input t-if= "question.matrix_subtype == 'multiple'" type= "checkbox" t-att-name= "'%s_%s_%s' % (prefix, row_label.id, col_label.id)" t-att-value= 'col_label.id' />
</td>
</tr>
</tbody>
</table>
<div t-if= 'question.comments_allowed' >
2014-04-09 08:52:16 +00:00
<span t-field= "question.comments_message" />
<input type= "text" class= "form-control" t-att-name= "'%s_%s' % (prefix, 'comment')" />
2013-11-26 12:53:03 +00:00
</div>
</template>
2013-11-18 16:12:59 +00:00
2013-11-25 08:04:46 +00:00
<!-- Printable view of a survey (all pages) -->
<template id= "survey_print" name= "Survey" >
<t t-call= "website.layout" >
2013-11-26 12:53:03 +00:00
<t t-set= "head" >
<script type= "text/javascript" src= "/survey/static/src/js/survey.js" />
</t>
2013-11-25 08:04:46 +00:00
<div class= "wrap" >
<div class= "container" >
<div class= "row" >
2013-11-26 12:53:03 +00:00
<div class= 'jumbotron mt32' >
2013-11-25 08:04:46 +00:00
<h1 > <span t-field= 'survey.title' /> </h1>
2014-04-09 08:52:16 +00:00
<t t-if= "survey.description" > <div t-field= 'survey.description' /> </t>
2013-11-06 16:11:17 +00:00
</div>
2014-04-16 15:13:20 +00:00
<form role= "form" method= "post" class= "js_surveyform" t-att-name= "'%s' % (survey.id)" t-att-data-prefill= "'/survey/prefill/%s/%s' % (slug(survey), token)" t-att-data-scores= "'/survey/scores/%s/%s' % (slug(survey), token) if quizz_correction else ''" >
2013-12-27 14:49:38 +00:00
<t t-foreach= "survey.page_ids" t-as= "page" >
<div class= "page-header" >
<h1 t-field= 'page.title' />
2014-04-09 08:52:16 +00:00
<t t-if= "page.description" > <div t-field= 'page.description' /> </t>
2013-12-27 14:49:38 +00:00
</div>
2013-12-27 15:05:16 +00:00
<t t-foreach= 'page.question_ids' t-as= 'question' >
<t t-set= "prefix" t-value= "'%s_%s_%s' % (survey.id, page.id, question.id)" />
<div class= "js_question-wrapper" t-att-id= "prefix" >
<h2 >
<span t-field= 'question.question' />
<span t-if= "question.constr_mandatory" class= "text-danger" > *</span>
2014-04-16 15:13:20 +00:00
<span t-if= "quizz_correction" class= "badge" t-att-data-score-question= "question.id" > </span>
2013-12-27 15:05:16 +00:00
</h2>
2014-04-09 08:52:16 +00:00
<t t-if= "question.description" > <div class= "text-muted" t-field= 'question.description' /> </t>
2013-12-27 15:05:16 +00:00
<t t-if= "question.type == 'free_text'" > <t t-call= "survey.free_text" /> </t>
<t t-if= "question.type == 'textbox'" > <t t-call= "survey.textbox" /> </t>
<t t-if= "question.type == 'numerical_box'" > <t t-call= "survey.numerical_box" /> </t>
<t t-if= "question.type == 'datetime'" > <t t-call= "survey.datetime" /> </t>
<t t-if= "question.type == 'simple_choice'" > <t t-call= "survey.simple_choice" /> </t>
<t t-if= "question.type == 'multiple_choice'" > <t t-call= "survey.multiple_choice" /> </t>
<t t-if= "question.type == 'matrix'" > <t t-call= "survey.matrix" /> </t>
<div class= "js_errzone alert alert-danger" style= "display:none;" > </div>
</div>
</t>
<hr />
2013-12-27 14:49:38 +00:00
</t>
2013-12-27 15:05:16 +00:00
</form>
</div>
2013-11-06 16:11:17 +00:00
</div>
2013-11-25 08:04:46 +00:00
</div>
2013-12-27 15:05:16 +00:00
</t>
2013-11-25 08:04:46 +00:00
</template>
</data>
2013-11-06 15:24:06 +00:00
</openerp>