login.html 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. {% extends "admin/base_site.html" %}
  2. {% load i18n admin_static %}
  3. {% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/login.css" %}" />{% endblock %}
  4. {% block bodyclass %}login{% endblock %}
  5. {% block nav-global %}{% endblock %}
  6. {% block content_title %}{% endblock %}
  7. {% block breadcrumbs %}{% endblock %}
  8. {% block content %}
  9. {% if form.errors and not form.non_field_errors and not form.this_is_the_login_form.errors %}
  10. <p class="errornote">
  11. {% if form.errors.items|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}
  12. </p>
  13. {% endif %}
  14. {% if form.non_field_errors or form.this_is_the_login_form.errors %}
  15. {% for error in form.non_field_errors|add:form.this_is_the_login_form.errors %}
  16. <p class="errornote">
  17. {{ error }}
  18. </p>
  19. {% endfor %}
  20. {% endif %}
  21. <div id="content-main">
  22. <form action="{{ app_path }}" method="post" id="login-form">{% csrf_token %}
  23. <div class="form-row">
  24. {% if not form.this_is_the_login_form.errors %}{{ form.username.errors }}{% endif %}
  25. <label for="id_username" class="required">{{ form.username.label }}:</label> {{ form.username }}
  26. </div>
  27. <div class="form-row">
  28. {% if not form.this_is_the_login_form.errors %}{{ form.password.errors }}{% endif %}
  29. <label for="id_password" class="required">{% trans 'Password:' %}</label> {{ form.password }}
  30. <input type="hidden" name="this_is_the_login_form" value="1" />
  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 %}