Files
odoo_source/addons/website_mail/views/website_mail_templates.xml
T
Benoit Socias 53c748b682 [FIX] website_mail: adjust the visibility of the (un)subscribe buttons
Before this commit the visibility of the blog (un)subscribe/(un)follow
buttons was behaving inconsistently because of a combination of specific
CSS based on data values and the adding and removal of d-none classes.

After this commit the visibility of the buttons is using only the CSS
mechanism based on data values. Also adjusted the alignment of the email
text input and its attached button (aligned in both blog & forum).

Fixes https://github.com/odoo/odoo/issues/62714

closes odoo/odoo#63001

X-original-commit: 486c445d2200d3805ffac30e84ff35a7a61bf0b7
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2020-12-08 10:41:42 +00:00

32 lines
1.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="follow">
<div t-attf-class="input-group js_follow #{div_class}" t-att-data-id="object.id"
t-att-data-object="object._name"
t-att-data-follow="object.id and object.message_is_follower and 'on' or 'off'"
t-att-data-unsubscribe="'unsubscribe' if 'unsubscribe' in request.params else None">
<input
type="email" name="email"
class="js_follow_email form-control"
placeholder="your email..."
groups="base.group_public"/>
<div t-if="icons_design and not request.env.user.has_group('base.group_public')" class="js_follow_icons_container">
<button class="btn text-reset js_unfollow_btn">
<div class="d-flex align-items-center">
<small>Unfollow</small><i class="fa fa-fw ml-1"/>
</div>
</button>
<button class="btn text-reset js_follow_btn">
<div class="d-flex align-items-center">
<small>Follow</small><i class="fa fa-fw ml-1"/>
</div>
</button>
</div>
<div t-else="" t-attf-class="#{request.env.user.has_group('base.group_public') and 'input-group-append'}">
<button href="#" t-attf-class="btn btn-secondary js_unfollow_btn">Unsubscribe</button>
<button href="#" t-attf-class="btn btn-primary js_follow_btn">Subscribe</button>
</div>
</div>
</template>
</odoo>