Files
odoo_source/addons/website_sale/views/snippets/snippets.xml
T
Samuel Degueldre d8117750ce [FIX] website_sale: fix ribbon modifications not being previewed
Previously, editing a ribbon in the options panel had no preview inside
of the page until the change was validated. This commit fixes that issue
by making the real ribbon invisible, and making the ribbon dummy
visible. The preview still only affects the current ribbon being edited
until it is validated. Unvalidated changes are discarded when clicking
elsewhere in the page.

task-2339986

closes odoo/odoo#59806

X-original-commit: 922f3b67523e24204f15f38517c3dd207884ba66
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-12 17:46:09 +00:00

109 lines
5.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="s_products_recently_viewed" name="Viewed Products">
<section class="s_wsale_products_recently_viewed o_snippet_invisible pt24 pb24 d-none" style="min-height: 400px;">
<div class="container">
<h3 class="text-center mb32">Recently Viewed Products</h3>
<div class="slider o_not_editable"/>
</div>
</section>
</template>
<template id="snippets" inherit_id="website.snippets" name="e-commerce snippets">
<xpath expr="//t[@id='sale_products_hook']" position="replace">
<t t-snippet="website_sale.s_dynamic_snippet_products" t-thumbnail="/website_sale/static/src/img/snippets_thumbs/s_products_recently_viewed.svg"/>
</xpath>
<xpath expr="//t[@id='sale_recently_viewed_product_hook']" position="replace">
<t t-snippet="website_sale.s_products_recently_viewed" t-thumbnail="/website_sale/static/src/img/snippets_thumbs/s_products_recently_viewed.svg"/>
</xpath>
<xpath expr="//t[@id='sale_product_search_section_hook']" position="replace">
<t t-snippet="website_sale.s_products_searchbar" t-thumbnail="/website_sale/static/src/img/snippets_thumbs/s_products_searchbar.svg"/>
</xpath>
<xpath expr="//t[@id='sale_product_search_input_hook']" position="replace">
<t t-snippet="website_sale.s_products_searchbar_input" t-thumbnail="/website_sale/static/src/img/snippets_thumbs/s_products_searchbar_inline.svg"/>
</xpath>
</template>
<template id="snippet_options" inherit_id="website.snippet_options" name="e-commerce snippet options">
<xpath expr="." position="inside">
<div data-js="WebsiteSaleGridLayout"
data-selector="#products_grid .o_wsale_products_grid_table_wrapper > table"
data-no-check="true">
<we-input string="Number of products" data-set-ppg="" data-no-preview="true"/>
<we-select string="Number of Columns" class="o_wsale_ppr_submenu" data-no-preview="true">
<we-button data-set-ppr="2">2</we-button>
<we-button data-set-ppr="3">3</we-button>
<we-button data-set-ppr="4">4</we-button>
</we-select>
</div>
<div data-js="WebsiteSaleProductsItem"
data-selector="#products_grid .oe_product"
data-no-check="true">
<div class="o_wsale_soptions_menu_sizes">
<we-title>Size</we-title>
<table>
<tr>
<td/><td/><td/><td/>
</tr>
<tr>
<td/><td/><td/><td/>
</tr>
<tr>
<td/><td/><td/><td/>
</tr>
<tr>
<td/><td/><td/><td/>
</tr>
</table>
</div>
<we-row data-name="ribbon_options">
<we-select string="Ribbon" class="o_wsale_ribbon_select">
<we-button data-set-ribbon="" data-name="no_ribbon_opt">None</we-button>
<!-- Ribbons are filled in JS -->
</we-select>
<we-button data-edit-ribbon="" class="fa fa-edit" data-no-preview="true" data-dependencies="!no_ribbon_opt"/>
<we-button data-create-ribbon="" class="fa fa-plus text-success" data-no-preview="true"/>
</we-row>
<div class="d-none" data-name="ribbon_customize_opt">
<we-row string="Ribbon">
<we-input data-set-ribbon-html="" class="o_we_large_input" data-apply-to=".o_wsale_ribbon_dummy"/>
<we-button class="fa fa-check" data-save-ribbon="" title="Validate" data-no-preview="true"/>
<we-button class="fa fa-trash" data-delete-ribbon="" title="Delete" data-no-preview="true"/>
</we-row>
<we-colorpicker string="⌙ Background" title="" data-select-style="" data-apply-to=".o_wsale_ribbon_dummy" data-css-property="background-color" data-color-prefix="bg-"/>
<we-colorpicker string="⌙ Text" title="" data-select-style="" data-apply-to=".o_wsale_ribbon_dummy" data-css-property="color"/>
<we-select string="⌙ Mode">
<we-button data-set-ribbon-mode="ribbon">Slanted</we-button>
<we-button data-set-ribbon-mode="tag">Tag</we-button>
</we-select>
<we-select string="⌙ Position">
<we-button data-set-ribbon-position="left">Left</we-button>
<we-button data-set-ribbon-position="right">Right</we-button>
</we-select>
</div>
<div name="reordering" data-no-preview="true">
<we-button data-change-sequence="top">Push to top</we-button>
<we-button data-change-sequence="up">Push up</we-button>
<we-button data-change-sequence="down">Push down</we-button>
<we-button data-change-sequence="bottom">Push to bottom</we-button>
</div>
</div>
<div data-selector="#wrapwrap > header"
data-no-check="true"
groups="website.group_website_designer">
<we-checkbox string="Show Empty Cart"
data-customize-website-views="website_sale.header_hide_empty_cart_link|"
data-no-preview="true"
data-reload="/"/>
</div>
<div data-js="ProductsRecentlyViewed" data-selector=".s_wsale_products_recently_viewed"/>
</xpath>
</template>
</odoo>