Files
design-themes/theme_notes/views/snippets/s_three_columns.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

75 lines
2.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="s_three_columns" inherit_id="website.s_three_columns">
<!-- Section -->
<xpath expr="//section" position="attributes">
<attribute name="class" add="o_cc4 pt80 pb120" remove="o_cc2 pt32 pb32" separator=" "/>
</xpath>
<!-- Title -->
<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-width: 4px; --text-highlight-color: var(--o-color-4);">Upcoming concerts</span>
</h2>
<p>
<br/>
</p>
</div>
</xpath>
<!-- Card 1 -->
<xpath expr="//div[hasclass('s_card')]" position="attributes">
<attribute name="style" add="border-width: 0px !important;" separator=";"/>
</xpath>
<xpath expr="//div[hasclass('s_card')]//h5" position="replace">
<h4 class="card-title">Belgium Tour</h4>
</xpath>
<xpath expr="//div[hasclass('s_card')]//p" position="replace">
<p class="o_small_fs">24th AUGUST</p>
<p>Discover the new album live.</p>
<p>
<br/>
</p>
<p>
<a class="btn btn-primary" href="#">Get your tickets</a>
</p>
</xpath>
<!-- Card 2 -->
<xpath expr="(//div[hasclass('s_card')])[2]" position="attributes">
<attribute name="style" add="border-width: 0px !important;" separator=";"/>
</xpath>
<xpath expr="(//div[hasclass('s_card')])[2]//img" position="attributes">
<attribute name="src">/web/image/website.s_carousel_default_image_2</attribute>
</xpath>
<xpath expr="(//div[hasclass('s_card')])[2]//h5" position="replace">
<h4 class="card-title">Barcelona Night</h4>
</xpath>
<xpath expr="(//div[hasclass('s_card')])[2]//p" position="replace">
<p class="o_small_fs">27th AUGUST</p>
<p>Get up close with the artists.</p>
<p>
<br/>
</p>
<p>
<a class="btn btn-primary" href="#">Get your tickets</a>
</p>
</xpath>
<!-- Card 3 -->
<xpath expr="(//div[hasclass('s_card')])[3]" position="attributes">
<attribute name="style" add="border-width: 0px !important;" separator=";"/>
</xpath>
<xpath expr="(//div[hasclass('s_card')])[3]//h5" position="replace">
<h4 class="card-title">Amsterdam Tour</h4>
</xpath>
<xpath expr="(//div[hasclass('s_card')])[3]//p" position="replace">
<p class="o_small_fs">9th SEPTEMBER</p>
<p>Tour Grand Final.</p>
<p><br/></p>
<p>
<a class="btn btn-primary" href="#">Get your tickets</a>
</p>
</xpath>
</template>
</odoo>