Skip to content
Snippets Groups Projects
Commit 9d94c1db authored by Jérémy Hennecart's avatar Jérémy Hennecart
Browse files

[IMP] website_slides: add customize button to display/hide the promoted slide

There is now a button in the Customize tab which can be used to choose to display or hide
the promoted slide of a course.

task-2161391
parent 68dd11b6
No related branches found
No related tags found
No related merge requests found
......@@ -452,6 +452,38 @@
</template>
<!-- ======= Documentation Course content: cards / categories======= -->
<template id="course_promoted_slide" name="Documentation Course content: promoted slide">
<div class="o_wslides_promoted_slide d-none">
<div t-if="not search and not search_slide_type and slide_promoted" class="container py-1 mb-2">
<div class="card flex-column flex-lg-row">
<t t-set="image_url" t-value="website.image_url(slide_promoted, 'image_1024')"/>
<a t-if="slide_promoted.is_preview or channel.is_member or is_slides_publisher"
t-attf-href="/slides/slide/#{slug(slide_promoted)}#{query_string}" class="w-100 w-lg-50 flex-shrink-0 rounded">
<div t-attf-style="background-image:url(#{image_url}); background-size: cover; background-position:center; padding-bottom: 35%;" class="h-lg-100"/>
</a>
<div t-else="" class="w-100 w-lg-50 flex-shrink-0 rounded">
<div t-attf-style="background-image:url(#{image_url}); background-size: cover; background-position:center; padding-bottom: 35%;" class="h-lg-100"/>
</div>
<div class="card-body">
<a t-if="slide_promoted.is_preview or channel.is_member or is_slides_publisher"
t-attf-href="/slides/slide/#{slug(slide_promoted)}#{query_string}"
class="h4 d-block" t-att-title="slide_promoted.name" t-field="slide_promoted.name"/>
<h4 t-else="" class="text-muted" t-field="slide_promoted.name"/>
<div t-if="slide_promoted.tag_ids" class="border-top mt-2 pt-1">
<t t-foreach="slide_promoted.tag_ids" t-as="tag">
<a t-att-href="'/slides/%s/tag/%s' % (slug(slide_promoted.channel_id), slug(tag))" class="badge badge-light" t-esc="tag.name"/>
</t>
</div>
<div class="o_wslides_desc_truncate_10 mt-3" t-field="slide_promoted.description"/>
</div>
</div>
</div>
</div>
</template>
<template id="course_slides_cards" name="Documentation Course content: cards / categories">
<div class="o_wslides_lesson_nav mb-4 border-bottom">
<div class="container">
......@@ -557,33 +589,7 @@
</a>
</div>
<!-- Featured lesson -->
<div t-if="not search and not search_slide_type and slide_promoted" class="container py-1 mb-2">
<div class="card flex-column flex-lg-row">
<t t-set="image_url" t-value="website.image_url(slide_promoted, 'image_1024')"/>
<a t-if="slide_promoted.is_preview or channel.is_member or is_slides_publisher"
t-attf-href="/slides/slide/#{slug(slide_promoted)}#{query_string}" class="w-100 w-lg-50 flex-shrink-0 rounded">
<div t-attf-style="background-image:url(#{image_url}); background-size: cover; background-position:center; padding-bottom: 35%;" class="h-lg-100"/>
</a>
<div t-else="" class="w-100 w-lg-50 flex-shrink-0 rounded">
<div t-attf-style="background-image:url(#{image_url}); background-size: cover; background-position:center; padding-bottom: 35%;" class="h-lg-100"/>
</div>
<div class="card-body">
<a t-if="slide_promoted.is_preview or channel.is_member or is_slides_publisher"
t-attf-href="/slides/slide/#{slug(slide_promoted)}#{query_string}"
class="h4 d-block" t-att-title="slide_promoted.name" t-field="slide_promoted.name"/>
<h4 t-else="" class="text-muted" t-field="slide_promoted.name"/>
<div t-if="slide_promoted.tag_ids" class="border-top mt-2 pt-1">
<t t-foreach="slide_promoted.tag_ids" t-as="tag">
<a t-att-href="'/slides/%s/tag/%s' % (slug(slide_promoted.channel_id), slug(tag))" class="badge badge-light" t-esc="tag.name"/>
</t>
</div>
<div class="o_wslides_desc_truncate_10 mt-3" t-field="slide_promoted.description"/>
</div>
</div>
</div>
<t t-call="website_slides.course_promoted_slide"/>
<div class="container py-2">
<t t-if="search">
......@@ -697,4 +703,10 @@
<i t-if="slide.slide_type == 'quiz'" t-att-class="'fa fa-question-circle %s' % icon_class"></i>
</template>
<template name="Display Promoted Slide" id="display_promoted_slide" inherit_id="website_slides.course_promoted_slide" active="True" customize_show="True">
<xpath expr="//div[hasclass('o_wslides_promoted_slide')]" position="attributes">
<attribute name="class">o_wslides_promoted_slide</attribute>
</xpath>
</template>
</data></odoo>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment