-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add user registration and book management pages with layout templates
- Loading branch information
1 parent
c79c291
commit 758e419
Showing
10 changed files
with
212 additions
and
57 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
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,7 @@ | ||
from starlette.responses import RedirectResponse | ||
from starlette import status | ||
|
||
def redirect_to_login(): | ||
redirect_response = RedirectResponse(url="/v1/auth/login", status_code=status.HTTP_302_FOUND) | ||
redirect_response.delete_cookie(key="access_token") | ||
return redirect_response |
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{% include 'layoutBooks.html' %} | ||
|
||
<div class="container"> | ||
<div class="card text-center"> | ||
<div class="card-header"> | ||
Books in DataBase | ||
</div> | ||
<div class="card-body"> | ||
<h5 class="card-title"> | ||
List Books | ||
</h5> | ||
<p class="card-text"> | ||
Information regarding stuff that needs to be complete | ||
</p> | ||
<table class="table table-hover"> | ||
<thead> | ||
<tr> | ||
<th scope="col">#</th> | ||
<th scope="col">Info</th> | ||
<th scope="col">Actions</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for book in books %} | ||
{% if book.complete == False %} | ||
<tr class="pointer"> | ||
<td>{{loop.index}}</td> | ||
<td>{{book.title}}</td> | ||
<td> | ||
<button onclick="window.location.href='edit/book/{{book.id|}}'" | ||
type="button" class="btn btn-info"> | ||
Edit | ||
</button> | ||
</td> | ||
</tr> | ||
{% else %} | ||
<tr class="pointer alert alert-success"> | ||
<td>{{loop.index}}</td> | ||
<td class="strike-through-td">{{book.title}}</td> | ||
<td> | ||
<button onclick="window.location.href='edit/book/{{book.id|}}'" | ||
type="button" class="btn btn-info"> | ||
Edit | ||
</button> | ||
</td> | ||
</tr> | ||
{% endif %} | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
<a href="add/book" class="btn btn-primary">Add a new book</a> | ||
</div> | ||
</div> | ||
</div> |
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,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', path='/css/bootstrap.css') }}"> | ||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', path='/css/base.css') }}"> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Library</title> | ||
</head> | ||
<body> | ||
{% block content %} | ||
|
||
{% endblock %} | ||
<script src="{{ url_for('static', path='/js/jquery-slim.js') }}"></script> | ||
<script src="{{ url_for('static', path='/js/popper.js') }}"></script> | ||
<script src="{{ url_for('static', path='/js/bootstrap.js') }}"></script> | ||
<script src="{{ url_for('static', path='/js/base.js') }}" defer></script> | ||
</body> | ||
</html> |
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,15 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', path='/css/bootstrap.css') }}"> | ||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', path='/css/base.css') }}"> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Library -users</title> | ||
</head> | ||
<body> | ||
{% block content %} | ||
|
||
{% endblock %} | ||
</body> | ||
</html> |
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,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', path='/css/bootstrap.css') }}"> | ||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', path='/css/base.css') }}"> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Library</title> | ||
</head> | ||
<body> | ||
{% block content %} | ||
|
||
{% endblock %} | ||
<script src="{{ url_for('static', path='/js/jquery-slim.js') }}"></script> | ||
<script src="{{ url_for('static', path='/js/popper.js') }}"></script> | ||
<script src="{{ url_for('static', path='/js/bootstrap.js') }}"></script> | ||
<script src="{{ url_for('static', path='/js/base.js') }}" defer></script> | ||
</body> | ||
</html> |
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,39 +1,60 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', path='/css/bootstrap.css') }}"> | ||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', path='/css/base.css') }}"> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Register-Library</title> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div class="card"> | ||
<div class="card-header"> | ||
Register | ||
</div> | ||
<div class="card-body"> | ||
<form id="registerForm"> | ||
<div class="form-row"> | ||
<div class="form-group col-md-6"> | ||
<label>Email</label> | ||
<input type="text" class="form-control" name="email" required> | ||
</div> | ||
<div class="form-group col-md-6"> | ||
<label>Username</label> | ||
<input type="text" class="form-control" name="username" required> | ||
</div> | ||
</div> | ||
<div class="form-row"> | ||
<div class="form-group col-md-6"> | ||
<label>First Name</label> | ||
<input type="text" class="form-control" name="firstname" required> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
{% include 'layoutUser.html' %} | ||
|
||
<div class="container"> | ||
<div class="card"> | ||
<div class="card-header"> | ||
Register | ||
</div> | ||
<div class="card-body"> | ||
<form id="registerForm"> | ||
<div class="form-row"> | ||
<div class="form-group col-md-6"> | ||
<label>Email</label> | ||
<input type="text" class="form-control" name="email" required> | ||
</div> | ||
<div class="form-group col-md-6"> | ||
<label>Username</label> | ||
<input type="text" class="form-control" name="username" required> | ||
</div> | ||
</div> | ||
<div class="form-row"> | ||
<div class="form-group col-md-6"> | ||
<label>First Name</label> | ||
<input type="text" class="form-control" name="firstname" required> | ||
</div> | ||
</div> | ||
<div class="form-row"> | ||
<div class="form-group col-md-6"> | ||
<label>Last Name</label> | ||
<input type="text" class="form-control" name="lastname" required> | ||
</div> | ||
</div> | ||
<div class="form-row"> | ||
<div class="form-group col-md-6"> | ||
<label>Role</label> | ||
<input type="text" class="form-control" name="role" required> | ||
</div> | ||
</div> | ||
<div class="form-row"> | ||
<div class="form-group col-md-6"> | ||
<label>Phone Number</label> | ||
<input type="text" class="form-control" name="phone_number" autocomplete="phone_number" required> | ||
</div> | ||
</div> | ||
<div class="form-row"> | ||
<div class="form-group col-md-6"> | ||
<label>Password</label> | ||
<input type="password" class="form-control" name="password" autocomplete="new-password" required> | ||
</div> | ||
</div> | ||
<div class="form-row"> | ||
<div class="form-group col-md-6"> | ||
<label>Verify Password</label> | ||
<input type="password" class="form-control" name="passwordVerify" autocomplete="new-password" required> | ||
</div> | ||
</div> | ||
<button type="submit" class="btn btn-primary">Sign in</button> | ||
</form> | ||
</div> | ||
</div> | ||
</body> | ||
</html> | ||
</div> |