use needs_css so you can change login form css without redefining LogFormView stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 16 Feb 2010 14:39:51 +0100
branchstable
changeset 4600 ae95c3241226
parent 4599 dafa39be525d
child 4601 0f65c40b56b5
use needs_css so you can change login form css without redefining LogFormView
web/views/basetemplates.py
--- a/web/views/basetemplates.py	Tue Feb 16 14:39:28 2010 +0100
+++ b/web/views/basetemplates.py	Tue Feb 16 14:39:51 2010 +0100
@@ -466,6 +466,7 @@
 class LogForm(forms.FieldsForm):
     __regid__ = 'logform'
     domid = 'loginForm'
+    needs_css = ('cubicweb.login.css',)
     # XXX have to recall fields name since python is mangling __login/__password
     __login = ff.StringField('__login', widget=fw.TextInput({'class': 'data'}))
     __password = ff.StringField('__password', label=_('password'),
@@ -485,7 +486,6 @@
     title = 'log in'
 
     def call(self, id, klass, title=True, showmessage=True):
-        self._cw.add_css('cubicweb.login.css')
         self.w(u'<div id="%s" class="%s">' % (id, klass))
         if title:
             stitle = self._cw.property_value('ui.site-title')