-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e6a9dd4
commit 2679ed7
Showing
4 changed files
with
32 additions
and
8 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
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,24 +1,24 @@ | ||
{% extends 'base.html' %} | ||
{% block title %} | ||
Register | ||
Login | ||
{% endblock %} | ||
{% block body %} | ||
<div class="row justify-content-center text-center"> | ||
<h1>Register</h1> | ||
<h1>Login</h1> | ||
</div> | ||
<form class="form p-3"> | ||
<label class="label" for="username">Username:</label> | ||
<input id="username" class="form-control" required> | ||
<label class="label" for="password">Password:</label> | ||
<input id="password" class="form-control" type="password" required> | ||
<button class="btn btn-primary" type="button" onclick="register()">Register</button> | ||
<button class="btn btn-primary" type="button" onclick="register()">Login</button> | ||
</form> | ||
<script> | ||
function register() { | ||
$.post("/register-api/", {"username": $("#username").val(), "password": $("#password").val()}).then(function () { | ||
$.post("/login-api/", {"username": $("#username").val(), "password": $("#password").val()}).then(function () { | ||
window.location.href = "/" | ||
}); | ||
} | ||
</script> | ||
{% endblock %} | ||
{% block navid %}register{% endblock %} | ||
{% block navid %}login{% 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{% extends 'base.html' %} | ||
{% block title %} | ||
Register | ||
{% endblock %} | ||
{% block body %} | ||
<div class="row justify-content-center text-center"> | ||
<h1>Register</h1> | ||
</div> | ||
<form class="form p-3"> | ||
<label class="label" for="username">Username:</label> | ||
<input id="username" class="form-control" required> | ||
<label class="label" for="password">Password:</label> | ||
<input id="password" class="form-control" type="password" required> | ||
<button class="btn btn-primary" type="button" onclick="register()">Register</button> | ||
</form> | ||
<script> | ||
function register() { | ||
$.post("/register-api/", {"username": $("#username").val(), "password": $("#password").val()}).then(function () { | ||
window.location.href = "/" | ||
}); | ||
} | ||
</script> | ||
{% endblock %} | ||
{% block navid %}register{% 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