Started using Bootstrap for styling, moved app factory, added tests, started work on login and registration templates, and more

This commit is contained in:
2024-05-05 16:15:55 -04:00
parent 5d9ffffb79
commit 4503603915
19 changed files with 327 additions and 86 deletions

View File

@@ -1,10 +1,21 @@
{% extends "base.html" %}
{% set title %}Account Login{% endset %}
{% set title %}Login{% endset %}
{% block content %}
Login here
---------------
Soon to come ;)
<h1 class="text-center h1">Login</h1>
<hr>
<form>
<div class="mb-3">
<label for="login-email" class="form-label">Email address</label>
<input type="email" class="form-control" id="login-email" placeholder="example@email.com">
</div>
<div class="mb-3">
<label for="login-password" class="form-label">Password</label>
<input type="password" class="form-control" id="login-password">
</div>
</form>
{% endblock %}

View File

@@ -3,8 +3,42 @@
{% set title %}Account Registration{% endset %}
{% block content %}
Register for an account
-----------------------
Soon to come ;)
<h1 class="text-center h1">Register for an account</h1>
<hr>
<form>
<div class="row">
<div class="col mb-3">
<label for="user-first-name" class="form-label">First Name</label>
<input type="text" class="form-control" id="user-first-name" placeholder="John">
</div>
<div class="col mb-3">
<label for="user-last-name" class="form-label">Last Name</label>
<input type="text" class="form-control" id="user-last-name" placeholder="Doe">
</div>
</div>
<div class="row">
<div class="col mb-3">
<label for="user-email" class="form-label">Email address</label>
<input type="email" class="form-control" id="user-email" placeholder="example@email.com">
</div>
</div>
<div class="row">
<div class="col mb-3">
<label for="user-password" class="form-label">Password</label>
<input type="password" class="form-control" id="user-password">
</div>
</div>
<div class="row">
<div class="col mb-3">
<label for="user-password-confirm" class="form-label">Confirm Password</label>
<input type="password" class="form-control" id="user-password-confirm">
</div>
</div>
<div class="row">
<button type="submit" class="row btn btn-primary">Submit</button>
</div>
</form>
{% endblock %}

View File

@@ -1,19 +1,16 @@
{% extends 'base.html' %}
{% set title %}{{ user.username }} - Dashboard{% endset %}
{% set title %}{{ user.username }} - Account Dashboard{% endset %}
{% block content %}
<h1>Account Overview<h1>
<h1 class="text-center h1">Account Dashboard</h1>
<hr>
<h3>Pets</h3>
{% include 'users/dashboard/pets_overview.html' %}
{% include 'users/dashboard/dogs_overview.html' %}
<hr>
<h3>Booking History</h3>
{% include 'users/dashboard/visits_overview.html' %}
{% endblock %}

View File

@@ -0,0 +1,27 @@
<div class="table-responsive">
<table class="table table-sm table-responsive table-striped">
<thead>
<tr>
<th scope="colgroup" colspan="4" class="text-center h3">Dogs overview</th>
</tr>
<tr>
<th scope="col">Name</th>
<th scope="col">Breed size</th>
<th scope="col">Birth date</th>
<th scope="col">Age</th>
</tr>
</thead>
<tbody class="table-group-divider">
{% for dog in user_dogs %}
<tr>
<td>{{ dog.name }}</td>
<td>{{ dog.breed_size.value }}</td>
<td>{{ dog.birth_date.strftime('%Y-%m-%d') }}</td>
<td>{{ dog.get_age() }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>

View File

@@ -1,17 +0,0 @@
<table>
<tr>
<td>Name</td>
<td>Breed</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>

View File

@@ -1,18 +1,27 @@
<table>
<tr>
<td>Type</td>
<td>Date</td>
<td>Time</td>
<td>Dog</td>
</tr>
<div class="table-responsive">
<table class="table table-sm table-striped">
<thead>
<tr>
<th scope="colgroup" colspan="4" class="text-center h3">Visits overview</th>
</tr>
<tr>
<th scope="col">Type</th>
<th scope="col">Date</th>
<th scope="col">Time</th>
<th scope="col">Pets</th>
</tr>
</thead>
{% for visit in user.visits %}
<tr>
<td>{{ visit.type }}</td>
<td>{{ visit.get_date() }}</td>
<td>{{ visit.get_time() }}</td>
<td>{{ visit.dog }}</td>
</tr>
{% endfor %}
</table>
<tbody class="table-group-divider">
{% for visit in user_book_history %}
<tr>
<td>{{ visit.visit_type.value }}</td>
<td>{{ visit.get_date() }}</td>
<td>{{ visit.get_time() }}</td>
<td>{{ visit.dogs }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>

View File

@@ -0,0 +1,12 @@
{% extends 'base.html' %}
{% set title %}{{ user.username }} - My Dogs{% endset %}
{% block content %}
<h1>My Dogs</h1>
<hr>
{% include 'users/my_dogs/dogs_panel.html' %}
{% endblock %}

View File

@@ -0,0 +1,27 @@
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th scope="colgroup" colspan="4" class="text-center h3">My dogs</th>
</tr>
<tr>
<th scope="col">Name</th>
<th scope="col">Breed size</th>
<th scope="col">Birth date</th>
<th scope="col">Age</th>
</tr>
</thead>
<tbody class="table-group-divider">
{% for dog in user_dogs %}
<tr>
<td>{{ dog.name }}</td>
<td>{{ dog.breed_size.value }}</td>
<td>{{ dog.birth_date.strftime('%Y-%m-%d') }}</td>
<td>{{ dog.get_age() }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>