login.html 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. {# Django 1.7 Admin Login template here cos 1.6 template fails to work with floppyforms. #}
  2. {% extends "admin/base_site.html" %}
  3. {% load i18n admin_static %}
  4. {% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/login.css" %}" />{% endblock %}
  5. {% block bodyclass %}{{ block.super }} login{% endblock %}
  6. {% block nav-global %}{% endblock %}
  7. {% block content_title %}{% endblock %}
  8. {% block breadcrumbs %}{% endblock %}
  9. {% block content %}
  10. {% if form.errors and not form.non_field_errors %}
  11. <p class="errornote">
  12. {% if form.errors.items|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}
  13. </p>
  14. {% endif %}
  15. {% if form.non_field_errors %}
  16. {% for error in form.non_field_errors %}
  17. <p class="errornote">
  18. {{ error }}
  19. </p>
  20. {% endfor %}
  21. {% endif %}
  22. <div id="content-main">
  23. <form action="{{ app_path }}" method="post" id="login-form">{% csrf_token %}
  24. <div class="form-row">
  25. {{ form.username.errors }}
  26. {{ form.username.label_tag }} {{ form.username }}
  27. </div>
  28. <div class="form-row">
  29. {{ form.password.errors }}
  30. {{ form.password.label_tag }} {{ form.password }}
  31. <input type="hidden" name="next" value="{{ next }}" />
  32. </div>
  33. {% url 'admin_password_reset' as password_reset_url %}
  34. {% if password_reset_url %}
  35. <div class="password-reset-link">
  36. <a href="{{ password_reset_url }}">{% trans 'Forgotten your password or username?' %}</a>
  37. </div>
  38. {% endif %}
  39. <div class="submit-row">
  40. <label>&nbsp;</label><input type="submit" value="{% trans 'Log in' %}" />
  41. </div>
  42. </form>
  43. <script type="text/javascript">
  44. document.getElementById('id_username').focus()
  45. </script>
  46. </div>
  47. {% endblock %}