aboutsummaryrefslogtreecommitdiffstats
path: root/templates/registration/login.html
blob: c9b5362df4041391e84dabc2d286ae57c72bc192 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
{% extends 'registration/base_simple.html' %}
{% load static %}
{% block style %}
  body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
  }

  main {
    flex: 1 0 auto;
  }
{% endblock %}

{% block title %}Login{% endblock %}

{% block content %}
  <div style="margin-top: 50px" class="row">
    <div class="col l4 offset-l4 m8 offset-m2 s12">
      <div class="card">
        <div class="card-content">
          <form method="post">
            {% csrf_token %}
            <div class="row">
              <div class="input-field col s12">
                <label for="id_username">Nome utente</label>
                {{ form.username }}
              </div>
            </div>
            <div class="row">
              <div class="input-field col s12">
                <label for="id_password">Password</label>
                {{ form.password }}
              </div>
            </div>
            <br>
            <a href={% url 'password_reset' %}>Password dimenticata</a>
            <br>
            <br>
            <button class="btn waves-effect waves-light {{color}}" type="submit">Login</button>
            <br><br><hr><br>
            {% if midata_enabled %}
              <div class="row">
                <div class="col s12">
                  <a href="{% url 'oauth_login' %}?next={{ request.GET.next }}" style="width: 100%; background-color: #99BF62" class="btn waves-effect waves-light">
                    <div class="row">
                      <div class="col s2">
                        <img style="height: 30px; padding-top: 3px" src="{% static 'pbs_logo.svg' %}" alt="PBS Logo">
                      </div>
                      <div class="col s10">
                        Login con MiData
                      </div>
                    </div>
                  </a>
                </div>
              </div>
            {% endif %}
            <div class="row">
              <div class="col s12">
                <a href={% url 'signup' %} style="width: 100%" class="btn waves-effect waves-light {{color}}">
                  Registrazione
                </a>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
{% endblock %}
{% block script %}
document.addEventListener('DOMContentLoaded', function() {
  {% for field, errors in form.errors.items %}
    {% for error in errors %}
      M.toast({html: '{{ error }}', classes: 'orange'})
    {% endfor %}
  {% endfor %}
});
{% endblock %}
{% block footer %}
  <footer class="page-footer {{color}}">
    <div class="container">
    </div>
    <div class="footer-copyright">
      <div class="container">
      <a class="grey-text text-lighten-4 right" href="{% url 'about' %}">© 2020-22 Andrea Lepori</a>
      </div>
    </div>
  </footer>
{% endblock %}