Files
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

35 lines
1.9 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="s_image_text" inherit_id="website.s_image_text">
<!-- Section -->
<xpath expr="//section" position="attributes">
<attribute name="class" add="o_cc o_cc1" separator=" "/>
<attribute name="data-oe-shape-data">{'shape':'web_editor/Origins/02_001','colors':{'c4':'o-color-1','c5':'o-color-4'},'flip':[],'showOnMobile':false,'shapeAnimationSpeed':'0'}</attribute>
</xpath>
<xpath expr="//section/div" position="before">
<div class="o_we_shape o_web_editor_Origins_02_001" style="background-image: url('/web_editor/shape/web_editor/Origins/02_001.svg?c4=o-color-1&amp;c5=o-color-4');"/>
</xpath>
<!-- Text wrapper -->
<xpath expr="//div[hasclass('col-lg-5')]" position="attributes">
<attribute name="class" add="offset-lg-2" remove="offset-lg-1" separator=" "/>
</xpath>
<!-- Title & Paragraph -->
<xpath expr="//h2" position="replace" mode="inner">
<span class="o_text_highlight o_translate_inline o_text_highlight_underline" style="--text-highlight-width: 3px; --text-highlight-color: var(--o-color-1);">Redefining modern rocks</span>
</xpath>
<xpath expr="//p" position="replace" mode="inner">
<br/>
</xpath>
<xpath expr="//p[2]" position="replace">
<p>With electrifying performances and a sound that's both raw and innovative, they bring an energy that keeps fans captivated from start to finish.</p>
<p>Their music isn't just heard—it's felt, combining powerful melodies with deeply relatable lyrics. Each song connects on a personal level, while their unmatched musicianship drives every note forward.</p>
</xpath>
<!-- Img wrapper -->
<xpath expr="//div[hasclass('col-lg-6')]" position="attributes">
<attribute name="class" add="col-lg-4" remove="col-lg-6" separator=" "/>
</xpath>
</template>
</odoo>