aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodney Ewing <ewing.rj@gmail.com>2013-05-23 13:22:13 -0700
committerRodney Ewing <ewing.rj@gmail.com>2013-05-24 16:52:50 -0700
commit57e8be21bcd832a36fbc8feac03dba941ef4d370 (patch)
treed140660684ebafb06640dab3cdede49d5a00e330
parent09ae2df4eb6b7384403beb323d757fd0f6a81eba (diff)
downloadmediagoblin-57e8be21bcd832a36fbc8feac03dba941ef4d370.tar.lz
mediagoblin-57e8be21bcd832a36fbc8feac03dba941ef4d370.tar.xz
mediagoblin-57e8be21bcd832a36fbc8feac03dba941ef4d370.zip
added focus to form input
Conflicts: mediagoblin/auth/views.py mediagoblin/plugins/openid/views.py
-rw-r--r--mediagoblin/auth/views.py6
-rw-r--r--mediagoblin/templates/mediagoblin/auth/change_fp.html3
-rw-r--r--mediagoblin/templates/mediagoblin/auth/forgot_password.html2
-rw-r--r--mediagoblin/templates/mediagoblin/auth/login.html2
-rw-r--r--mediagoblin/templates/mediagoblin/auth/register.html4
5 files changed, 13 insertions, 4 deletions
diff --git a/mediagoblin/auth/views.py b/mediagoblin/auth/views.py
index f6d4d4d1..5a360bd0 100644
--- a/mediagoblin/auth/views.py
+++ b/mediagoblin/auth/views.py
@@ -62,7 +62,9 @@ def register(request):
return render_to_response(
request,
'mediagoblin/auth/register.html',
- {'register_form': register_form})
+ {'register_form': register_form,
+ 'focus': 'username',
+ 'post_url': request.urlgen('mediagoblin.auth.register')})
def login(request):
@@ -113,6 +115,8 @@ def login(request):
{'login_form': login_form,
'next': request.GET.get('next') or request.form.get('next'),
'login_failed': login_failed,
+ 'focus': 'username',
+ 'post_url': request.urlgen('mediagoblin.auth.login'),
'allow_registration': mg_globals.app_config["allow_registration"]})
diff --git a/mediagoblin/templates/mediagoblin/auth/change_fp.html b/mediagoblin/templates/mediagoblin/auth/change_fp.html
index 1f7d9aca..afffeadd 100644
--- a/mediagoblin/templates/mediagoblin/auth/change_fp.html
+++ b/mediagoblin/templates/mediagoblin/auth/change_fp.html
@@ -39,6 +39,7 @@
<input type="submit" value="{% trans %}Set password{% endtrans %}" class="button_form"/>
</div>
</div>
- </form>
+</form><!-- Focus the field passed in with the focus arg-->
+<script>$(document).ready(function(){$({{ focus }}).focus();});</script>
{% endblock %}
diff --git a/mediagoblin/templates/mediagoblin/auth/forgot_password.html b/mediagoblin/templates/mediagoblin/auth/forgot_password.html
index 98cd9a06..6a74e2a2 100644
--- a/mediagoblin/templates/mediagoblin/auth/forgot_password.html
+++ b/mediagoblin/templates/mediagoblin/auth/forgot_password.html
@@ -35,4 +35,6 @@
</div>
</div>
</form>
+<!-- Focus the field passed in with the focus arg-->
+<script>$(document).ready(function(){$({{ focus }}).focus();});</script>
{% endblock %}
diff --git a/mediagoblin/templates/mediagoblin/auth/login.html b/mediagoblin/templates/mediagoblin/auth/login.html
index 4a39059d..6ec5d343 100644
--- a/mediagoblin/templates/mediagoblin/auth/login.html
+++ b/mediagoblin/templates/mediagoblin/auth/login.html
@@ -59,4 +59,6 @@
{% endif %}
</div>
</form>
+<!-- Focus the field passed in with the focus arg-->
+<script>$(document).ready(function(){$({{ focus }}).focus();});</script>
{% endblock %}
diff --git a/mediagoblin/templates/mediagoblin/auth/register.html b/mediagoblin/templates/mediagoblin/auth/register.html
index 6dff0207..755d5418 100644
--- a/mediagoblin/templates/mediagoblin/auth/register.html
+++ b/mediagoblin/templates/mediagoblin/auth/register.html
@@ -42,6 +42,6 @@
</div>
</div>
</form>
-<!-- Focus the username field by default -->
-<script>$(document).ready(function(){$("#username").focus();});</script>
+<!-- Focus the field passed in with the focus arg-->
+<script>$(document).ready(function(){$({{ focus }}).focus();});</script>
{% endblock %}