added focus to form input
Conflicts: mediagoblin/auth/views.py mediagoblin/plugins/openid/views.py
This commit is contained in:
parent
09ae2df4eb
commit
57e8be21bc
@ -62,7 +62,9 @@ def register(request):
|
|||||||
return render_to_response(
|
return render_to_response(
|
||||||
request,
|
request,
|
||||||
'mediagoblin/auth/register.html',
|
'mediagoblin/auth/register.html',
|
||||||
{'register_form': register_form})
|
{'register_form': register_form,
|
||||||
|
'focus': 'username',
|
||||||
|
'post_url': request.urlgen('mediagoblin.auth.register')})
|
||||||
|
|
||||||
|
|
||||||
def login(request):
|
def login(request):
|
||||||
@ -113,6 +115,8 @@ def login(request):
|
|||||||
{'login_form': login_form,
|
{'login_form': login_form,
|
||||||
'next': request.GET.get('next') or request.form.get('next'),
|
'next': request.GET.get('next') or request.form.get('next'),
|
||||||
'login_failed': login_failed,
|
'login_failed': login_failed,
|
||||||
|
'focus': 'username',
|
||||||
|
'post_url': request.urlgen('mediagoblin.auth.login'),
|
||||||
'allow_registration': mg_globals.app_config["allow_registration"]})
|
'allow_registration': mg_globals.app_config["allow_registration"]})
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
<input type="submit" value="{% trans %}Set password{% endtrans %}" class="button_form"/>
|
<input type="submit" value="{% trans %}Set password{% endtrans %}" class="button_form"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form><!-- Focus the field passed in with the focus arg-->
|
||||||
|
<script>$(document).ready(function(){$({{ focus }}).focus();});</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
@ -35,4 +35,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
<!-- Focus the field passed in with the focus arg-->
|
||||||
|
<script>$(document).ready(function(){$({{ focus }}).focus();});</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -59,4 +59,6 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
<!-- Focus the field passed in with the focus arg-->
|
||||||
|
<script>$(document).ready(function(){$({{ focus }}).focus();});</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -42,6 +42,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<!-- Focus the username field by default -->
|
<!-- Focus the field passed in with the focus arg-->
|
||||||
<script>$(document).ready(function(){$("#username").focus();});</script>
|
<script>$(document).ready(function(){$({{ focus }}).focus();});</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user