-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #184 from TheSecretOrganization/148-redesign-login…
…-page 148 redesign login page
- Loading branch information
Showing
5 changed files
with
168 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,91 @@ | ||
{% extends "./extends/base.html" %} | ||
|
||
{% block content %} | ||
<h1>Login</h1> | ||
|
||
<form id="login-form" data-url="/api/auth/login/"> | ||
<div id="login-error"></div> | ||
{% csrf_token %} | ||
<div> | ||
<label for="username">Username</label> | ||
<input id="username" type="text" autocomplete="username" /> | ||
</div> | ||
<div> | ||
<label for="password">Password</label> | ||
<input id="password" type="password" /> | ||
</div> | ||
<button id="form-btn">Login</button> | ||
</form> | ||
|
||
<h2>Or</h2> | ||
<div id="register-side"> | ||
<h1>Bottom text</h1> | ||
</div> | ||
<div id="login-side" class="container"> | ||
<div class="column"> | ||
<form id="login-form" data-url="/api/auth/login/"> | ||
<div class="row"> | ||
<h1 class="text-center">Login</h1> | ||
</div> | ||
<div id="login-error"></div> | ||
{% csrf_token %} | ||
<div class="form-floating mb-3 row"> | ||
<input type="text" class="form-control" id="username" placeholder="Username" autocomplete="username"> | ||
<label for="username">Username</label> | ||
</div> | ||
|
||
<div class="form-floating mb-3 row"> | ||
<input type="password" class="form-control" id="password" placeholder="Password"> | ||
<label for="password">Password</label> | ||
</div> | ||
|
||
<div> | ||
<a href="{{ oauth_url }}">Login with 42</a> | ||
<button id="login-btn" type="submit" class="btn btn-success row w-100 m-0">Login</button> | ||
</form> | ||
<hr class="row border-bottom border-1 border-dark my-2"> | ||
</hr> | ||
<div class="row"> | ||
<p class="fw-light" style="margin-bottom: 0px;">Don't have an account yet ? Try <a data-route | ||
href="/register" class="text-decoration-none text-success">registering</a></p> | ||
</div> | ||
<div class="row"> | ||
<p class="fw-light text-center">or | ||
<a id="login-42-btn" class="btn btn-sm rounded-pill rounded-5 text-decoration-none" | ||
href="{{ oauth_url }}">Login with <img class="image-text" src="/assets/42.svg" alt="42 logo"></a> | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<script> | ||
document.getElementById('form-btn').onclick = function(e) { | ||
document.getElementById('login-btn').onclick = function (e) { | ||
document.getElementById('login-error').textContent = ''; | ||
e.preventDefault(); | ||
submitForm('login-form', () => route('/'), (json) => { | ||
document.getElementById('login-error').textContent = json.error; | ||
}); | ||
}; | ||
</script> | ||
{% endblock %} | ||
|
||
<style> | ||
#page-container-wrapper { | ||
display: flex; | ||
height: calc(100vh - 67.5px); | ||
} | ||
|
||
#register-side, | ||
#login-side { | ||
flex: 1; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
|
||
#register-side { | ||
background-color: #e0e0e0; | ||
} | ||
|
||
#login-side { | ||
background-color: #f5f5f5; | ||
display: flex; | ||
flex-direction: column; | ||
padding: 0; | ||
} | ||
|
||
.image-text { | ||
height: 1rem; | ||
width: 1rem; | ||
} | ||
|
||
#login-42-btn { | ||
background-color: #dfbac8; | ||
padding-top: 2px; | ||
padding-bottom: 2px; | ||
padding-left: 4px; | ||
padding-right: 4px; | ||
} | ||
</style> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters