From 298db12ced4174bb1978a0873b5b02a7cf90935b Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 16 Apr 2013 14:41:19 +0200 Subject: [PATCH] add form submit pressing enter for login and search --- telemeta/templates/telemeta/login.html | 12 ++++++++++-- telemeta/templates/telemeta/search_criteria.html | 8 ++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/telemeta/templates/telemeta/login.html b/telemeta/templates/telemeta/login.html index 8b1b776f..c5819b39 100644 --- a/telemeta/templates/telemeta/login.html +++ b/telemeta/templates/telemeta/login.html @@ -6,6 +6,15 @@ {% endblock %} {% block content %} + {% if form.errors %}

{% trans "Your username and password didn't match. Please try again." %}

{% endif %} @@ -16,8 +25,7 @@ {{ form.password.label_tag }} {{ form.password }}

-{% trans "Sign in" %} +{% trans "Sign in" %} {% trans "Password forgotten" %} ? diff --git a/telemeta/templates/telemeta/search_criteria.html b/telemeta/templates/telemeta/search_criteria.html index 425de75e..41fbe26a 100644 --- a/telemeta/templates/telemeta/search_criteria.html +++ b/telemeta/templates/telemeta/search_criteria.html @@ -48,6 +48,14 @@ $(document).ready(function () { }); }); +$(document).ready(function() { + $(this).keydown(function(e) { + if (e.keyCode == '13') { + $("#searchform").submit(); + } + }); +}); + {% endblock %} -- 2.39.5