# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1242205367 -7200 # Node ID e11b0dcc26bd3faf599930f3cc6b9305bdf186d2 # Parent 311026c9073a0676538f0433eea67fdf39c0ba9d# Parent 7bd776052e2b407583ae1cf02b608b71fd1d49f8 merge diff -r 311026c9073a -r e11b0dcc26bd web/data/cubicweb.login.css --- a/web/data/cubicweb.login.css Wed May 13 11:02:40 2009 +0200 +++ b/web/data/cubicweb.login.css Wed May 13 11:02:47 2009 +0200 @@ -9,7 +9,7 @@ position: absolute; z-index: 400; right: 0px; - width: 23em; + width: 26em; padding: 0px 1px 1px; font-weight: bold; background: #E4EAD8; @@ -24,8 +24,8 @@ position : absolute; top: 15%; left : 50%; - margin-left: -11em; - width: 24em; + margin-left: -14em; + width: 28em; background: #fff; border: 2px solid #cfceb7; padding-bottom: 0.5em; diff -r 311026c9073a -r e11b0dcc26bd web/test/unittest_views_basetemplates.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/test/unittest_views_basetemplates.py Wed May 13 11:02:47 2009 +0200 @@ -0,0 +1,16 @@ +from cubicweb.devtools.testlib import WebTest +from cubicweb.devtools.htmlparser import DTDValidator + + +class LogFormTemplateTC(WebTest): + + def _login_labels(self): + valid = self.content_type_validators.get('text/html', DTDValidator)() + page = valid.parse_string(self.vreg.main_template(self.request(), 'login')) + return page.find_tag('label') + + def test_label(self): + self.set_option('allow-email-login', 'yes') + self.assertEquals(self._login_labels(), ['login or email', 'password']) + self.set_option('allow-email-login', 'no') + self.assertEquals(self._login_labels(), ['login', 'password']) diff -r 311026c9073a -r e11b0dcc26bd web/views/basetemplates.py --- a/web/views/basetemplates.py Wed May 13 11:02:40 2009 +0200 +++ b/web/views/basetemplates.py Wed May 13 11:02:47 2009 +0200 @@ -455,7 +455,8 @@ % html_escape(login_form_url(self.config, self.req))) self.w(u'
' % _('login or email')) + msg = (self.config['allow-email-login'] and _('login or email')) or _('login') + self.w(u' | ' % msg) self.w(u' | ') self.w(u' |
' % _('password')) |