[IMP] survey_event_registration_generation:

New type of question : multiple event products
This commit is contained in:
clementthomas
2023-10-24 10:57:55 +02:00
parent d5a834f3c9
commit 2690d69696
6 changed files with 85 additions and 30 deletions

View File

@@ -2,6 +2,7 @@
<template id="question_container" name="survey_event_registration_generation question container" inherit_id="survey.question_container">
<xpath expr="//div[@role='alert']" position="before">
<t t-if="question.question_type == 'event_product'"><t t-call="survey_event_registration_generation.question_event_product" /></t>
<t t-if="question.question_type == 'multiple_event_products'"><t t-call="survey_event_registration_generation.question_multiple_event_products" /></t>
<t t-if="question.question_type == 'event'"><t t-call="survey_event_registration_generation.question_event" /></t>
</xpath>
</template>
@@ -31,6 +32,32 @@
</div>
</template>
<!-- Multiple Event product selector -->
<template id="question_multiple_event_products" name="Question: event product">
<div class="row o_survey_form_choice o_survey_question_multiple_choice"
t-att-data-name="question.id"
t-att-data-question-type="question.question_type">
<t t-set="item_idx" t-value="0"/>
<div class="d-flex flex-wrap col-lg-12">
<t t-set="has_correct_answer" t-value="scoring_display_correction and any(label.is_correct for label in question.suggested_answer_ids)"/>
<t t-foreach="event_products" t-as="event_product">
<label t-att-class="'o_survey_choice_btn form-label me-2 py-1 px-3 rounded %s' % ('o_survey_selected' if answer_line else '')">
<input type="checkbox" t-att-value='event_product.id' class="o_survey_form_choice_item invisible position-absolute"
t-att-name="question.id" />
<span class="ms-2 text-break" t-field='event_product.name'/>
<i class="fa fa-check-circle float-end mt-1 position-relative"></i>
<i class="fa fa-circle-thin float-end mt-1 position-relative"></i>
</label>
</t>
</div>
</div>
</template>
<!-- Event selector -->
<template id="question_event" name="Question: event">
<div class="o_survey_comment_container p-0">