{% extends "control/admin/base.html" %}

{% block bodyclass %}login{% endblock %}

{% block page-header %}
  <h2>SHIELD Control Panel</h2>
{% endblock %}

{% block content %}
  {% if form.errors and not form.non_field_errors %}
    <p class="errornote">Please correct the errors below.</p>
  {% endif %}

  {% if form.non_field_errors %}
    {% for error in form.non_field_errors %}
      <p class="errornote">{{ error }}</p>
    {% endfor %}
  {% endif %}

  <form action="{{ app_path }}" method="post" id="login-form">{% csrf_token %}
    <div class="row">
      <div class="fluid-8">
        {{ form.username.errors }}
        {{ form.username.label_tag }} <div class="input-with-icon user">{{ form.username }}</div>
      </div>
    </div>
    <div class="row">
      <div class="fluid-8">
        {{ form.password.errors }}
        {{ form.password.label_tag }} <div class="input-with-icon key">{{ form.password }}</div>
        <input type="hidden" name="next" value="{{ next|default:"/control" }}" />
      </div>
    </div>
    <div class="row">
      <label>&nbsp;</label><input type="submit" class="button" value="Log in" />
    </div>
  </form>

  <script type="text/javascript">
    document.getElementById('id_username').focus()
  </script>
{% endblock %}

{% extends "control/admin/base.html" %}

{% block bodyclass %}login{% endblock %}

{% block page-header %}
  <h2>SHIELD Control Panel</h2>
{% endblock %}

{% block content %}
  {% if form.errors and not form.non_field_errors %}
    <p class="errornote">Please correct the errors below.</p>
  {% endif %}

  {% if form.non_field_errors %}
    {% for error in form.non_field_errors %}
      <p class="errornote">{{ error }}</p>
    {% endfor %}
  {% endif %}

  <form action="{{ app_path }}" method="post" id="login-form">{% csrf_token %}
    <div class="row">
      <div class="fluid-8">
        {{ form.username.errors }}
        {{ form.username.label_tag }}
        <div class="input-with-icon user">
          <input id="id_username" maxlength="254" name="username" type="text" autofocus>
        </div>
      </div>
    </div>
    <div class="row">
      <div class="fluid-8">
        {{ form.password.errors }}
        {{ form.password.label_tag }}
        <div class="input-with-icon key">
          <input id="id_password" name="password" type="password">
        </div>
        <input type="hidden" name="next" value="{{ next|default:"/control" }}" />
      </div>
    </div>
    <div class="row">
      <label>&nbsp;</label><input type="submit" class="button" value="Log in" />
    </div>
  </form>
{% endblock %}

Add autofocus attribute to username field
Add autofocus attribute to username field
