[IMP] survey: add no answer helper

Display a no answers helper instead of the empty table
and the alert message when a question doesn't have
any answers.

Task-2957775

Part-of: odoo/odoo#100168
This commit is contained in:
amdi-odoo
2023-01-20 20:57:57 +01:00
parent af328742d0
commit c4f954c808
2 changed files with 21 additions and 9 deletions
@@ -95,3 +95,16 @@
font-weight: bold;
}
}
.o_survey_no_answers::before {
width: 120px;
height: 80px;
background: transparent url(/web/static/img/empty_folder.svg) no-repeat center;
content: "";
display: block;
margin-top: 50px;
margin-bottom: 20px;
margin-left: auto;
margin-right: auto;
z-index: 1;
}
@@ -99,18 +99,17 @@
<!-- Answers -->
<t t-set="question_answered" t-value="question_data['answer_input_done_ids']"/>
<div t-if="not question_answered" class="alert alert-secondary m-3" role="alert">
No one answered this question.
<div t-if="not question_answered" class="o_survey_no_answers text-center fw-bold">
<p> No answers yet! </p>
</div>
<t t-if="question_answered and question.question_type in ['text_box', 'char_box']"
t-call="survey.question_result_text"/>
<t t-elif="question_answered and question.question_type in ['numerical_box', 'date', 'datetime']"
t-call="survey.question_result_number_or_date_or_datetime"/>
<t t-elif="question.question_type in ['text_box', 'char_box']"
t-call="survey.question_result_text"/>
<t t-elif="question.question_type in ['numerical_box', 'date', 'datetime']"
t-call="survey.question_result_number_or_date_or_datetime"/>
<t t-elif="question.question_type in ['simple_choice', 'multiple_choice']"
t-call="survey.question_result_choice"/>
t-call="survey.question_result_choice"/>
<t t-elif="question.question_type in ['matrix']"
t-call="survey.question_result_matrix"/>
t-call="survey.question_result_matrix"/>
</div>
</template>