*: auth_password_policy, bus, calendar, event, mass_mailing, stock, survey, web_editor, web_tour, website, website_event, website_forum, website_mass_mailing, website_sale This commit is a first step towards a potential deletion of the assets_common bundle, although that step would need more work, specs and discussions as some layouts kinda only use the assets_common bundle (some take the full assets_common but parts of the assets_backend one for example). The main goal of this commit is to have the assets_frontend bundle directly include the "common" files we need. As a first step, this commit only blindly duplicates them all into assets_frontend (without removing the potentially useless ones). The goal is to have those advantages: - Reaching a frontend page only calls two main JS files (one normal and one lazy-loaded) instead of 4 (two normals and two lazy-loaded). This may help reach a better google page speed (which is becoming more and more strict). - The frontend CSS is built as one: the common SCSS which was using bootstrap variables, or even Odoo-based SCSS added by mistake in common instead of both backend and frontend is now computed with the right bootstrap customizations. E.g. the tempusdominus datetimepickers use bootstrap grays... after this PR, they use the right grays as customized by the user on the website. It was also chosen to not have a common "sub-asset" which is included in assets_frontend. Making assets_frontend completely independent makes sense (as it probably will for other "main" asset bundles): we can focus on adding the files each layout needs without the need of worrying if it impacts unrelated layouts. Sub-assets (when not strictly necessary) is also a source of errors: extending the "main" bundle instead of the right sub-asset it may use (like it was the case with the sub-assets of assets_common: _assets_common_scripts and _assets_common_styles as explained in the previous commit). So this is indeed a small drawback of not factorizing the code for the inclusion of "common" files in bundles but it seems more explicit and easier to maintain that way. Note that adding "common" file is not the most common usecase anyway, apps generally only need files in backend or frontend. The __manifest__ declaration will also likely evolve in more and more uses of wildcards to match entire directories. In the future, adding "common" web-app files in both backend, frontend and other "main" bundles could just be about one line duplicated into each bundle. closes odoo/odoo#100314 Related: odoo/enterprise#31394 Signed-off-by: Romain Derie (rde) <rde@odoo.com>
237 lines
14 KiB
XML
237 lines
14 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<template id="iframe_css_assets_edit" name="CSS assets for wysiwyg iframe content for popup" groups="base.group_user">
|
|
<t t-call-assets="web.assets_frontend" t-js="false"/>
|
|
<t t-call-assets="web_editor.assets_wysiwyg" t-js="false"/>
|
|
<t t-call-assets="website.assets_editor" t-js="false"/>
|
|
</template>
|
|
|
|
<template id="remove_external_snippets" inherit_id="website.external_snippets">
|
|
<xpath expr="//t[@id='newsletter_snippet']" position="replace"/>
|
|
<xpath expr="//t[@id='newsletter_popup_snippet']" position="replace"/>
|
|
</template>
|
|
|
|
<template id="snippets" inherit_id="website.snippets">
|
|
<xpath expr="//t[@id='mass_mailing_newsletter_block_hook']" position="replace">
|
|
<t t-snippet="website_mass_mailing.s_newsletter_block" t-thumbnail="/website_mass_mailing/static/src/img/snippets_thumbs/s_newsletter_block.svg" t-forbid-sanitize="form"/>
|
|
</xpath>
|
|
<xpath expr="//t[@id='mass_mailing_newsletter_popup_hook']" position="replace">
|
|
<t t-snippet="website_mass_mailing.s_newsletter_subscribe_popup" t-thumbnail="/website/static/src/img/snippets_thumbs/newsletter_subscribe_popup.svg" t-forbid-sanitize="form"/>
|
|
</xpath>
|
|
<xpath expr="//t[@id='mass_mailing_newsletter_hook']" position="replace">
|
|
<t t-snippet="website_mass_mailing.s_newsletter_subscribe_form" t-thumbnail="/website/static/src/img/snippets_thumbs/s_newsletter_subscribe_form.svg" t-forbid-sanitize="form"/>
|
|
</xpath>
|
|
</template>
|
|
|
|
<template id="s_newsletter_subscribe_form" name="Newsletter">
|
|
<div class="s_newsletter_subscribe_form s_newsletter_list js_subscribe" data-vxml="001" data-list-id="0" data-name="Newsletter Form">
|
|
<div class="input-group">
|
|
<input type="email" name="email" class="js_subscribe_value form-control" placeholder="your email..."/>
|
|
<a role="button" href="#" class="btn btn-primary js_subscribe_btn o_submit">Subscribe</a>
|
|
<a role="button" href="#" class="btn btn-success js_subscribed_btn d-none o_submit" disabled="disabled">Thanks</a>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<template id="s_newsletter_block" name="Newsletter block">
|
|
<section class="s_newsletter_block s_newsletter_list pt32 pb32" data-list-id="0">
|
|
<div class="container">
|
|
<t t-call="website_mass_mailing.s_newsletter_block_default_template"/>
|
|
</div>
|
|
</section>
|
|
</template>
|
|
|
|
<template id="s_newsletter_block_default_template" groups="base.group_user">
|
|
<div class="row">
|
|
<div class="col-lg-8 offset-lg-2 pt24 pb24">
|
|
<h2>Always First.</h2>
|
|
<p>Be the first to find out all the latest news, products, and trends.</p>
|
|
<t t-snippet-call="website_mass_mailing.s_newsletter_subscribe_form"/>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<template id="s_newsletter_block_form_template" groups="base.group_user">
|
|
<section class="s_website_form" data-vcss="001" data-snippet="s_website_form" data-name="Form">
|
|
<div class="container">
|
|
<form id="newsletter_form" action="/website/form/" method="post" enctype="multipart/form-data" class="o_mark_required"
|
|
data-mark="*" data-model_name="mailing.contact" data-success-mode="message" hide-change-model="true">
|
|
<div class="s_website_form_rows row s_col_no_bgcolor">
|
|
<div class="mb-0 py-2 col-12 s_website_form_field s_website_form_model_required" data-type="char" data-name="Field">
|
|
<div class="row s_col_no_resize s_col_no_bgcolor">
|
|
<label class="col-form-label col-sm-auto s_website_form_label" style="width: 250px" for="mailing_sub1">
|
|
<span class="s_website_form_label_content">Your Name</span>
|
|
<span class="s_website_form_mark"> *</span>
|
|
</label>
|
|
<div class="col-sm">
|
|
<input id="mailing_sub1" type="text" class="form-control s_website_form_input" name="name" required="1"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="mb-0 py-2 col-12 s_website_form_field s_website_form_model_required" data-type="email" data-name="Field">
|
|
<div class="row s_col_no_resize s_col_no_bgcolor">
|
|
<label class="col-form-label col-sm-auto s_website_form_label" style="width: 250px" for="mailing_sub2">
|
|
<span class="s_website_form_label_content">Your Email</span>
|
|
<span class="s_website_form_mark"> *</span>
|
|
</label>
|
|
<div class="col-sm">
|
|
<input id="mailing_sub2" type='email' class='form-control s_website_form_input' name="email"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="mb-0 py-2 col-12 s_website_form_field s_website_form_model_required" data-type="many2many" data-name="Field">
|
|
<div class="row s_col_no_resize s_col_no_bgcolor">
|
|
<label class="col-sm-auto s_website_form_label" style="width: 250px" for="mailing_list_">
|
|
<span class="s_website_form_label_content">Subscribe to</span>
|
|
<span class="s_website_form_mark"> *</span>
|
|
</label>
|
|
<div class="col-sm">
|
|
<div class="row s_col_no_resize s_col_no_bgcolor s_website_form_multiple" data-name="list_ids" data-display="horizontal">
|
|
<t t-foreach="request.env['mailing.list'].search([('is_public', '=', True)])" t-as="record">
|
|
<div class="checkbox col-12 col-lg-4 col-md-6">
|
|
<div class="form-check">
|
|
<input type="checkbox" class="s_website_form_input form-check-input" name="list_ids"
|
|
t-attf-id="mailing_list_#{record.id}" t-att-value="record.id" required="1"/>
|
|
<label class="form-check-label s_website_form_check_label" t-attf-for="mailing_list_#{record.id}">
|
|
<t t-esc="record.display_name"/>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="mb-0 py-2 col-12 s_website_form_field s_website_form_custom s_website_form_required" data-type="boolean" data-name="Field">
|
|
<div class="row s_col_no_resize s_col_no_bgcolor">
|
|
<label class="col-sm-auto s_website_form_label" style="width: 250px;" for="mailing_sub3">
|
|
<span class="s_website_form_label_content">I agree to receive updates</span>
|
|
<span class="s_website_form_mark"> *</span>
|
|
</label>
|
|
<div class="col-sm">
|
|
<div class="form-check">
|
|
<input type="checkbox" value="Yes" class="s_website_form_input" name="I want to be kept updated"
|
|
id="mailing_sub3" required="1"/>
|
|
</div>
|
|
<div class="s_website_form_field_description small form-text text-muted">
|
|
We send one weekly newsletter per list and always try to keep it interesting. You can unsubscribe at any time.
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="mb-0 py-2 col-12 s_website_form_submit" data-name="Submit Button">
|
|
<div style="width: 250px;" class="s_website_form_label"/>
|
|
<a href="#" role="button" class="btn btn-primary btn-lg s_website_form_send">Subscribe</a>
|
|
<span id="s_website_form_result"></span>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<div class="s_website_form_end_message d-none">
|
|
<div class="oe_structure">
|
|
<section class="s_text_block pt64 pb64 o_colored_level o_cc o_cc2" data-snippet="s_text_block">
|
|
<div class="container">
|
|
<h2 class="text-center"><span class="fa fa-check-circle"></span>
|
|
Thank you for subscribing !
|
|
</h2>
|
|
<p class="text-center">
|
|
You will now be informed about the latest news.<br/>
|
|
</p>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</template>
|
|
|
|
<template id="s_newsletter_subscribe_popup" name="Newsletter Popup">
|
|
<div class="s_popup o_newsletter_popup o_snippet_invisible" data-name="Newsletter Popup" data-vcss="001" data-invisible="1">
|
|
<div class="modal fade s_popup_middle o_newsletter_modal"
|
|
style="background-color: var(--black-50) !important;"
|
|
data-show-after="5000" data-display="afterDelay" data-consents-duration="7"
|
|
data-focus="false" data-bs-backdrop="false" tabindex="-1" role="dialog">
|
|
<div class="modal-dialog d-flex">
|
|
<div class="modal-content oe_structure">
|
|
<div class="s_popup_close js_close_popup o_we_no_overlay o_not_editable" aria-label="Close">×</div>
|
|
<section class="s_text_block oe_img_bg o_bg_img_center pt88 pb64" data-snippet="s_text_block" data-name="Text"
|
|
style="background-image: url('/web/image/website.s_cover_default_image'); background-position: 0 100%;">
|
|
<div class="container s_allow_columns">
|
|
<h1 style="text-align: center;">Always <b>First</b>.</h1>
|
|
<p style="text-align: center;">Be the first to find out all the latest news,<br/> products, and trends.</p>
|
|
</div>
|
|
</section>
|
|
<section class="s_text_block" data-snippet="s_text_block" data-name="Text">
|
|
<div class="container">
|
|
<div class="row s_nb_column_fixed g-0">
|
|
<div class="col-lg-8 offset-lg-2 pt32 pb32">
|
|
<t t-snippet-call="website_mass_mailing.s_newsletter_subscribe_form"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<template id="newsletter_subscribe_options" name="Newsletter Subscribe Options" inherit_id="website.snippet_options">
|
|
<xpath expr="//*[@t-set='so_snippet_addition_selector']" position="inside">, .o_newsletter_popup</xpath>
|
|
<xpath expr="//div[1]" position="before">
|
|
<div data-js="NewsletterLayout" data-selector=".s_newsletter_block">
|
|
<we-select string="Template"
|
|
data-name="newsletter_template_opt"
|
|
data-attribute-name="newsletterTemplate"
|
|
data-attribute-default-value="email">
|
|
<we-button title="Email Subscription" string="Email Subscription"
|
|
data-select-template="website_mass_mailing.s_newsletter_block_default_template"
|
|
data-select-data-attribute="email" data-name="email_opt"/>
|
|
<we-button title="Form Subscription" string="Form Subscription"
|
|
data-select-template="website_mass_mailing.s_newsletter_block_form_template"
|
|
data-select-data-attribute="form" data-name="form_opt"/>
|
|
</we-select>
|
|
</div>
|
|
<t t-call="website_mass_mailing.newsletter_subscribe_options_common">
|
|
<t t-set="_selector">.o_newsletter_popup</t>
|
|
<t t-set="_target">.s_newsletter_list</t>
|
|
</t>
|
|
<t t-call="website_mass_mailing.newsletter_subscribe_options_common">
|
|
<t t-set="_selector">.s_newsletter_list</t>
|
|
<t t-set="_exclude">.s_newsletter_block .s_newsletter_list, .o_newsletter_popup .s_newsletter_list</t>
|
|
</t>
|
|
<div data-selector=".js_subscribe" data-drop-near="p, h1, h2, h3, blockquote, .card"/>
|
|
</xpath>
|
|
</template>
|
|
|
|
<template id="newsletter_subscribe_options_common">
|
|
<div data-js="mailing_list_subscribe"
|
|
t-att-data-selector="_selector"
|
|
t-att-data-exclude="_exclude"
|
|
t-att-data-target="_target">
|
|
<we-select string="Newsletter" data-attribute-name="listId" data-dependencies="!form_opt"></we-select>
|
|
</div>
|
|
<div data-js="recaptchaSubscribe"
|
|
t-att-data-selector="_selector"
|
|
t-att-data-exclude="_exclude"
|
|
t-att-data-target="_target">
|
|
<t t-set="recaptcha_public_key" t-value="request.env['ir.config_parameter'].sudo().get_param('recaptcha_public_key')"/>
|
|
<we-checkbox t-if="recaptcha_public_key" string="Show reCaptcha Policy" data-toggle-recaptcha-legal="" data-no-preview="true"/>
|
|
</div>
|
|
</template>
|
|
|
|
<!-- Extend default mass_mailing snippets with website feature -->
|
|
|
|
<template id="s_mail_block_footer_social" inherit_id="mass_mailing.s_mail_block_footer_social">
|
|
<xpath expr="//div[hasclass('o_mail_footer_links')]" position="inside">
|
|
<t> | <a role="button" href="/contactus" class="btn btn-link">Contact</a></t>
|
|
</xpath>
|
|
</template>
|
|
|
|
<template id="s_mail_block_footer_social_left" inherit_id="mass_mailing.s_mail_block_footer_social_left">
|
|
<xpath expr="//div[hasclass('o_mail_footer_links')]" position="inside">
|
|
<t> | <a role="button" href="/contactus" class="btn btn-link">Contact</a></t>
|
|
</xpath>
|
|
</template>
|
|
|
|
</odoo>
|