You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

67 lines
2.7 KiB

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- if question_type= upload file then t-call template-->
<template id="question_page_upload_answer"
inherit_id="survey.question_container">
<xpath expr="//div[@role='alert']" position="before">
<t t-if="question.question_type == 'upload_file'">
<t t-call="survey_upload_file.multi_upload_file"/>
</t>
</xpath>
</template>
<!-- Answer View-->
<template id="multi_upload_file">
<div class="o_survey_upload_container">
<div class="o_survey_upload_box">
<div class="o_survey_upload_box_header">Upload Files</div>
<br/>
<div class="o_survey_upload_box_body">
<input type="file" class="o_survey_upload_file"
data-oe-data=""
data-oe-file_name=""
t-att-data-question-type="question.question_type"
t-att-name="question.id"
t-att-multiple="question.upload_multiple_file"
/>
</div>
</div>
<br/>
<div id="fileList" class="o_survey_upload_list"/>
<t t-if="question.upload_multiple_file == False">
<div class="o_survey_upload_note">Note: You can only upload one
file.
</div>
</t>
<t t-if="question.upload_multiple_file == True">
<div class="o_survey_upload_note">Note: You can upload
Multiple files.
</div>
</t>
</div>
</template>
<!--Show the answer in print page if question type = upload file then t-call template-->
<template id="survey_page_print_upload_answer"
inherit_id="survey.survey_page_print">
<xpath expr="//div[hasclass('o_survey_question_error')]"
position="before">
<t t-if="question.question_type == 'upload_file'">
<t t-call="survey_upload_file.multi_upload_answer"/>
</t>
</xpath>
</template>
<!--Answer Value attachments-->
<template id="multi_upload_answer">
<t t-if="answer_lines.value_file_data_ids">
<div>
<t t-foreach="answer_lines.value_file_data_ids"
t-as="attachment">
<a t-attf-href="/web/content/{{ attachment.id }}?download=true">
<i class="fa fa-download"/>
<t t-esc="attachment.name"/>
</a>
<br/>
</t>
</div>
</t>
</template>
</odoo>