1
+ {% extends 'registration/registerbase.html' %}
1
2
{% load static %}
2
- < html lang =" en " >
3
+ {% block pagetitle %}Login{% endblock %}
3
4
4
- < head >
5
- < meta charset ="UTF-8 ">
6
- < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
7
- < meta http-equiv ="X-UA-Compatible " content ="ie=edge ">
8
- < title >
9
- {% if user.is_authenticated %}
10
- You have already logged in
11
- {% else %}
12
- Company Name
13
- {% endif %}
14
- </ title >
15
- < link href ="https://fonts.googleapis.com/css?family=Karla:400,700&display=swap " rel ="stylesheet ">
16
- < link rel ="stylesheet " href ="https://cdn.materialdesignicons.com/4.8.95/css/materialdesignicons.min.css ">
17
- < link rel ="stylesheet " href ="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css ">
18
- < link rel ="stylesheet " href ="{% static 'login_styling/loginstyle.css' %} ">
19
- < link href ="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css " rel ="stylesheet ">
20
- < link rel ="shortcut icon " href ="{% static 'login_styling/favicon.svg' %} " type ="image/x-icon ">
21
- <!--Provide your company logo-->
22
- </ head >
23
-
24
- < body style ="overflow-y: hidden; ">
25
- < main >
26
- {% if user.is_authenticated %}
27
- < div class ="container ">
28
- < div class ="d-flex align-items-center justify-content-center align-self-center ">
29
- < div class ="card ">
30
- < div class ="card-header ">
31
- Featured
32
- </ div >
33
- < div class ="card-body ">
34
- < h5 class ="card-title "> Already Logged In</ h5 >
35
- < p class ="card-text "> You have already logged In.</ p >
36
- < a href ="# " class ="btn btn-primary "> Go to Dashboard</ a >
37
- </ div >
38
- </ div >
5
+ {% block content %}
6
+ {% if user.is_authenticated %}
7
+ < div class ="container ">
8
+ < div class ="d-flex align-items-center justify-content-center align-self-center ">
9
+ < div class ="card ">
10
+ < div class ="card-header ">
11
+ Featured
12
+ </ div >
13
+ < div class ="card-body ">
14
+ < h5 class ="card-title "> Already Logged In</ h5 >
15
+ < p class ="card-text "> You have already logged In.</ p >
16
+ < a href ="# " class ="btn btn-primary "> Go to Dashboard</ a >
39
17
</ div >
40
18
</ div >
41
- < script >
42
- setTimeout ( "location.href = '{% url 'home' %}';" , 0 ) ;
43
- </ script >
44
- {% else %}
45
- < div class ="container-fluid ">
46
- < div class ="row ">
47
- < div class ="col-sm-6 login-section-wrapper ">
48
- < div class ="brand-wrapper ">
49
- < img src ="https://www.bootstrapdash.com/demo/login-template-free-1/assets/images/logo.svg " alt ="logo " class ="logo ">
19
+ </ div >
20
+ </ div >
21
+ < script >
22
+ setTimeout ( "location.href = '{% url 'home' %}';" , 0 ) ;
23
+ </ script >
24
+ {% else %}
25
+ < div class ="container-fluid ">
26
+ < div class ="row ">
27
+ < div class ="col-sm-6 login-section-wrapper ">
28
+ < div class ="brand-wrapper ">
29
+ < img src ="https://www.bootstrapdash.com/demo/login-template-free-1/assets/images/logo.svg " alt ="logo " class ="logo ">
30
+ </ div >
31
+ < div class ="">
32
+ < h1 class ="login-title "> Log in</ h1 >
33
+ {% if form.errors %}
34
+ < div class ="alert alert-danger alert-dismissable fade show " role ="alert ">
35
+ < button type ="button " class ="close " data-dismiss ="alert " aria-label ="Close ">
36
+ < span aria-hidden ="true "> ×</ span >
37
+ </ button >
38
+ < p > Invalid Credentials. Retry again.</ p >
39
+ </ div >
40
+ {% endif %}
41
+ {% if messages %}
42
+ {% for message in messages %}
43
+ < div class ="alert {% if message.tags %} {{ message.tags }} {% endif %} alert-dismissable fade show " role ="alert ">
44
+ < button type ="button " class ="close " data-dismiss ="alert " aria-label ="Close ">
45
+ < span aria-hidden ="true "> ×</ span >
46
+ </ button >
47
+ < p > {{message}}</ p >
48
+ </ div >
49
+ {% endfor %}
50
+ {% endif %}
51
+ < form action ="{% url 'login' %} " method ="POST ">
52
+ {% csrf_token %}
53
+ < div class ="form-group ">
54
+ < label for ="username "> Username:</ label >
55
+ < input type ="username " name ="username " id ="username " class ="form-control " placeholder ="Enter your Username ">
56
+ </ div >
57
+ < div class ="form-group mb-4 ">
58
+ < label for ="password "> Password:</ label >
59
+ < input type ="password " name ="password " id ="password " class ="form-control " placeholder ="Enter your passsword ">
50
60
</ div >
51
- < div class ="">
52
- < h1 class ="login-title "> Log in</ h1 >
53
- {% if form.errors %}
54
- < div class ="alert alert-danger alert-dismissable fade show " role ="alert ">
55
- < button type ="button " class ="close " data-dismiss ="alert " aria-label ="Close ">
56
- < span aria-hidden ="true "> ×</ span >
57
- </ button >
58
- < p > Invalid Credentials. Retry again.</ p >
61
+ < button class ="btn btn-outline-primary btn-block btn-lg " type ="submit " name ="Login " id ="Login "> Log In</ button >
62
+ < div class ="row pt-3 ">
63
+ < div class ="col-sm-6 mb-3 mb-sm-0 ">
64
+ < a href ="{% url 'social:begin' 'google-oauth2' %} " class ="btn btn-outline-primary btn-block ">
65
+ < svg xmlns ="http://www.w3.org/2000/svg " width ="16 " height ="16 " fill ="currentColor " class ="bi bi-google " viewBox ="0 0 16 16 ">
66
+ < path d ="M15.545 6.558a9.42 9.42 0 0 1 .139 1.626c0 2.434-.87 4.492-2.384 5.885h.002C11.978 15.292 10.158 16 8 16A8 8 0 1 1 8 0a7.689 7.689 0 0 1 5.352 2.082l-2.284 2.284A4.347 4.347 0 0 0 8 3.166c-2.087 0-3.86 1.408-4.492 3.304a4.792 4.792 0 0 0 0 3.063h.003c.635 1.893 2.405 3.301 4.492 3.301 1.078 0 2.004-.276 2.722-.764h-.003a3.702 3.702 0 0 0 1.599-2.431H8v-3.08h7.545z "/>
67
+ </ svg >
68
+ Sign in With Google
69
+ </ a >
59
70
</ div >
60
- {% endif %}
61
- {% if messages %}
62
- {% for message in messages %}
63
- < div class ="alert {% if message.tags %} {{ message.tags }} {% endif %} alert-dismissable fade show " role ="alert ">
64
- < button type ="button " class ="close " data-dismiss ="alert " aria-label ="Close ">
65
- < span aria-hidden ="true "> ×</ span >
66
- </ button >
67
- < p > {{message}}</ p >
71
+ < div class ="col-sm-6 mb-3 mb-sm-0 ">
72
+ < a href ="{% url 'social:begin' 'github' %} " class ="btn btn-outline-dark btn-block ">
73
+ < svg xmlns ="http://www.w3.org/2000/svg " width ="16 " height ="16 " fill ="currentColor " class ="bi bi-github " viewBox ="0 0 16 16 ">
74
+ < path d ="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z "/>
75
+ </ svg >
76
+ Sign in with Github
77
+ </ a >
68
78
</ div >
69
- {% endfor %}
70
- {% endif %}
71
- < form action ="{% url 'login' %} " method ="POST ">
72
- {% csrf_token %}
73
- < div class ="form-group ">
74
- < label for ="username "> Username:</ label >
75
- < input type ="username " name ="username " id ="username " class ="form-control " placeholder ="Enter your Username ">
76
- </ div >
77
- < div class ="form-group mb-4 ">
78
- < label for ="password "> Password:</ label >
79
- < input type ="password " name ="password " id ="password " class ="form-control " placeholder ="Enter your passsword ">
80
- </ div >
81
- < button class ="btn btn-outline-primary btn-block btn-lg " type ="submit " name ="Login " id ="Login "> Log In</ button >
82
- </ form >
83
- < a href ="{% url 'password_reset' %} " class ="forgot-password-link "> Forgot password?</ a >
84
- < p class ="login-wrapper-footer-text "> Don't have an account? < a href ="{% url 'sign_up' %} " class ="text-reset "> Register here</ a > </ p >
85
79
</ div >
86
- </ div >
87
- < div class ="col-sm-6 px-0 d-none d-sm-block ">
88
- < img src ="https://www.bootstrapdash.com/demo/login-template-free-1/assets/images/login.jpg " alt ="login image " class ="login-img ">
89
- </ div >
80
+ </ form >
81
+ < a href ="{% url 'password_reset' %} " class ="forgot-password-link "> Forgot password?</ a >
82
+ < p class ="login-wrapper-footer-text "> Don't have an account? < a href ="{% url 'sign_up' %} " class ="text-reset "> Register here</ a > </ p >
90
83
</ div >
91
84
</ div >
92
- {% endif %}
93
- </ main >
94
- < script src ="https://code.jquery.com/jquery-3.4.1.min.js "> </ script >
95
- < script src ="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js "> </ script >
96
- < script src ="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js "> </ script >
97
- </ body >
98
-
99
- </ html >
85
+ < div class ="col-sm-6 px-0 d-none d-sm-block ">
86
+ < img src ="https://www.bootstrapdash.com/demo/login-template-free-1/assets/images/login.jpg " alt ="login image " class ="login-img ">
87
+ </ div >
88
+ </ div >
89
+ </ div >
90
+ {% endif %}
91
+ {% endblock %}
0 commit comments