Files
odoo_source/addons/website/views/snippets/s_carousel.xml
T
Soukéina Bojabza dba127d626 [FIX] web_editor, *: remove some inner content dropzones in Carousel
*: website

When dragging inner contents, dropzones appear in the Carousel snippet,
allowing to drop them directly in the element with the `row` class,
where it should not be the case. This is due to the `content` class
present on these elements and to the drop-in rule for inner contents
that allows them to be dropped in elements having this class.

This commit fixes this issue:
- in stable: as the XML files cannot be modified, the drop-in rule is
patched in JS to exclude the elements having both the `content` and
`row` classes.

- in master: it removes the `content` classes from the rows of the
Carousel snippet. It also removes this class from the drop-in rule,
as only Carousel was concerned by it.

See [1] for the following of this fix in design-themes.

[1]: https://github.com/odoo/design-themes/pull/603

task-3011192

closes odoo/odoo#108646

X-original-commit: 882c483ec1107879cd1c5693ea5cfce08e3220cc
Related: odoo/design-themes#628
Signed-off-by: Vray Benjamin (bvr) <bvr@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-12-28 11:42:51 +01:00

73 lines
4.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="s_carousel" name="Carousel">
<section class="s_carousel_wrapper" data-vxml="001">
<t t-set="uniq" t-value="datetime.datetime.now().microsecond"/>
<div t-attf-id="myCarousel{{uniq}}" class="s_carousel s_carousel_default carousel slide" data-bs-interval="10000">
<!-- Indicators -->
<ol class="carousel-indicators">
<li t-attf-data-bs-target="#myCarousel{{uniq}}" data-bs-slide-to="0" class="active"/>
<li t-attf-data-bs-target="#myCarousel{{uniq}}" data-bs-slide-to="1"/>
<li t-attf-data-bs-target="#myCarousel{{uniq}}" data-bs-slide-to="2"/>
</ol>
<!-- Content -->
<div class="carousel-inner">
<!-- #01 -->
<div class="carousel-item active oe_img_bg o_bg_img_center pt152 pb152" style="background-image: url('/web/image/website.s_carousel_default_image_1');" data-name="Slide">
<div class="container oe_unremovable">
<div class="row">
<div class="carousel-content col-lg-6">
<h2><font style="font-size: 62px;">Slide Title</font></h2>
<p class="lead">Use this snippet to presents your content in a slideshow-like format. Don't write about products or services here, write about solutions.</p>
<p>
<a href="/contactus" class="btn btn-primary mb-2">Contact us</a>
</p>
</div>
</div>
</div>
</div>
<!-- #02 -->
<div class="carousel-item oe_img_bg o_bg_img_center pt96 pb96" style="background-image: url('/web/image/website.s_carousel_default_image_2');" data-name="Slide">
<div class="container oe_unremovable">
<div class="row">
<div class="carousel-content col-lg-8 offset-lg-2 bg-black-50 text-center pt48 pb40">
<h2 style="font-size: 62px;">Clever Slogan</h2>
<div class="s_hr pt8 pb24" data-snippet="s_hr" data-name="Separator">
<hr class="w-25 mx-auto" style="border-top-width: 1px; border-top-style: solid;"/>
</div>
<p class="lead">Storytelling is powerful.<br/> It draws readers in and engages them.</p>
<p><a href="/" class="btn btn-primary mb-2">Start your journey</a></p>
</div>
</div>
</div>
</div>
<!-- #03 -->
<div class="carousel-item oe_img_bg o_bg_img_center pt128 pb128" style="background-image: url('/web/image/website.s_carousel_default_image_3');" data-name="Slide">
<div class="container oe_unremovable">
<div class="row">
<div class="carousel-content col-lg-6 offset-lg-6">
<h2><font style="font-size: 62px; background-color: rgb(255, 255, 255);">Edit this title</font></h2>
<h4><font style="background-color: rgb(255, 255, 255);">Good writing is simple, but not simplistic.</font></h4>
<p><br/></p>
<p>Good copy starts with understanding how your product or service helps your customers. Simple words communicate better than big words and pompous language.</p>
</div>
</div>
</div>
</div>
</div>
<!-- Controls -->
<a class="carousel-control-prev o_not_editable" contenteditable="false" t-attf-href="#myCarousel{{uniq}}" data-bs-slide="prev" role="img" aria-label="Previous" title="Previous">
<span class="carousel-control-prev-icon"/>
<span class="visually-hidden">Previous</span>
</a>
<a class="carousel-control-next o_not_editable" contenteditable="false" t-attf-href="#myCarousel{{uniq}}" data-bs-slide="next" role="img" aria-label="Next" title="Next">
<span class="carousel-control-next-icon"/>
<span class="visually-hidden">Next</span>
</a>
</div>
</section>
</template>
</odoo>