Skip to content

Commit 69e951d

Browse files
committed
[IMP] test_themes, theme_*: adapt themes for new parallax structure
This commit adapts the themes to the new Parallax effect structure. We now wrap the parallax element in another element with "overflow: hidden" to avoid setting "overflow: hidden" on sections. That was causing elements like the dropdown of the search bar to be cut off and not fully visible. task-4926420 closes #1114 Related: odoo/odoo#218296 Signed-off-by: Quentin Smetz (qsm) <[email protected]>
1 parent 87a2757 commit 69e951d

File tree

33 files changed

+87
-56
lines changed

33 files changed

+87
-56
lines changed

test_themes/tests/test_new_page_templates.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
# Classes that rightfully belong here at the moment
9797
's_col_no_bgcolor', 's_col_no_resize', 's_allow_columns',
9898
's_nb_column_fixed', 's_dialog_preview',
99-
's_parallax_is_fixed', 's_parallax_bg', 's_parallax_no_overflow_hidden',
99+
's_parallax_is_fixed', 's_parallax_bg', 's_parallax_bg_wrap',
100100
's_carousel_cards_card', 's_timeline_card', 's_blog_posts', 's_events',
101101
's_appointments',
102102

@@ -347,6 +347,16 @@ def check(theme_name, website):
347347
"Using %r, view %r defines a row count on a non-grid mode row"
348348
% (theme_name, view.key)
349349
)
350+
351+
for el in html_tree.xpath(".//*[contains(concat(' ', normalize-space(@class), ' '), ' s_parallax_bg ')]"):
352+
parent = el.getparent()
353+
parent_classes = parent.attrib.get('class')
354+
if parent_classes != 's_parallax_bg_wrap':
355+
errors.append(
356+
"Using %r, view %r: element with class 's_parallax_bg' must have a direct "
357+
"parent with 's_parallax_bg_wrap', found parent classes: %r"
358+
% (theme_name, view.key, parent_classes)
359+
)
350360
except Exception as e: # noqa: BLE001
351361
_logger.error("Using %r, view %r cannot be rendered (%r)", theme_name, view.key, e)
352362
errors.append("Using %r, view %r cannot be rendered (%r)" % (theme_name, view.key, e))

theme_anelusia/views/snippets/s_pricelist_boxed.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
<!-- Layout -->
66
<xpath expr="//section" position="attributes">
77
<attribute name="data-scroll-background-ratio"/>
8-
<attribute name="class" add="o_cc o_cc5" remove="parallax s_parallax_is_fixed s_parallax_no_overflow_hidden" separator=" "/>
8+
<attribute name="class" add="o_cc o_cc5" remove="parallax s_parallax_is_fixed" separator=" "/>
99
<attribute name="data-oe-shape-data">{'shape':'html_builder/Floats/12','flip':[],'showOnMobile':false,'shapeAnimationSpeed':'0','animated':'true'}</attribute>
1010
</xpath>
11-
<xpath expr="//span[hasclass('s_parallax_bg')]" position="replace"/>
11+
<xpath expr="//span[hasclass('s_parallax_bg_wrap')]" position="replace"/>
1212
<xpath expr="//div[hasclass('container')]" position="before">
1313
<div class="o_we_shape o_html_builder_Floats_12 o_we_animated"/>
1414
</xpath>

theme_artists/views/snippets/s_cover.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<template id="s_cover" inherit_id="website.s_cover">
55
<!-- Section -->
66
<xpath expr="//section" position="attributes">
7-
<attribute name="class" add="pt224 pb200" remove="pt232 pb232 s_parallax_bg parallax s_parallax_is_fixed bg-black-50" separator=" "/>
7+
<attribute name="class" add="pt224 pb200" remove="pt232 pb232 parallax s_parallax_is_fixed bg-black-50" separator=" "/>
88
<attribute name="data-oe-shape-data">{'shape':'html_builder/Connections/20','colors':{'c5': 'o-color-1'},'flip':['y'], 'showOnMobile':true}</attribute>
99
</xpath>
1010
<!-- Shape -->
@@ -13,7 +13,7 @@
1313
</xpath>
1414
<!-- Remove filter & parallax -->
1515
<xpath expr="//div[hasclass('o_we_bg_filter')]" position="replace"/>
16-
<xpath expr="//span[hasclass('s_parallax_bg')]" position="replace"/>
16+
<xpath expr="//span[hasclass('s_parallax_bg_wrap')]" position="replace"/>
1717
<!-- Title -->
1818
<xpath expr="//h1" position="replace" mode="inner">
1919
Emotions <br/>through the colors

theme_artists/views/snippets/s_pricelist_boxed.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
<!-- Layout -->
66
<xpath expr="//section" position="attributes">
77
<attribute name="data-scroll-background-ratio"/>
8-
<attribute name="class" add="o_cc o_cc5" remove="parallax s_parallax_is_fixed s_parallax_no_overflow_hidden" separator=" "/>
8+
<attribute name="class" add="o_cc o_cc5" remove="parallax s_parallax_is_fixed" separator=" "/>
99
<attribute name="data-oe-shape-data">{'shape':'html_builder/Wavy/27','flip':[],'showOnMobile':false,'shapeAnimationSpeed':'0','animated':'true'}</attribute>
1010
</xpath>
11-
<xpath expr="//span[hasclass('s_parallax_bg')]" position="replace"/>
11+
<xpath expr="//span[hasclass('s_parallax_bg_wrap')]" position="replace"/>
1212
<xpath expr="//div[hasclass('container')]" position="before">
1313
<div class="o_we_shape o_html_builder_Wavy_27 o_we_animated"/>
1414
</xpath>

theme_artists/views/snippets/s_title.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
</xpath>
1010
<!-- Parallax background & filter -->
1111
<xpath expr="//div[hasclass('container')]" position="before">
12-
<span class="s_parallax_bg oe_img_bg" style="background-image: url('/web/image/website.s_cover_default_image');"/>
12+
<span class="s_parallax_bg_wrap">
13+
<span class="s_parallax_bg oe_img_bg" style="background-image: url('/web/image/website.s_cover_default_image');"/>
14+
</span>
1315
<div class="o_we_bg_filter" style="background-color: rgba(17, 13, 22, 0.85) !important;"/>
1416
</xpath>
1517
<!-- Title -->
@@ -27,7 +29,7 @@
2729
<xpath expr="//h2" position="attributes">
2830
<attribute name="class" remove="display-3-fs" separator=" "/>
2931
</xpath>
30-
<xpath expr="//span[hasclass('s_parallax_bg')]" position="replace"/>
32+
<xpath expr="//span[hasclass('s_parallax_bg_wrap')]" position="replace"/>
3133
<xpath expr="//div[hasclass('o_we_bg_filter')]" position="replace"/>
3234
</template>
3335

theme_avantgarde/views/customizations.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
<!-- ======== COVER ======== -->
1313
<template id="s_cover" inherit_id="website.s_cover" name="Avantgarde s_cover">
1414
<xpath expr="//section" position="attributes">
15-
<attribute name="class" add="s_parallax_no_overflow_hidden o_full_screen_height" remove="s_parallax_is_fixed s_parallax" separator=" "/>
15+
<attribute name="class" add="o_full_screen_height" remove="s_parallax_is_fixed" separator=" "/>
16+
<attribute name="data-scroll-background-ratio" add="1.5" remove="1"/>
1617
</xpath>
1718
<xpath expr="//span[hasclass('s_parallax_bg')]" position="attributes">
1819
<attribute name="style" remove="background-position: 50% 75%;" add="background-position: 50% 80%;" separator=";"/>

theme_bewise/views/customizations.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<div class="o_we_shape o_html_builder_Rainy_08_001"/>
1515
</xpath>
1616
<!-- Remove the background image for parallax -->
17-
<xpath expr="//span[hasclass('s_parallax_bg')]" position="replace"/>
17+
<xpath expr="//span[hasclass('s_parallax_bg_wrap')]" position="replace"/>
1818
<!-- Title -->
1919
<xpath expr="//h1" position="replace" mode="inner">
2020
Always at the top

theme_bistro/views/snippets/s_image_title.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
<attribute name="data-scroll-background-ratio">-3</attribute>
1010
</xpath>
1111
<xpath expr="//div[hasclass('o_we_bg_filter')]" position="before">
12-
<span class="s_parallax_bg oe_img_bg o_bg_img_center" style="background-image: url('/web/image/website.s_image_title_default_image') !important;"/>
12+
<span class="s_parallax_bg_wrap">
13+
<span class="s_parallax_bg oe_img_bg o_bg_img_center" style="background-image: url('/web/image/website.s_image_title_default_image') !important;"/>
14+
</span>
1315
</xpath>
1416

1517
<!-- Texts -->

theme_bistro/views/snippets/s_product_catalog.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
<attribute name="data-scroll-background-ratio">1</attribute>
1010
</xpath>
1111
<xpath expr="//div[hasclass('o_we_bg_filter')]" position="replace">
12-
<span class="s_parallax_bg oe_img_bg" style="background-image: url('/web/image/website.s_product_catalog_default_image'); background-position: 50% 0%;"/>
12+
<span class="s_parallax_bg_wrap">
13+
<span class="s_parallax_bg oe_img_bg" style="background-image: url('/web/image/website.s_product_catalog_default_image'); background-position: 50% 0%;"/>
14+
</span>
1315
<div class="o_we_bg_filter bg-black-50"/>
1416
</xpath>
1517
<!-- Remove Title & lead -->

theme_bookstore/views/snippets/s_cover.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<div class="o_we_shape o_html_builder_Bold_26" style="background-image: url('/html_editor/shape/html_builder/Bold/26.svg?c5=o-color-1');"/>
1515
</xpath>
1616
<!-- Disable Parallax -->
17-
<xpath expr="//span[hasclass('s_parallax_bg')]" position="replace"/>
17+
<xpath expr="//span[hasclass('s_parallax_bg_wrap')]" position="replace"/>
1818
<!-- Title -->
1919
<xpath expr="//h1" position="replace" mode="inner">
2020
Immerse yourself <br/>in original universes

0 commit comments

Comments
 (0)