[PATCH 47/51] login: Focus the username field on load

Damien Lespiau damien.lespiau at intel.com
Tue Aug 25 04:23:36 AEST 2015


Wolfram wanted a small usability improvement that's easy to add: placing
the cursor automatically in the user name field when loading the login
page.

Suggested-by: Wolfram Sang <wsa at the-dreams.de>
Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
 patchwork/templates/patchwork/login.html | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/patchwork/templates/patchwork/login.html b/patchwork/templates/patchwork/login.html
index 2dfc2a7..1f000e7 100644
--- a/patchwork/templates/patchwork/login.html
+++ b/patchwork/templates/patchwork/login.html
@@ -3,6 +3,13 @@
 {% block title %}Login{% endblock %}
 {% block heading %}Login{% endblock %}
 
+{% block headers %}
+  <script type="text/javascript">
+    $(function() {
+        $('#id_username').focus()
+    });
+  </script>
+{% endblock %}
 
 {% block body %}
 <form method="post">
-- 
2.1.0



More information about the Patchwork mailing list