|
| 1 | +{% extends 'layouts/base-fullscreen.html' %} |
| 2 | +{% load i18n static admin_soft %} |
| 3 | + |
| 4 | +{% block content %} |
| 5 | + |
| 6 | + {% include 'includes/navigation-fullscreen.html' %} |
| 7 | + |
| 8 | + <main class="main-content mt-0"> |
| 9 | + <section> |
| 10 | + <div class="page-header min-vh-75"> |
| 11 | + <div class="container"> |
| 12 | + <div class="row"> |
| 13 | + <div class="col-xl-4 col-lg-5 col-md-6 d-flex flex-column mx-auto"> |
| 14 | + <div class="card card-plain mt-8"> |
| 15 | + <div class="card-header pb-0 text-left bg-transparent"> |
| 16 | + <h3 class="font-weight-bolder text-info text-gradient"> |
| 17 | + Sign IN |
| 18 | + </h3> |
| 19 | + <p class="mb-0"> |
| 20 | + {% if msg %} |
| 21 | + <span class="text-danger">{{ msg | safe }}</span> |
| 22 | + {% else %} |
| 23 | + <span>USER: test / Pass12__</span> |
| 24 | + <br /> |
| 25 | + <span>ADMIN: admin / Pass12__</span> |
| 26 | + {% endif %} |
| 27 | + </p> |
| 28 | + </div> |
| 29 | + <div class="card-body"> |
| 30 | + <form role="form" method="post" action="#"> |
| 31 | + {% if form.non_field_errors %} |
| 32 | + {% for error in form.non_field_errors %} |
| 33 | + <span class="text-danger">{{ error }}</span> |
| 34 | + {% endfor %} |
| 35 | + {% endif %} |
| 36 | + {% csrf_token %} |
| 37 | + {% for field in form %} |
| 38 | + <label for="{{ field.id_for_label }}">{{ field.label }}</label> |
| 39 | + <div class="mb-3"> |
| 40 | + {{field}} |
| 41 | + </div> |
| 42 | + {% endfor %} |
| 43 | + <p class=""> |
| 44 | + <a href="{% url 'password_reset' %}" class="text-primary">Forgot password</a> |
| 45 | + </p> |
| 46 | + |
| 47 | + <div class="text-center"> |
| 48 | + <button type="submit" class="btn bg-gradient-info w-100 mt-1 mb-0">Sign in</button> |
| 49 | + <p class="mt-4"> |
| 50 | + Don't have an account? |
| 51 | + <a href="{% url 'register' %}" class="text-primary">Register</a> |
| 52 | + </p> |
| 53 | + </div> |
| 54 | + |
| 55 | + </form> |
| 56 | + </div> |
| 57 | + </div> |
| 58 | + </div> |
| 59 | + <div class="col-md-6"> |
| 60 | + <div class="oblique position-absolute top-0 h-100 d-md-block d-none me-n8"> |
| 61 | + <div class="oblique-image bg-cover position-absolute fixed-top ms-auto h-100 z-index-0 ms-n6" style="background-image:url('{% static 'img/curved-images/curved6.jpg' %}')"></div> |
| 62 | + </div> |
| 63 | + </div> |
| 64 | + </div> |
| 65 | + </div> |
| 66 | + </div> |
| 67 | + </section> |
| 68 | + </main> |
| 69 | + |
| 70 | + {% include 'includes/footer-fullscreen.html' %} |
| 71 | + |
| 72 | +{% endblock content %} |
| 73 | + |
| 74 | +{% block extrascript %} |
| 75 | + <script type="application/javascript"> |
| 76 | + {% if form.username.errors %} |
| 77 | + notification.danger("{{ form.username.errors }}", 'top', 'right'); |
| 78 | + {% endif %} |
| 79 | + {% if form.password.errors %} |
| 80 | + notification.danger("{{ form.password.errors }}", 'top', 'right'); |
| 81 | + {% endif %} |
| 82 | + |
| 83 | + {% if user.is_authenticated %} |
| 84 | + var msg = "You are authenticated as {{ username }}, but are not authorized to " + |
| 85 | + "access this page.Would you like to login to a different account ?" |
| 86 | + notification.warning(msg, 'top', 'right'); |
| 87 | + {% endif %} |
| 88 | + |
| 89 | + {% if form.errors and not form.non_field_errors %} |
| 90 | + {% if form.errors.items|length == 1 %} |
| 91 | + notification.warning("{% trans "Please correct the error below." %}", 'top', 'right'); |
| 92 | + {% else %} |
| 93 | + notification.warning("{% trans "Please correct the errors below." %}", 'top', 'right'); |
| 94 | + {% endif %} |
| 95 | + {% endif %} |
| 96 | + |
| 97 | + {% if form.non_field_errors %} |
| 98 | + {% for error in form.non_field_errors %} |
| 99 | + notification.warning("{{ error|clean_text }}", 'top', 'right'); |
| 100 | + {% endfor %} |
| 101 | + {% endif %} |
| 102 | + </script> |
| 103 | +{% endblock %} |
0 commit comments