Some checks failed
pre-commit / pre-commit (pull_request) Failing after 1m39s
66 lines
2.7 KiB
XML
66 lines
2.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
|
|
<!-- Extend question_container (form view during survey filling) -->
|
|
<template
|
|
id="question_container_inh_type_file"
|
|
inherit_id="survey.question_container"
|
|
>
|
|
<xpath expr="//t[@t-call='survey.question_matrix']/.." position="after">
|
|
<t t-if="question.question_type == 'file'">
|
|
<t t-call="survey_extra_fields.question_file"/>
|
|
</t>
|
|
</xpath>
|
|
</template>
|
|
|
|
<template id="question_file" name="Question: File">
|
|
<div class="o_survey_comment_container p-0">
|
|
<t t-if="survey_form_readonly and answer_lines and answer_lines[0].value_file_fname">
|
|
<p><t t-out="answer_lines[0].value_file_fname"/></p>
|
|
</t>
|
|
<t t-if="not survey_form_readonly">
|
|
<input
|
|
type="file"
|
|
class="o_survey_question_file"
|
|
t-att-name="question.id"
|
|
t-att-data-question-type="question.question_type"
|
|
/>
|
|
</t>
|
|
</div>
|
|
</template>
|
|
|
|
<!-- Extend print/review page to show file answers -->
|
|
<template
|
|
id="survey_page_print_inh_type_file"
|
|
inherit_id="survey.survey_page_print"
|
|
>
|
|
<xpath expr="//div[hasclass('o_survey_question_error')]" position="before">
|
|
<t t-if="question.question_type == 'file'">
|
|
<t t-if="answer_lines">
|
|
<t t-set="answer_line" t-value="answer_lines[0]"/>
|
|
<t t-if="answer_line.skipped">
|
|
<div class="row g-0">
|
|
<div class="col-12 col-md-6 col-lg-4 rounded ps-4 o_survey_question_skipped">
|
|
<input type="text"
|
|
class="form-control fst-italic o_survey_question_file bg-transparent rounded-0 p-0"
|
|
value="Skipped"/>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
<t t-elif="answer_line.value_file_fname">
|
|
<div class="row g-0">
|
|
<div class="col-12 col-md-6 col-lg-4">
|
|
<a t-attf-href="/survey/file/#{survey.access_token}/#{answer.access_token}/#{answer_line.id}"
|
|
target="_blank">
|
|
<i class="fa fa-download me-1"/><t t-out="answer_line.value_file_fname"/>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</t>
|
|
</t>
|
|
</xpath>
|
|
</template>
|
|
|
|
</odoo>
|