Ticket #17082: ticket17082.diff

File ticket17082.diff, 1.0 KB (added by David Evans, 13 years ago)
  • django/contrib/admin/templates/admin/login.html

    diff --git a/django/contrib/admin/templates/admin/login.html b/django/contrib/admin/templates/admin/login.html
    index dbaa119..c39c158 100644
    a b  
    3030<form action="{{ app_path }}" method="post" id="login-form">{% csrf_token %}
    3131  <div class="form-row">
    3232    {% if not form.this_is_the_login_form.errors %}{{ form.username.errors }}{% endif %}
    33     <label for="id_username" class="required">{% trans 'Username:' %}</label> {{ form.username }}
     33    <label for="id_username" class="required" autofocus>{% trans 'Username:' %}</label> {{ form.username }}
    3434  </div>
    3535  <div class="form-row">
    3636    {% if not form.this_is_the_login_form.errors %}{{ form.password.errors }}{% endif %}
     
    4444</form>
    4545
    4646<script type="text/javascript">
    47 document.getElementById('id_username').focus()
     47if (!('autofocus' in document.createElement('input'))) {
     48    document.getElementById('id_username').focus();
     49}
    4850</script>
    4951</div>
    5052{% endblock %}
Back to Top