Commit ed355c41 authored by gab's avatar gab

added frontend to log in form

parent 71609e47
...@@ -14,6 +14,8 @@ class CustomUserAuthenticationForm(AuthenticationForm): ...@@ -14,6 +14,8 @@ class CustomUserAuthenticationForm(AuthenticationForm):
self.fields['email'].required = True self.fields['email'].required = True
self.fields.pop('username') self.fields.pop('username')
self.order_fields(['email', 'password']) self.order_fields(['email', 'password'])
for visible in self.visible_fields():
visible.field.widget.attrs['class'] = 'form-control'
# Registering a User Form # Registering a User Form
class CustomUserCreationForm(UserCreationForm): class CustomUserCreationForm(UserCreationForm):
......
{% extends "base.html" %} {% extends "base.html" %}
{% block head %} {% block head %}
<script src="https://accounts.google.com/gsi/client" async></script> <script src="https://accounts.google.com/gsi/client" async defer></script>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<form method="POST" autocomplete="off"> <div id="login-form" class="mx-auto px-3 py-4 bg-white" style="width: 23rem;">
<p class="h1">Log in</p>
<form method="POST" autocomplete="off">
{% csrf_token %} {% csrf_token %}
{{ loginform.as_p }} <div class="form-group">
<input type="submit" value="Log In"/> <label class="h5" for="email">Email</label>
{{ loginform.email }}
</div>
<div class="form-group">
<label class="h5" for="password">Password</label>
{{ loginform.password }}
</div>
<input class="btn-red login-btn" type="submit" value="Log In"/>
<a href="{% url 'accounts:register' %}"><input class="btn-red login-btn" type="button" value="Register"/></a>
<div id="g_id_onload" <div id="g_id_onload"
data-client_id="1091426130026-resqtjvbfu1mguphrr5seg6d31k1ttqf.apps.googleusercontent.com" data-client_id="1091426130026-resqtjvbfu1mguphrr5seg6d31k1ttqf.apps.googleusercontent.com"
data-context="signin" data-context="signin"
data-ux_mode="redirect" data-ux_mode="redirect"
data-login_uri="http://localhost:8000/accounts/auth-receiver" data-login_uri="http://localhost:8000/accounts/auth-receiver"
data-itp_support="true"> data-auto_prompt="false">
</div> </div>
<div class="g_id_signin" <div class="login-btn g_id_signin"
data-type="standard" data-type="standard"
data-shape="pill" data-shape="rectangle"
data-theme="filled_black" data-theme="filled_blue"
data-text="signin_with" data-text="continue_with"
data-size="large" data-size="large"
data-logo_alignment="left"> data-logo_alignment="left">
</div> </div>
</form> </form>
</div>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -2,32 +2,96 @@ ...@@ -2,32 +2,96 @@
:root { :root {
--theme-prusian-blue: #003049; --theme-prusian-blue: #003049;
--theme-bright-red: #D62828; --theme-bright-red: #D62727;
--theme-orange: #F77F00; --theme-orange: #F77F00;
--theme-yellow-red: #FCBF49; --theme-yellow-red: #FCBF49;
--theme-dutch-white: #EAE2B7; --theme-dutch-white: #EAE2B7;
} }
body { * {
font-family: "Inter"; font-family: "Inter";
font-size: 1rem;
}
body {
background-color: var(--theme-dutch-white); background-color: var(--theme-dutch-white);
/* background-image: url("/static/images/Continuous Background.png"); */ background-image: url("/static/images/Continuous Background.png");
background-position: left top; background-position: left top;
background-repeat: repeat-y; background-repeat: repeat-y;
background-size: 80%; background-size: 80%;
} }
.btn-red {
transition: all 0.3s ease-in;
font-size: 1.5vw;
background-color: var(--theme-bright-red);
color: #fff;
border-color: var(--theme-bright-red);
white-space:nowrap;
}
.btn-red:hover {
transition: all 0.3s ease-in;
font-size: 1.55vw;
background-color: var(--theme-prusian-blue);
color: #fff;
border-color: var(--theme-prusian-blue);
}
.nav-link { .nav-link {
color: var(--theme-orange); transition: all 0.3s ease-in;
color: var(--theme-bright-red) !important;
font-size: 1.5vw; font-size: 1.5vw;
} }
.col-form-label {
font-family:Verdana, sans-serif; .nav-link:hover {
font-size: 2vw; transition: all 0.3s ease-in;
font-size: 1.55vw;
color: var(--theme-prusian-blue) !important;
text-decoration: underline;
} }
#trial { #trial {
align-items: center; align-items: center;
background-color: white; background-color: white;
} }
#featured-events-div {
margin-top: 7.5rem;
height: 100vh;
}
#login-form {
/* Really Bad Code Start */
margin: 0;
position: absolute;
top: 50%;
left: 50%;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
/* Really Bad Code End */
border-radius: 0.625rem;
border: 1px solid #000;
background: #FFF;
box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
}
.form-group > label {
margin-top: 1.19rem;
}
.form-group > input:not([type="submit"]) {
border-radius: 0.625rem !important;
border: 1px solid #000 !important;
background: #FFF !important;
}
.login-btn {
margin-top: 1.62rem;
width: 100%;
border-radius: 0.3125rem;
background: #DF4E4E;
border-color: #DF4E4E;
}
\ No newline at end of file
...@@ -6,37 +6,44 @@ ...@@ -6,37 +6,44 @@
{% bootstrap_css %} {% bootstrap_css %}
{% bootstrap_javascript %} {% bootstrap_javascript %}
{% bootstrap_messages %} {% bootstrap_messages %}
{% block head %}
{% endblock %}
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="{% static '/css/custom.css' %}"> <link rel="stylesheet" type="text/css" href="{% static '/css/custom.css' %}">
<link rel="icon" type="image/x-icon" href="static/images/Logo.png"> <link rel="icon" type="image/x-icon" href="static/images/Logo.png">
<title>{% block title %}Red Brick Board{% endblock %}</title> <title>{% block title %}Red Brick Board{% endblock %}</title>
{% block head %}
{% endblock %}
</head> </head>
<body> <body>
<main> <nav class="px-5 navbar navbar-expand navbar-light bg-light">
<nav class="navbar navbar-expand-md navbar-light bg-light"> <div class="container-fluid justify-content-end">
<div class="container-fluid"> <a class="navbar-brand" href="/">
<a class="navbar-brand" href="#"> <img src="{% static '/images/Logo with Name.png' %}" alt="Red Brick Board" style="width:30%; height:auto;">
<img src="{% static '/images/Logo with Name.png' %}" alt="Red Brick Board" style="width:30%; height:auto; padding-left:10%;">
</a> </a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation"> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>
</button> </button>
<div class="collapse navbar-collapse justify-content-end align-center" id="navbarNavAltMarkup"> <div class="collapse navbar-collapse justify-content-end" id="navbarNav">
<div class="navbar-nav"> <div class="navbar-nav d-flex">
<a class="nav-link" href="#">Event Catalog</a> <a class="nav-link" href="/eventcatalog" style="margin-right: 2.94rem;">Event Catalog</a>
</div>
{% comment %} <form class="container-fluid justify-content-start"> {% if user.is_authenticated %}
<button class="btn" type="button" >Log Out</button> <form role="Log Out" action="{% url 'accounts:logout' %}" method="post">
</form> {% endcomment %} {% csrf_token %}
<button class="btn btn-red" type="submit">Log Out</button>
</form>
{% else %}
<form role="Log In" action="{% url 'accounts:login' %}" method="post">
{% csrf_token %}
<button class="btn btn-red" type="submit">Log In</button>
</form>
{% endif %}
</div> </div>
</div> </div>
</nav> </nav>
{% block content %} {% block content %}
{% endblock %} {% endblock %}
</main>
</body> </body>
</html> </html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment