From: Guillaume Pellerin Date: Tue, 16 Apr 2013 12:41:19 +0000 (+0200) Subject: add form submit pressing enter for login and search X-Git-Tag: 1.4.5~24 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=298db12ced4174bb1978a0873b5b02a7cf90935b;p=telemeta.git add form submit pressing enter for login and search --- 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 %}