[IMP] integrate login into the website.layout

bzr revid: fme@openerp.com-20140116181746-e2z9m4gym5kcdgmr
This commit is contained in:
Fabien Meghazi 2014-01-16 19:17:46 +01:00
parent 96c79572f8
commit 735c2b501b
5 changed files with 25 additions and 4 deletions

View File

@ -20,7 +20,7 @@ import openerp
from openerp.osv import fields from openerp.osv import fields
from openerp.addons.website.models import website from openerp.addons.website.models import website
from openerp.addons.web import http from openerp.addons.web import http
from openerp.addons.web.http import request from openerp.addons.web.http import request, LazyResponse
from ..utils import slugify from ..utils import slugify
@ -41,6 +41,14 @@ class Website(openerp.addons.web.controllers.main.Home):
pass pass
return self.page("website.homepage") return self.page("website.homepage")
@website.route('/web/login', type='http', auth="public", multilang=True)
def web_login(self, *args, **kw):
response = super(Website, self).web_login(*args, **kw)
if isinstance(response, LazyResponse):
values = dict(response.params['values'], disable_footer=True, redirect="/")
response = request.website.render(response.params['template'], values)
return response
@website.route('/pagenew/<path:path>', type='http', auth="user") @website.route('/pagenew/<path:path>', type='http', auth="user")
def pagenew(self, path, noredirect=NOPE): def pagenew(self, path, noredirect=NOPE):
web = request.registry['website'] web = request.registry['website']

View File

@ -1,4 +1,3 @@
@charset "utf-8";
/* THIS CSS FILE IS FOR WEBSITE THEMING CUSTOMIZATION ONLY /* THIS CSS FILE IS FOR WEBSITE THEMING CUSTOMIZATION ONLY
* *
* css for editor buttons, openerp widget included in the website and other * css for editor buttons, openerp widget included in the website and other
@ -479,3 +478,8 @@ span[data-oe-type="monetary"] {
-o-column-count: 3; -o-column-count: 3;
column-count: 3; column-count: 3;
} }
.oe_website_login_container {
width: 400px;
margin: 40px auto;
}

View File

@ -378,3 +378,6 @@ span[data-oe-type="monetary"]
.oe_template_fallback .oe_template_fallback
@include column-count(3) @include column-count(3)
.oe_website_login_container
width: 400px
margin: 40px auto

View File

@ -262,7 +262,7 @@
dom_ready.then(function () { dom_ready.then(function () {
/* ----- BOOTSTRAP STUFF ---- */ /* ----- BOOTSTRAP STUFF ---- */
$('.js_tooltip').bstooltip(); // $('.js_tooltip').bstooltip();
/* ----- PUBLISHING STUFF ---- */ /* ----- PUBLISHING STUFF ---- */
$(document).on('click', '.js_publish_management .js_publish_btn', function () { $(document).on('click', '.js_publish_management .js_publish_btn', function () {

View File

@ -230,7 +230,13 @@
</xpath> </xpath>
</template> </template>
<template id="login_layout" inherit_id="web.login_layout" name="Website Login Layout">
<xpath expr="t" position="replace">
<t t-call="website.layout">
<div class="oe_website_login_container" t-raw="0"/>
</t>
</xpath>
</template>
<template id="show_sign_in" inherit_option_id="website.layout" inherit_id="website.layout" name="Show Sign In"> <template id="show_sign_in" inherit_option_id="website.layout" inherit_id="website.layout" name="Show Sign In">
<xpath expr="//ul[@id='top_menu']" position="inside"> <xpath expr="//ul[@id='top_menu']" position="inside">