[FIX] website_slides_survey: go to survey if only one slide certification

Purpose of this commit:
  In case there is only one slide in the course and that unique slide
  is of type certification, clicking on the link redirects the user
  to the survey page instead of the fullscreen view

Task-1946511

closes odoo/odoo#31843

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
This commit is contained in:
qmo-odoo
2019-03-15 20:38:58 +00:00
committed by jem-odoo
parent e8e8d7a956
commit add45ee470
@@ -6,5 +6,11 @@
<i t-if="slide.slide_type == 'certification'" t-att-class="'fa fa-trophy %s' % icon_class"></i>
</xpath>
</template>
<template id="course_slides_list_slide_inherit_survey" inherit_id="website_slides.course_slides_list_slide">
<xpath expr="//a[hasclass('o_wslides_js_slides_list_slide_link')]" position="attributes">
<attribute name="t-attf-href">#{'/slides_survey/slide/get_certification_url?slide_id=%s' %(slide.id) if slide.slide_type == 'certification' and slide.channel_id.total_slides == 1 else '/slides/slide/%s' %(slug(slide))}</attribute>
</xpath>
</template>
</data>
</odoo>