From: Leandro Lucarella Date: Fri, 16 Feb 2007 19:38:12 +0000 (+0000) Subject: Pasar JS a widget de formulario. X-Git-Tag: pre-merge~137 X-Git-Url: https://git.llucax.com/software/sercom.git/commitdiff_plain/d47dd9949d44d12944f557b0efd80459b857ce74?hp=678f514772434db8525572e20ffa45e1d159764a Pasar JS a widget de formulario. --- diff --git a/sercom/controllers.py b/sercom/controllers.py index 88880c5..714869a 100644 --- a/sercom/controllers.py +++ b/sercom/controllers.py @@ -62,6 +62,8 @@ class Root(controllers.RootController): login_form = w.TableForm(fields=fields, action=previous_url, submit_text=_(u'Ingresar'), submit=submit) + login_form.javascript.append( + w.JSSource("MochiKit.DOM.focusOnLoad('form_login_user');")) values = dict(forward_url=forward_url) values.update(request.params) diff --git a/sercom/subcontrollers/caso_de_prueba/__init__.py b/sercom/subcontrollers/caso_de_prueba/__init__.py index ad62b05..191800b 100644 --- a/sercom/subcontrollers/caso_de_prueba/__init__.py +++ b/sercom/subcontrollers/caso_de_prueba/__init__.py @@ -59,6 +59,7 @@ form = TableForm(fields=[ TextField(name='tiempo_cpu', label=_(u'Tiempo de CPU'), validator=validators.Number(not_empty=False, strip=True)), ]) +form.javascript.append(JSSource("MochiKit.DOM.focusOnLoad('form_nombre');")) class CasoDePruebaController(controllers.Controller, identity.SecureResource): """Basic model admin interface""" diff --git a/sercom/subcontrollers/caso_de_prueba/templates/edit.kid b/sercom/subcontrollers/caso_de_prueba/templates/edit.kid index 40b7d75..a8a5aec 100644 --- a/sercom/subcontrollers/caso_de_prueba/templates/edit.kid +++ b/sercom/subcontrollers/caso_de_prueba/templates/edit.kid @@ -4,7 +4,6 @@ edit - diff --git a/sercom/subcontrollers/caso_de_prueba/templates/new.kid b/sercom/subcontrollers/caso_de_prueba/templates/new.kid index 715e74c..6a05bc7 100644 --- a/sercom/subcontrollers/caso_de_prueba/templates/new.kid +++ b/sercom/subcontrollers/caso_de_prueba/templates/new.kid @@ -4,7 +4,6 @@ new - diff --git a/sercom/subcontrollers/docente/__init__.py b/sercom/subcontrollers/docente/__init__.py index b8805b9..df4a2b7 100644 --- a/sercom/subcontrollers/docente/__init__.py +++ b/sercom/subcontrollers/docente/__init__.py @@ -43,6 +43,7 @@ form = TableForm(fields=[ #help_text=_(u'Si no está activo no puede ingresar al sistema.'), validator=validators.Bool(if_empty=1)), ]) +form.javascript.append(JSSource("MochiKit.DOM.focusOnLoad('form_usuario');")) class DocenteController(controllers.Controller, identity.SecureResource): """Basic model admin interface""" diff --git a/sercom/subcontrollers/docente/templates/edit.kid b/sercom/subcontrollers/docente/templates/edit.kid index 739cbfe..d5d3dcc 100644 --- a/sercom/subcontrollers/docente/templates/edit.kid +++ b/sercom/subcontrollers/docente/templates/edit.kid @@ -4,7 +4,6 @@ edit - diff --git a/sercom/subcontrollers/docente/templates/new.kid b/sercom/subcontrollers/docente/templates/new.kid index 5133fcc..c30f900 100644 --- a/sercom/subcontrollers/docente/templates/new.kid +++ b/sercom/subcontrollers/docente/templates/new.kid @@ -4,7 +4,6 @@ new - diff --git a/sercom/subcontrollers/enunciado/__init__.py b/sercom/subcontrollers/enunciado/__init__.py index 86bc1f8..9527e83 100644 --- a/sercom/subcontrollers/enunciado/__init__.py +++ b/sercom/subcontrollers/enunciado/__init__.py @@ -54,6 +54,7 @@ form = TableForm(fields=[ TextField(name='descripcion', label=_(u'Descripción'), validator=validators.UnicodeString(not_empty=False, max=255, strip=True)), ]) +form.javascript.append(JSSource("MochiKit.DOM.focusOnLoad('form_nombre');")) class EnunciadoController(controllers.Controller, identity.SecureResource): """Basic model admin interface""" diff --git a/sercom/subcontrollers/enunciado/templates/edit.kid b/sercom/subcontrollers/enunciado/templates/edit.kid index c9c6e4a..517e6f3 100644 --- a/sercom/subcontrollers/enunciado/templates/edit.kid +++ b/sercom/subcontrollers/enunciado/templates/edit.kid @@ -4,7 +4,6 @@ edit - diff --git a/sercom/subcontrollers/enunciado/templates/new.kid b/sercom/subcontrollers/enunciado/templates/new.kid index af1ff82..331105e 100644 --- a/sercom/subcontrollers/enunciado/templates/new.kid +++ b/sercom/subcontrollers/enunciado/templates/new.kid @@ -4,7 +4,6 @@ new - diff --git a/sercom/templates/login.kid b/sercom/templates/login.kid index 03c8478..0cf80a7 100644 --- a/sercom/templates/login.kid +++ b/sercom/templates/login.kid @@ -70,7 +70,6 @@ } -