Skip to content

Commit 27f573f

Browse files
committed
[REF] website: convert s_badge_options to OWL
task-3850413
1 parent 3eb1fbe commit 27f573f

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

addons/website/__manifest__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@
289289
'website/static/src/snippets/s_website_controller_page_listing_layout/options.xml',
290290
'website/static/src/snippets/s_website_form/options.js',
291291
'website/static/src/snippets/s_website_form/options.xml',
292+
'website/static/src/snippets/s_badge/options.xml',
292293
'website/static/src/js/form_editor_registry.js',
293294
'website/static/src/js/send_mail_form.js',
294295
'website/static/src/xml/website_form.xml',

addons/website/static/src/js/editor/snippets.registry.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@ registerWebsiteOption("WebsiteIconTools", {
1515
selector: "span.fa, i.fa",
1616
exclude: "[data-oe-xpath]",
1717
});
18+
19+
registerWebsiteOption("BadgeOptions", {
20+
template: "website.s_badge_options",
21+
selector: ".s_badge",
22+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<templates xml:space="preserve">
3+
4+
<t t-name="website.s_badge_options">
5+
<WeColorpicker title.translate="Color" name="'badge_colorpicker_opt'"
6+
selectStyle="'true'"
7+
cssProperty="'background-color'"
8+
colorPrefix="'bg-'"/>
9+
</t>
10+
11+
</templates>

addons/website/views/snippets/s_badge.xml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,6 @@
77
</span>
88
</template>
99

10-
<template id="s_badge_options" inherit_id="website.snippet_options">
11-
<xpath expr="//div[@data-js='Box']" position="before">
12-
<div data-selector=".s_badge">
13-
<we-colorpicker string="Color" data-name="badge_colorpicker_opt"
14-
data-select-style="true"
15-
data-css-property="background-color"
16-
data-color-prefix="bg-"/>
17-
</div>
18-
</xpath>
19-
</template>
20-
2110
<record id="website.s_badge_000_variables_scss" model="ir.asset">
2211
<field name="name">Badge 000 variables SCSS</field>
2312
<field name="bundle">web._assets_primary_variables</field>

0 commit comments

Comments
 (0)