1 <?xml version="1.0" encoding="utf-8"?>
4 <!-- "Thank you" message when the survey is completed -->
5 <template id="sfinished" name="Survey Finished">
6 <t t-call="website.layout">
8 <div class="container">
9 <div class="jumbotron mt32">
11 <div t-field="survey.thank_you_message" />
12 <div t-if='survey.quizz_mode'>You scored <t t-esc="user_input.quizz_score" /> points.</div>
13 <div>If you wish, you can <a t-att-href="'/survey/print/%s/%s' % (slug(survey), token)">review your answers</a>.</div>
20 <!-- Message when the survey is not open -->
21 <template id="notopen" name="Survey not open">
22 <t t-call="website.layout">
24 <div class="container">
25 <div class="jumbotron mt32">
27 <p>This survey is not open. Thank you for your interest!</p>
34 <!-- Message when the survey has no pages -->
35 <template id="nopages" name="Survey has no pages">
36 <t t-call="website.layout">
38 <div class="container">
39 <div class="jumbotron mt32">
41 <p>This survey has no pages by now!</p>
48 <!-- First page of a survey -->
49 <template id="survey_init" name="Survey">
50 <t t-call="website.layout">
52 <div class="oe_structure" />
53 <div class="container">
54 <div groups="base.group_website_publisher" t-ignore="true" class="text-right">
55 <a href="/web#action=survey.action_survey_form" class="btn btn-default">Go back to surveys</a>
57 <div class='jumbotron mt32'>
58 <h1 t-field='survey.title' />
59 <div t-field='survey.description' />
60 <a class="btn btn-primary btn-lg" t-att-href="'/survey/fill/%s/%s' % (slug(survey), token)">
65 <div class="oe_structure" />
71 <template id="survey" name="Survey">
72 <t t-call="website.layout">
74 <script type="text/javascript" src="/survey/static/src/js/survey.js" />
77 <div class="oe_structure"/>
78 <div class="container">
79 <div groups="base.group_website_publisher" t-ignore="true" class="text-right">
80 <a href="/web#action=survey.action_survey_form" class="btn btn-default">Go back to surveys</a>
82 <t t-call="survey.page" />
84 <div class="oe_structure"/>
90 <template id="page" name="Page">
91 <div class="page-header">
92 <p class="pull-right">Page <span t-raw='page_nr + 1'/> on <span t-raw="len(survey.page_ids)"/></p>
93 <h1 t-field='page.title' />
94 <div t-field='page.description'/>
97 <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))">
98 <input type="hidden" name="page_id" t-att-value="page.id" />
99 <input type="hidden" name="token" t-att-value="token" />
100 <t t-foreach='page.question_ids' t-as='question'>
101 <t t-set="prefix" t-value="'%s_%s_%s' % (survey.id, page.id, question.id)" />
102 <div class="js_question-wrapper" t-att-id="prefix">
104 <span t-field='question.question' />
105 <span t-if="question.constr_mandatory" class="text-danger">*</span>
107 <div t-field='question.description' class="text-muted"/>
108 <t t-if="question.type == 'free_text'"><t t-call="survey.free_text"/></t>
109 <t t-if="question.type == 'textbox'"><t t-call="survey.textbox"/></t>
110 <t t-if="question.type == 'numerical_box'"><t t-call="survey.numerical_box"/></t>
111 <t t-if="question.type == 'datetime'"><t t-call="survey.datetime"/></t>
112 <t t-if="question.type == 'simple_choice'"><t t-call="survey.simple_choice"/></t>
113 <t t-if="question.type == 'multiple_choice'"><t t-call="survey.multiple_choice"/></t>
114 <t t-if="question.type == 'matrix'"><t t-call="survey.matrix"/></t>
115 <div class="js_errzone alert alert-danger" style="display:none;"></div>
118 <div class="text-center mt16 mb16">
119 <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>
120 <button t-if="not last" type="submit" class="btn btn-primary" name="button_submit" value="next">Next page</button>
121 <button t-if="last" type="submit" class="btn btn-primary" name="button_submit" value="finish">Submit survey</button>
125 <!-- Modal used to display error message, i.c.o. ajax error -->
126 <div class="modal fade" id="AJAXErrorModal" role="dialog" aria-labelledby="AJAXErrorModal" aria-hidden="true" >
127 <div class="modal-dialog">
128 <div class="modal-content">
129 <div class="modal-header">
130 <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
131 <h4 class="modal-title">A problem has occured</h4>
133 <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>
134 <div class="modal-footer"><button type="button" class="btn btn-primary" data-dismiss="modal">Close</button></div>
141 <!-- Question widgets -->
142 <template id="free_text" name="Free text box">
143 <textarea class="form-control" rows="3" t-att-name="prefix"></textarea>
146 <template id="textbox" name="Text box">
147 <input type="text" class="form-control" t-att-name="prefix"/>
150 <template id="numerical_box" name="Numerical box">
151 <input type="number" step="any" class="form-control" t-att-name="prefix"/>
154 <template id="datetime" name="Datetime box">
155 <input type="text" class="form-control" t-att-name="prefix" placeholder="yyyy-mm-dd hh:mm:ss" />
158 <template id="simple_choice" name="Simple choice">
159 <div t-if="question.display_mode == 'dropdown'" class="js_drop row">
160 <div class="col-md-12">
161 <select class="form-control" t-att-name="prefix">
162 <option disabled="1" selected="1" value="">Choose...</option>
163 <t t-foreach='question.labels_ids' t-as='label'>
164 <option t-att-value='label.id'><t t-esc='label.value'/></option>
166 <t t-if='question.comments_allowed and question.comment_count_as_answer'>
167 <option class="js_other_option" value="-1"><span t-esc="question.comments_message" /></option>
171 <div t-if='question.comments_allowed and question.comment_count_as_answer' class="col-md-6">
172 <input type="text" class="form-control" t-att-name="'%s_%s' % (prefix, 'comment')" data-oe-survey-othert="1"/>
174 <div t-if='question.comments_allowed and not question.comment_count_as_answer' class="col-md-12 mt16">
175 <span t-field="question.comments_message"/>
176 <input type="text" class="form-control" t-att-name="'%s_%s' % (prefix, 'comment')"/>
179 <div t-if="question.display_mode == 'columns' " class="row js_radio">
180 <div t-foreach='question.labels_ids' t-as='label' t-attf-class="col-md-#{question.column_nb}">
181 <label t-att-class="' bg-success ' if quizz_correction and label.quizz_mark > 0.0 else ''">
182 <input type="radio" t-att-name="prefix" t-att-value='label.id' />
183 <span t-field='label.value'/>
186 <div t-if='question.comments_allowed and question.comment_count_as_answer' class="js_comments col-md-12" >
188 <input type="radio" t-att-name="prefix" value="-1"/>
189 <span t-field="question.comments_message" />
191 <input type="text" class="form-control" t-att-name="'%s_%s' % (prefix, 'comment')"/>
193 <div t-if='question.comments_allowed and not question.comment_count_as_answer' class="col-md-12">
194 <span t-field="question.comments_message"/>
195 <input type="text" class="form-control" t-att-name="'%s_%s' % (prefix, 'comment')" data-oe-survey-othert="1"/>
200 <template id="multiple_choice" name="Multiple choice">
202 <div t-foreach='question.labels_ids' t-as='label' t-attf-class="col-md-#{question.column_nb}">
203 <label t-att-class="' bg-success ' if quizz_correction and label.quizz_mark > 0.0 else ''">
204 <input type="checkbox" t-att-name="'%s_%s' % (prefix, label.id)" t-att-value='label.id' />
205 <span t-field='label.value'/>
208 <div t-if='question.comments_allowed and question.comment_count_as_answer' class="js_ck_comments col-md-12" >
210 <input type="checkbox" t-att-name="'%s_%s' % (prefix, -1)" value="-1" />
211 <span t-field="question.comments_message" />
213 <input type="text" class="form-control" t-att-name="'%s_%s' % (prefix, 'comment')"/>
215 <div t-if='question.comments_allowed and not question.comment_count_as_answer' class="col-md-12">
216 <span t-field="question.comments_message"/>
217 <input type="text" class="form-control" t-att-name="'%s_%s' % (prefix, 'comment')" data-oe-survey-othert="1"/>
222 <template id="matrix" name="Matrix">
223 <table class="table table-hover">
227 <th t-foreach="question.labels_ids" t-as="col_label"><span t-field="col_label.value" /></th>
231 <tr t-foreach="question.labels_ids_2" t-as="row_label">
232 <th><span t-field="row_label.value" /></th>
233 <td t-foreach="question.labels_ids" t-as="col_label">
234 <input t-if="question.matrix_subtype == 'simple'" type="radio" t-att-name="'%s_%s' % (prefix, row_label.id)" t-att-value='col_label.id' />
235 <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' />
240 <div t-if='question.comments_allowed'>
241 <span t-field="question.comments_message"/>
242 <input type="text" class="form-control" t-att-name="'%s_%s' % (prefix, 'comment')" />
246 <!-- Printable view of a survey (all pages) -->
247 <template id="survey_print" name="Survey">
248 <t t-call="website.layout">
250 <script type="text/javascript" src="/survey/static/src/js/survey.js" />
253 <div class="container">
255 <div class='jumbotron mt32'>
256 <h1><span t-field='survey.title'/></h1>
257 <t t-if="survey.description"><div t-field='survey.description'/></t>
259 <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 ''">
260 <t t-foreach="survey.page_ids" t-as="page">
261 <div class="page-header">
262 <h1 t-field='page.title' />
263 <t t-if="page.description"><div t-field='page.description'/></t>
265 <t t-foreach='page.question_ids' t-as='question'>
266 <t t-set="prefix" t-value="'%s_%s_%s' % (survey.id, page.id, question.id)" />
267 <div class="js_question-wrapper" t-att-id="prefix">
269 <span t-field='question.question' />
270 <span t-if="question.constr_mandatory" class="text-danger">*</span>
271 <span t-if="quizz_correction" class="badge" t-att-data-score-question="question.id"></span>
273 <t t-if="question.description"><div class="text-muted" t-field='question.description' /></t>
274 <t t-if="question.type == 'free_text'"><t t-call="survey.free_text"/></t>
275 <t t-if="question.type == 'textbox'"><t t-call="survey.textbox"/></t>
276 <t t-if="question.type == 'numerical_box'"><t t-call="survey.numerical_box"/></t>
277 <t t-if="question.type == 'datetime'"><t t-call="survey.datetime"/></t>
278 <t t-if="question.type == 'simple_choice'"><t t-call="survey.simple_choice"/></t>
279 <t t-if="question.type == 'multiple_choice'"><t t-call="survey.multiple_choice"/></t>
280 <t t-if="question.type == 'matrix'"><t t-call="survey.matrix"/></t>
281 <div class="js_errzone alert alert-danger" style="display:none;"></div>