[IMP] portal, website: review sign in templates
Move it in an external view to be able to place it at a different location depending on the header template. Part of https://github.com/odoo/odoo/pull/56427 task-2264627 X-original-commit: b4866d192e6f4fdfba15b65fa2c209b35b7eb8c0
This commit is contained in:
@@ -16,6 +16,10 @@
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="top_menu_collapse">
|
||||
<ul class="nav navbar-nav ml-auto text-right" id="top_menu">
|
||||
<t t-call="portal.placeholder_user_sign_in">
|
||||
<t t-set="_item_class" t-value="'nav-item'"/>
|
||||
<t t-set="_link_class" t-value="'nav-link'"/>
|
||||
</t>
|
||||
<t t-call="portal.user_dropdown">
|
||||
<t t-set="_user_name" t-value="true"/>
|
||||
<t t-set="_item_class" t-value="'nav-item dropdown'"/>
|
||||
@@ -145,13 +149,12 @@
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<template id="portal_show_sign_in" inherit_id="portal.frontend_layout" name="Show Sign In">
|
||||
<xpath expr="//ul[@id='top_menu']" position="inside">
|
||||
<li class="nav-item divider" groups="base.group_public"/>
|
||||
<li groups="base.group_public" class="nav-item">
|
||||
<a t-attf-href="/web/login" class="nav-link">
|
||||
<b>Sign in</b>
|
||||
</a>
|
||||
<template id="placeholder_user_sign_in" name="User Sign In Placeholder"/>
|
||||
|
||||
<template id="user_sign_in" name="User Sign In" inherit_id="portal.placeholder_user_sign_in">
|
||||
<xpath expr="." position="inside">
|
||||
<li groups="base.group_public" t-attf-class="#{_item_class}">
|
||||
<a t-attf-href="/web/login" t-attf-class="#{_link_class}">Sign in</a>
|
||||
</li>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
@@ -1024,7 +1024,7 @@ class Crawler(HttpCase):
|
||||
})
|
||||
self.inherit_view.write({'name': 'Main layout', 'key': '_website.layout'})
|
||||
|
||||
self.inherit_view.copy({'name': 'Show Sign In', 'customize_show': True, 'key': '_portal.portal_show_sign_in'})
|
||||
self.inherit_view.copy({'name': 'Sign In', 'customize_show': True, 'key': '_portal.user_sign_in'})
|
||||
view_logo = self.inherit_view.copy({
|
||||
'name': 'Show Logo',
|
||||
'inherit_id': self.inherit_view.id,
|
||||
@@ -1078,7 +1078,7 @@ class Crawler(HttpCase):
|
||||
|
||||
self.assertEqual(
|
||||
[v['name'] for v in res],
|
||||
['Show Sign In', 'Affix Top Menu', 'Show Logo', 'Filters', 'Photos', 'Quotes', 'Filter by Category', 'Filter by Country'],
|
||||
['Sign In', 'Affix Top Menu', 'Show Logo', 'Filters', 'Photos', 'Quotes', 'Filter by Category', 'Filter by Country'],
|
||||
"Sequence should not be taken into account for customize menu",
|
||||
)
|
||||
self.assertEqual(
|
||||
@@ -1117,7 +1117,7 @@ class Crawler(HttpCase):
|
||||
res = response.json()['result']
|
||||
self.assertEqual(
|
||||
[v['name'] for v in res],
|
||||
['Show Sign In', 'Affix Top Menu', 'Show Logo', 'Filters', 'Photos', 'Quotes', 'Filter by Category', 'Filter by Country'],
|
||||
['Sign In', 'Affix Top Menu', 'Show Logo', 'Filters', 'Photos', 'Quotes', 'Filter by Category', 'Filter by Country'],
|
||||
"multi-website COW should not impact customize views order (COW view will have a bigger ID and should not be last)",
|
||||
)
|
||||
self.assertEqual(
|
||||
@@ -1152,7 +1152,7 @@ class Crawler(HttpCase):
|
||||
res = response.json()['result']
|
||||
self.assertEqual(
|
||||
[v['name'] for v in res],
|
||||
['Show Sign In', 'Affix Top Menu', 'Show Logo', 'Filters', 'Photos', 'Quotes', 'Filter by Category', 'Filter by Country'],
|
||||
['Sign In', 'Affix Top Menu', 'Show Logo', 'Filters', 'Photos', 'Quotes', 'Filter by Category', 'Filter by Country'],
|
||||
"multi-website COW should not impact customize views order (COW view will have a bigger ID and should not be last) (2)",
|
||||
)
|
||||
self.assertEqual(
|
||||
|
||||
@@ -528,7 +528,7 @@
|
||||
data-selector="#wrapwrap > header"
|
||||
data-no-check="true"
|
||||
groups="website.group_website_designer">
|
||||
<we-checkbox string="Sign In" data-customize-website-views="portal.portal_show_sign_in" data-reload="/"/>
|
||||
<we-checkbox string="Sign In" data-customize-website-views="portal.user_sign_in" data-reload="/"/>
|
||||
<we-colorpicker string="Colors"
|
||||
data-customize-website-color="" data-color="menu"
|
||||
data-with-combinations="true"/>
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
<xpath expr="//header//ul[@id='top_menu']" position="attributes">
|
||||
<attribute name="class" separator=" " add="o_menu_loading" remove="text-right ml-auto"/>
|
||||
</xpath>
|
||||
<xpath expr="//header//ul[@id='top_menu']/t[@t-call='portal.user_dropdown']" position="before">
|
||||
<xpath expr="//header//ul[@id='top_menu']/t[@t-call='portal.placeholder_user_sign_in']" position="before">
|
||||
<t t-foreach="website.menu_id.child_id" t-as="submenu">
|
||||
<t t-call="website.submenu">
|
||||
<t t-set="item_class" t-value="'nav-item'"/>
|
||||
|
||||
@@ -163,7 +163,7 @@ odoo.define('website_sale_tour.tour', function (require) {
|
||||
},
|
||||
{
|
||||
content: "Sign in as admin",
|
||||
trigger: '#top_menu li a b:contains("Sign in")',
|
||||
trigger: 'header a[href="/web/login"]',
|
||||
},
|
||||
{
|
||||
content: "Submit login",
|
||||
@@ -308,7 +308,7 @@ odoo.define('website_sale_tour.tour', function (require) {
|
||||
},
|
||||
{
|
||||
content: "Sign in as admin",
|
||||
trigger: '#top_menu li a b:contains("Sign in")',
|
||||
trigger: 'header a[href="/web/login"]',
|
||||
},
|
||||
{
|
||||
content: "Submit login",
|
||||
@@ -339,7 +339,7 @@ odoo.define('website_sale_tour.tour', function (require) {
|
||||
},
|
||||
{
|
||||
content: "Sign in as abc",
|
||||
trigger: '#top_menu li a b:contains("Sign in")',
|
||||
trigger: 'header a[href="/web/login"]',
|
||||
},
|
||||
{
|
||||
content: "Submit login",
|
||||
|
||||
Reference in New Issue
Block a user