2014-01-23 11:21:07 +00:00
<?xml version="1.0" encoding="utf-8"?>
<openerp >
<data >
<template id= "result" name= "Survey Result" >
<t t-call= "website.layout" >
2014-02-03 13:23:57 +00:00
<t t-set= "head" >
<link href= "/web_graph/static/src/css/nv.d3.css" rel= "stylesheet" type= "text/css" > </link>
<link href= "/survey/static/src/css/survey_result.css" rel= "stylesheet" type= "text/css" > </link>
<script src= "/web_graph/static/lib/nvd3/d3.v3.js" > </script>
<script src= "/web_graph/static/lib/nvd3/nv.d3.js" > </script>
<script type= "text/javascript" src= "/survey/static/src/js/survey_result.js" />
</t>
2014-03-03 13:05:44 +00:00
<div class= "oe_structure" />
2014-01-23 11:21:07 +00:00
<div class= "container" >
2014-02-03 13:23:57 +00:00
<div class= "jumbotron mt32" >
2014-03-03 13:05:44 +00:00
<h1 > <span t-field= "survey.title" > </span> <span style= "font-size:1.5em;" class= "fa fa-bar-chart-o pull-right " /> </h1>
2014-02-03 13:23:57 +00:00
<h2 > <span t-field= "survey.description" > </span> </h2>
</div>
2014-02-07 11:33:09 +00:00
<div t-if= "filter_display_data" class= "filteres" >
2014-03-03 13:05:44 +00:00
<span > <h3 > <span class= "fa fa-filter" > </span> Filters <small class= "pull-right clear_survey_filter" > <i class= "fa fa-times" > </i> Clear All Filters</small> </h3> </span>
2014-02-07 11:33:09 +00:00
<span t-foreach= "filter_display_data" t-as= "filter_data" >
<span class= "label label-primary only_left_radius" > <i class= "fa fa-filter" > </i> </span> <span class= "label label-primary no_radius" t-esc= "filter_data['question_text']" > </span> <span class= "label label-success only_right_radius" t-esc= "' > '.join(filter_data['labels'])" > </span>
</span>
</div>
2014-02-03 13:23:57 +00:00
<div t-foreach= 'survey.page_ids' t-as= 'page' >
<h1 class= "mt16" t-field= 'page.title' > </h1>
<hr />
<div t-foreach= 'page.question_ids' t-as= 'question' class= "mt16" >
2014-02-07 11:33:09 +00:00
<t t-set= "input_summary" t-value= "get_input_summary(question, current_filters)" />
2014-02-03 13:23:57 +00:00
<h4 >
<b > Question </b>
<span t-field= 'question.question' > </span>
<span class= "pull-right" >
2014-03-03 13:05:44 +00:00
<span class= "label label-success" > <span t-esc= "input_summary['answered']" > </span> Answered</span>
2014-02-03 13:23:57 +00:00
<span class= "label label-danger" > <span t-esc= "input_summary['skipped']" > </span> Skipped</span>
</span>
</h4>
<t t-if= "question.description" >
<h5 > <span class= "text-muted" t-field= "question.description" > </span> </h5>
</t>
<t t-if= "question.type in ['textbox', 'free_text', 'datetime']" >
<t t-call= "survey.result_text" > </t>
</t>
<t t-if= "question.type in ['simple_choice', 'multiple_choice']" >
<t t-call= "survey.result_choice" > </t>
</t>
<t t-if= "question.type == 'matrix'" >
<t t-call= "survey.result_matrix" > </t>
</t>
<t t-if= "question.type == 'numerical_box'" >
<t t-call= "survey.result_number" > </t>
</t>
2014-01-23 11:21:07 +00:00
</div>
</div>
</div>
2014-03-03 13:05:44 +00:00
<div class= "oe_structure" />
2014-01-23 11:21:07 +00:00
</t>
</template>
2014-01-27 09:38:43 +00:00
<!-- Result for free_text,textbox and datetime -->
2014-01-23 11:21:07 +00:00
<template id= "result_text" name= "Text Result" >
2014-01-29 12:48:12 +00:00
<t t-if= "input_summary['answered'] != 0" >
2014-03-24 10:02:57 +00:00
<table class= "table table-hover table-condensed" t-att-id= "'table_question_'+str(question.id)" >
2014-01-29 12:48:12 +00:00
<thead >
<tr >
<th > #</th>
<th > User Responses</th>
</tr>
</thead>
<tbody >
2014-02-07 11:33:09 +00:00
<t t-set= "text_result" t-value= "prepare_result(question, current_filters)" > </t>
<tr class= "hidden" t-foreach= "text_result" t-as= "user_input" >
2014-01-29 12:48:12 +00:00
<td > <t t-esc= "user_input_index+1" > </t> </td>
<t t-if= "question.type == 'free_text'" >
<td >
<span t-field= "user_input.value_free_text" > </span> <br />
<small > <p t-field= "user_input.date_create" class= "fa fa-calendar oe_date text-muted" > </p> </small>
<span class= "pull-right" >
2014-03-19 14:29:52 +00:00
<a t-att-href= "user_input.user_input_id.print_url+'/'+user_input.user_input_id.token" > <i class= "fa fa-print" > </i> Print respondent's answers</a> <br />
2014-01-29 12:48:12 +00:00
</span>
</td>
</t>
<t t-if= "question.type == 'textbox'" >
<td >
<span t-field= "user_input.value_text" > </span> <br />
<small > <p t-field= "user_input.date_create" class= "fa fa-calendar oe_date text-muted" > </p>
<span class= "pull-right" >
2014-03-19 14:29:52 +00:00
<a t-att-href= "user_input.user_input_id.print_url+'/'+user_input.user_input_id.token" > <i class= "fa fa-print" > </i> Print respondent's answers</a> <br />
2014-01-29 12:48:12 +00:00
</span>
</small>
</td>
</t>
<t t-if= "question.type == 'datetime'" >
<td >
<span class= "oe_date" t-field= "user_input.value_date" > </span> <br />
<span class= "pull-right" >
2014-03-19 14:29:52 +00:00
<a t-att-href= "user_input.user_input_id.print_url+'/'+user_input.user_input_id.token" > <i class= "fa fa-print" > </i> Print respondent's answers</a> <br />
2014-01-29 12:48:12 +00:00
</span>
</td>
</t>
</tr>
</tbody>
</table>
2014-02-07 11:33:09 +00:00
<t t-call= "survey.pagination" />
2014-01-29 12:48:12 +00:00
</t>
<t t-if= "input_summary['answered'] == 0" >
<h2 style= "padding-top:30px;padding-bottom:30px;text-align:center;" class= "text-muted" > Sorry, No one answered this question.</h2>
</t>
2014-01-23 11:21:07 +00:00
</template>
<!-- Result for simple_choice and multiple_choice -->
<template id= "result_choice" name= "Choice Result" >
<div >
<!-- Tabs -->
<ul class= "nav nav-tabs" >
2014-03-24 10:02:57 +00:00
<li class= "active" t-if= "question.type != 'simple_choice'" >
2014-01-23 11:21:07 +00:00
<a t-att-href= "'#graph_question_'+str(question.id)" data-toggle= "tab" >
<i class= "fa fa-bar-chart-o" > </i> Graph
</a>
</li>
2014-03-24 10:02:57 +00:00
<li class= "active" t-if= "question.type == 'simple_choice'" >
<a t-att-href= "'#graph_question_'+str(question.id)" data-toggle= "tab" >
<i class= "fa fa-dot-circle-o" > </i> Pie Chart
</a>
</li>
2014-01-23 11:21:07 +00:00
<li >
<a t-att-href= "'#data_question_'+str(question.id)" data-toggle= "tab" >
<i class= "fa fa-list-alt" > </i> Data
</a>
</li>
</ul>
<div class= "tab-content" >
2014-03-24 10:02:57 +00:00
<div class= "tab-pane active survey_graph" t-if= "question.type != 'simple_choice'" t-att-id= "'graph_question_'+str(question.id)" t-att-data-question_id= "question.id" data-graph_type= "bar" t-att-data-current_filters= "current_filters" >
2014-01-23 11:21:07 +00:00
<!-- svg element for drawing bar chart -->
<svg style= "height:20em" > </svg>
</div>
2014-03-24 10:02:57 +00:00
<div class= "tab-pane active survey_graph" t-if= "question.type == 'simple_choice'" t-att-id= "'graph_question_'+str(question.id)" t-att-data-question_id= "question.id" data-graph_type= "pie" t-att-data-current_filters= "current_filters" >
<!-- svg element for drawing pie chart -->
<svg style= "height:20em" > </svg>
</div>
2014-01-23 11:21:07 +00:00
<div class= "tab-pane" t-att-id= "'data_question_'+str(question.id)" >
2014-03-24 10:02:57 +00:00
<table class= "table table-hover table-condensed" >
2014-01-23 11:21:07 +00:00
<thead >
<tr >
<th > Answer Choices</th>
<th > User Responses</th>
</tr>
</thead>
<tbody >
2014-02-06 13:40:53 +00:00
<tr t-foreach= "prepare_result(question, current_filters)" t-as= "user_input" >
2014-01-23 11:21:07 +00:00
<td >
<p t-esc= "user_input['text']" > </p>
</td>
2014-02-06 13:40:53 +00:00
<td class= "survey_answer" >
2014-01-29 12:48:12 +00:00
<span t-esc= "round(user_input['count']*100.0/(input_summary['answered'] or 1),2)" > </span> %
2014-01-23 11:21:07 +00:00
<span t-esc= "user_input['count']" class= "label label-primary" > Vote</span>
2014-02-06 13:40:53 +00:00
<i class= "fa fa-filter text-primary invisible survey_filter" t-att-data-question_id= "question.id" t-att-data-answer_id= "user_input['answer_id']" > </i>
2014-01-23 11:21:07 +00:00
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</template>
<!-- Result for matrix -->
<template id= "result_matrix" name= "Matrix Result" >
2014-02-06 13:40:53 +00:00
<t t-set= "matrix_result" t-value= "prepare_result(question, current_filters)" />
2014-01-23 11:21:07 +00:00
<!-- Tabs -->
<ul class= "nav nav-tabs" >
<li class= "active" >
<a t-att-href= "'#graph_question_'+str(question.id)" data-toggle= "tab" >
<i class= "fa fa-bar-chart-o" > </i>
Graph
</a>
</li>
<li >
<a t-att-href= "'#data_question_'+str(question.id)" data-toggle= "tab" >
<i class= "fa fa-list-alt" > </i>
Data
</a>
</li>
</ul>
<div class= "tab-content" >
2014-02-06 13:40:53 +00:00
<div class= "tab-pane active with-3d-shadow with-transitions survey_graph" t-att-id= "'graph_question_'+str(question.id)" t-att-data-question_id= "question.id" data-graph_type= "multi_bar" t-att-data-current_filters= "current_filters" >
2014-01-23 11:21:07 +00:00
<!-- svg element for drawing Multibar chart -->
<svg style= "height:20em" > </svg>
</div>
<div class= "tab-pane" t-att-id= "'data_question_'+str(question.id)" >
2014-03-24 10:02:57 +00:00
<table class= "table table-hover table-condensed text-right" >
2014-01-23 11:21:07 +00:00
<thead >
<tr >
<th > </th>
<th class= "text-right" t-foreach= "matrix_result['answers']" t-as= "answer_id" >
<span t-esc= "matrix_result['answers'][answer_id]" > </span>
</th>
</tr>
</thead>
<tbody >
<tr t-foreach= "matrix_result['rows']" t-as= "row_id" >
<td >
<span t-esc= "matrix_result['rows'][row_id]" > </span>
</td>
2014-02-06 13:40:53 +00:00
<td class= "survey_answer" t-foreach= "matrix_result['answers']" t-as= "answer_id" >
2014-01-29 12:48:12 +00:00
<span t-esc= "round(matrix_result['result'][(row_id,answer_id)]*100.0/(input_summary['answered'] or 1),2)" > </span> %
2014-02-06 13:40:53 +00:00
<span class= "label label-primary" t-esc= "matrix_result['result'][(row_id,answer_id)]" > </span> <i class= "fa fa-filter text-primary invisible survey_filter" t-att-data-question_id= "question.id" t-att-data-row_id= "row_id" t-att-data-answer_id= "answer_id" > </i>
2014-01-23 11:21:07 +00:00
</td>
</tr>
</tbody>
</table>
</div>
</div>
</template>
2014-01-27 06:56:11 +00:00
<!-- Result for Numeric Data -->
2014-01-23 11:21:07 +00:00
<template id= "result_number" name= "Number Result" >
2014-02-10 12:58:30 +00:00
<t t-set= "number_result" t-value= "prepare_result(question, current_filters)" />
<t t-set= "text_result" t-value= "number_result['input_lines']" />
2014-01-27 09:38:43 +00:00
<span class= "pull-right mt8" >
2014-02-10 12:58:30 +00:00
<span class= "label label-default only_left_radius" > Maximum </span> <span class= "label label-success only_right_radius" t-esc= "number_result['max']" > </span>
<span class= "label label-default only_left_radius" > Minimum </span> <span class= "label label-danger only_right_radius" t-esc= "number_result['min']" > </span>
<span class= "label label-default only_left_radius" > Average </span> <span class= "label label-warning only_right_radius" t-esc= "number_result['average']" > </span>
2014-01-27 09:38:43 +00:00
</span>
2014-01-27 06:56:11 +00:00
<ul class= "nav nav-tabs" >
<li class= "active" >
<a t-att-href= "'#most_common_'+str(question.id)" data-toggle= "tab" >
<i class= "fa fa-list-ol" > </i>
2014-02-10 12:58:30 +00:00
Most Common <span t-esc= "len(number_result['most_comman'])" > </span>
2014-01-27 06:56:11 +00:00
</a>
</li>
<li >
<a t-att-href= "'#data_question_'+str(question.id)" data-toggle= "tab" >
<i class= "fa fa-list-alt" > </i>
2014-01-27 09:38:43 +00:00
All Data
2014-01-27 06:56:11 +00:00
</a>
</li>
</ul>
<div class= "tab-content" >
<div class= "tab-pane active with-3d-shadow with-transitions" t-att-id= "'most_common_'+str(question.id)" >
2014-03-24 10:02:57 +00:00
<table class= "table table-hover table-condensed" >
2014-01-27 06:56:11 +00:00
<thead >
<tr >
<th > User Responce</th>
<th > Occurence</th>
</tr>
</thead>
<tbody >
2014-02-10 12:58:30 +00:00
<tr t-foreach= "number_result['most_comman']" t-as= "row" >
2014-01-27 06:56:11 +00:00
<td >
<span t-esc= "row[0]" > </span>
</td>
<td >
<span t-esc= "row[1]" > </span>
</td>
</tr>
</tbody>
2014-01-27 09:38:43 +00:00
</table>
2014-01-27 06:56:11 +00:00
</div>
<div class= "tab-pane" t-att-id= "'data_question_'+str(question.id)" >
2014-03-24 10:02:57 +00:00
<table class= "table table-hover table-condensed" t-att-id= "'table_question_'+str(question.id)" >
2014-01-23 11:21:07 +00:00
<thead >
<tr >
2014-01-27 06:56:11 +00:00
<th > #</th>
<th > User Responses</th>
2014-01-23 11:21:07 +00:00
</tr>
</thead>
<tbody >
2014-02-10 12:58:30 +00:00
<tr class= "hidden" t-foreach= "number_result['input_lines']" t-as= "user_input" >
2014-01-27 06:56:11 +00:00
<td > <t t-esc= "user_input_index+1" > </t> </td>
<td >
<span t-field= "user_input.value_number" > </span> <br />
<small > <p t-field= "user_input.date_create" class= "fa fa-calendar oe_date text-muted" > </p> </small>
</td>
2014-01-23 11:21:07 +00:00
</tr>
</tbody>
</table>
2014-02-04 09:51:57 +00:00
<t t-call= "survey.pagination" />
2014-01-27 06:56:11 +00:00
</div>
</div>
2014-01-23 11:21:07 +00:00
</template>
2014-01-29 12:48:12 +00:00
<template id= "no_result" name= "Survey Result" >
<t t-call= "website.layout" >
<div class= "container" >
<h2 > <span t-field= 'survey.title' > </span> </h2>
<div class= "jumbotron mt32" >
<h2 class= "text-muted" >
2014-03-03 13:05:44 +00:00
<span >
<i style= "font-size:1.8em" class= "fa fa-users pull-right" > </i>
</span>
Sorry, No one answered this survey yet
2014-01-29 12:48:12 +00:00
</h2>
</div>
</div>
</t>
</template>
2014-02-04 09:51:57 +00:00
<!-- Pagination Element -->
<template id= "pagination" name= "Survey Result" >
2014-03-24 10:02:57 +00:00
<t t-set= "record_limit" t-value= "10" /> <!-- Change This record_limit to change number of record per page -->
2014-03-03 13:05:44 +00:00
<ul t-att-id= "'pagination_%d' % question.id" class= "pagination" t-att-data-question_id= "question.id" t-att-data-record_limit= "record_limit" >
2014-02-07 11:33:09 +00:00
<t t-if= "len(text_result) > record_limit" >
<li t-foreach= "page_range(len(text_result), record_limit)" t-as= "num" >
2014-02-04 09:51:57 +00:00
<a href= "#" t-esc= "num" > </a>
</li>
</t>
</ul>
</template>
2014-01-23 11:21:07 +00:00
</data>
2014-01-27 06:56:11 +00:00
</openerp>