Files
design-themes/theme_notes/views/snippets/s_image_gallery.xml
T
Mehdi Outagant (MOU) ab8f6a8fce [IMP] theme_*: use minimal format for highlighted text content
*: buzzy, clean, notes

A highlighted text has the following structure:

```
<span class="o_text_highlight o_text_highlight_[highlightId]"
    style="--text-highlight-width: ...; --text-highlight-color: ...;">
    <span class="o_text_highlight_item">
        text content (line 1) ...
        <svg.../>
    </span>
    [<br/>]
    <span class="o_text_highlight_item">
        text content (line 2) ...
        <svg.../>
    </span>
    ...
</span>
```

Which is saved in a minimal format that allows the JS code to rebuild
the SVGs when it's needed:

```
<span class="o_text_highlight o_text_highlight_[highlightId]"
    style="--text-highlight-width: ...; --text-highlight-color: ...;">
    text content ...
</span>
```

The goal of this commit is to use the simplified format for theme
customizations and adapt the code from the "Snippets Preview" and the
"New Page Templates Preview" to be able to build the highlights using
this format when provided in XML.

task-4215788

closes odoo/design-themes#956

Related: odoo/odoo#181884
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2024-09-28 16:52:33 +00:00

38 lines
1.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="s_image_gallery" inherit_id="website.s_image_gallery">
<!-- Section -->
<xpath expr="//section" position="attributes">
<attribute name="class" add="s_image_gallery_arrows_boxed" remove="s_image_gallery_arrows_default" separator=" "/>
</xpath>
</template>
<template id="s_images_wall" inherit_id="website.s_images_wall">
<xpath expr="//section" position="attributes">
<attribute name="class" add="pb80" remove="pt24 pb24" separator=" "/>
<attribute name="data-oe-shape-data" add="{'shape':'web_editor/Origins/07_002','colors':{'c3':'o-color-1','c4':'o-color-4','c5':'o-color-1'},'flip':['x'],'showOnMobile':false,'shapeAnimationSpeed':'0'}"/>
</xpath>
<xpath expr="//div[hasclass('container')]" position="before">
<div class="o_we_shape o_web_editor_Origins_07_002" style="background-image: url('/web_editor/shape/web_editor/Origins/07_002.svg?c3=o-color-1&amp;c4=o-color-4&amp;c5=o-color-1&amp;flip=x');"></div>
</xpath>
<xpath expr="//div[hasclass('row')]/." position="before">
<div class="col-lg-12">
<h2 style="text-align: center;"><span class="o_text_highlight o_text_highlight_underline o_translate_inline" style="--text-highlight-color: var(--o-color-4); --text-highlight-width: 3px;">Band Gallery</span></h2>
<p>
<br/>
</p>
</div>
</xpath>
<!-- First image -->
<xpath expr="//img" position="attributes">
<attribute name="src">/web/image/website.library_image_19</attribute>
</xpath>
<!-- Third image -->
<xpath expr="(//img)[3]" position="attributes">
<attribute name="src">/web/image/website.s_cover_default_image</attribute>
</xpath>
</template>
</odoo>