Added function to register new user

This commit is contained in:
2017-09-06 13:39:10 +07:00
parent 1ee4ca3730
commit ff67e487ce
4 changed files with 92 additions and 33 deletions

View File

@@ -1,32 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Login</title>
</head>
<body>
<form method="post">
<h2>Login</h2>
{% extends "base.html" %}
<label for="username">Username: </label>
<input type="text" name="username" value="" placeholder="Type your username">
{% block title %}Login{% endblock %}
<br>
{% block body %}
<form method="post">
<h2>Login</h2>
<label for="password">Password: </label>
<input type="password" name="password" value="" placeholder="Type your password">
<label for="username">Username: </label>
<input type="text" name="username" value="" placeholder="Type your username">
<!-- method -->
<input type="hidden" name="_method" value="put">
<br>
<!-- Token -->
<input type="hidden" name="_token" value="{{ token }}">
<label for="password">Password: </label>
<input type="password" name="password" value="" placeholder="Type your password">
<br>
<input type="hidden" name="_method" value="put">
<button type="submit" name="login">Login</button>
</form>
<input type="hidden" name="_token" value="{{ token }}">
<a href="/">-> Alternative route</a>
</body>
</html>
<br>
<button type="submit" name="login">Login</button>
</form>
{% endblock %}

View File

@@ -0,0 +1,30 @@
{% extends "base.html" %}
{% block title %}Registrasi{% endblock %}
{% block body %}
<form method="post">
<h2>Registrasi</h2>
<label for="full_name">Nama Lengkap: </label>
<input type="text" name="full_name" value="" placeholder="Type your name">
<br>
<label for="username">Username: </label>
<input type="text" name="username" value="" placeholder="Type your username">
<br>
<label for="password">Password: </label>
<input type="password" name="password" value="" placeholder="Type your password">
<input type="hidden" name="_method" value="post">
<input type="hidden" name="_token" value="{{ token }}">
<br>
<button type="submit">Registrasi</button>
</form>
{% endblock %}