[IMP] website_sale_slides: describe course unavailability

When a product linked to a course is unpublished, the course is not
buyable. This commit improves the design in this case.
- Change the text of disabled button into "Course Unavailable"
- Add an alert message to group_website_slides_officer letting them
know that the course is not buyable because the product is unpublished

task-2842624

Part-of: odoo/odoo#90736
This commit is contained in:
Jérémy Hennecart (jeh)
2022-06-01 16:26:08 +02:00
parent 5881195bfe
commit d26c55698f
@@ -68,6 +68,18 @@
</template>
<!-- COURSE -->
<template name="Course Main" id="course_main" inherit_id="website_slides.course_main">
<xpath expr="//div[@id='home']" position="before">
<div t-if="channel.enroll == 'payment' and not channel.product_id.is_published"
class="alert alert-info" role="alert" groups="website_slides.group_website_slides_officer">
This course cannot be bought because its linked product
<a t-attf-href="/web#id=#{channel.product_id.product_tmpl_id.id}&amp;view_type=form&amp;model=#{channel.product_id.product_tmpl_id._name}&amp;action=website_sale.product_template_action_website"
class="alert-link" t-out="channel.product_id.name"/>
is not published.
</div>
</xpath>
</template>
<template name="Course Sidebar (infos, CTA)" id="course_join" inherit_id="website_slides.course_join">
<!-- Channel main template: override button to join channel -->
<xpath expr="//div[hasclass('o_wslides_js_course_join')]" position="inside">
@@ -120,7 +132,7 @@
</t>
<t t-elif="not channel.is_member">
<div class="alert my-0 bg-200 text-center">
Course Not Buyable
Course Unavailable
</div>
</t>
</template>