summaryrefslogtreecommitdiff
path: root/addons/website_profile/views
diff options
context:
space:
mode:
authorDavid Beguin <dbe@odoo.com>2019-02-20 16:54:36 +0000
committerDavid Beguin <dbe@odoo.com>2019-03-15 14:58:28 +0000
commitfb40c6bf6018f7f208201e1d4a4d413fd2ce3080 (patch)
treed6df1ec5f2e7aca08311a51fad7f2ab3162a6806 /addons/website_profile/views
parentbbedcdb19054527940fb040a0d4f22115d5be265 (diff)
[IMP] website(_profile,_forum,_slides): move validation email to profile and use in forum and elearning
Email validation was necessary on the forum to be able to begin to use the forum (ask or answer questions, vote, etc..) As the new elearning also uses karma since 705376a982d64fb41800f148a167ef0fc28ce4c6, the email validation is now also necessary in the eLearning platform. This is why this commit is moving the email validation process to website_profile and extend website_slides (eLearning) and website_forum to use this feature. In function of where the user asked to send him the validation email, the user is redirected on the forum or on the elearning when he clicks on 'Validate my account' in the received 'email validation' email. Task ID : 1943788 PR #31321
Diffstat (limited to 'addons/website_profile/views')
-rw-r--r--addons/website_profile/views/website_profile.xml39
1 files changed, 36 insertions, 3 deletions
diff --git a/addons/website_profile/views/website_profile.xml b/addons/website_profile/views/website_profile.xml
index 2a108ef8906..fc9e6aae113 100644
--- a/addons/website_profile/views/website_profile.xml
+++ b/addons/website_profile/views/website_profile.xml
@@ -4,6 +4,9 @@
<xpath expr="link[last()]" position="after">
<link rel="stylesheet" type="text/scss" href="/website_profile/static/src/scss/website_profile.scss"/>
</xpath>
+ <xpath expr="script[last()]" position="after">
+ <script type="text/javascript" src="/website_profile/static/src/js/website_profile.js"/>
+ </xpath>
</template>
@@ -130,7 +133,7 @@
<div class="col-12 col-md-4 col-lg-3">
<div t-attf-class="d-flex align-items-start #{'justify-content-between' if (request.env.user == user) else 'justify-content-around' }">
<div class="o_wprofile_pict d-inline-block mb-3 mb-md-0" t-attf-style="background-image:url(/web/image/res.users/#{user.id}/image)"/>
- <a class="btn btn-primary d-inline-block d-md-none" t-if="request.env.user == user" t-attf-href="/profile/edit?url_param=#{edit_button_url_param}">
+ <a class="btn btn-primary d-inline-block d-md-none" t-if="request.env.user == user and validation_email_done" t-attf-href="/profile/edit?url_param=#{edit_button_url_param}">
<i class="fa fa-pencil mr-1"/>EDIT
</a>
</div>
@@ -139,8 +142,10 @@
<!-- ==== Header Right ==== -->
<div class="col-12 col-md-8 col-lg-9 d-flex flex-column">
<div class="d-flex justify-content-between align-items-start">
- <h1 class="o_card_people_name" t-field="user.name"/>
- <a class="btn btn-primary d-none d-md-inline-block" t-if="request.env.user == user" t-attf-href="/profile/edit?url_param=#{edit_button_url_param}">
+ <h1 class="o_card_people_name">
+ <span t-field="user.name"/><small t-if="not validation_email_done"> (not verified)</small>
+ </h1>
+ <a class="btn btn-primary d-none d-md-inline-block" t-if="request.env.user == user and validation_email_done" t-attf-href="/profile/edit?url_param=#{edit_button_url_param}">
<i class="fa fa-pencil mr-2"/>EDIT PROFILE
</a>
</div>
@@ -212,6 +217,12 @@
</ul>
<div class="tab-content py-4 o_wprofile_tabs_content mb-4" id="profile_extra_info_tabcontent">
<div role="tabpanel" class="tab-pane active" id="profile_tab_content_about">
+ <div class="o_wprofile_email_validation_container mb16 mt16">
+ <t t-call="website_profile.email_validation_banner">
+ <t t-set="redirect_url" t-value="'/profile/user/%s' % user.id"/>
+ <t t-set="send_validation_email_message" t-value="'Click here to send a verification email.'"/>
+ </t>
+ </div>
<div id="profile_about_badge" class="mb32">
<h5 class="border-bottom pb-1">Badges</h5>
<t t-call="website_profile.user_badges"></t>
@@ -463,4 +474,26 @@
</ul>
</template>
+ <template id="email_validation_banner">
+ <div t-if="not validation_email_sent and not is_public_user and user.karma == 0" class="alert alert-danger alert-dismissable" role="alert">
+ <button type="button" class="close validation_email_close" data-dismiss="alert" aria-label="Close">&amp;times;</button>
+ <div>
+ <p>
+ It appears your email has not been verified.
+ <a class="send_validation_email" href="#" t-att-data-redirect_url="redirect_url">
+ <span t-esc="send_validation_email_message"/></a>
+ </p>
+ </div>
+ </div>
+ <div t-if="validation_email_done" class="alert alert-success alert-dismissable" role="status">
+ <button type="button" class="close validated_email_close" data-dismiss="alert" aria-label="Close">&amp;times;</button>
+ <div>
+ <p>
+ <span id="email_validated_message">Congratulations! Your email has just been validated.</span>
+ <span t-esc="additional_validated_email_message"/>
+ </p>
+ </div>
+ </div>
+ </template>
+
</data></odoo>