Commit 511c3046 authored by Jayson Lim's avatar Jayson Lim

Finalized html templates following the specifications

parent 5bffd121
...@@ -2,26 +2,33 @@ ...@@ -2,26 +2,33 @@
{% load static %} {% load static %}
{% block content %} {% block content %}
<style>
h3 {
border-bottom: 2px solid black;
}
</style>
<h3>{{ object }}</h3> <h3>{{ object }}</h3>
<h1>{{ object }}</h1> <h1>{{ object }}</h1>
<ul> <p style="font-size: 20px">{{ object.age }}</p>
<li><h3>{{ object.age }}</h3></li> <p style="font-size: 20px">{{ object.nationality }}</p>
<li><h3>{{ object.nationality }}</h3></li> <p style="font-size: 20px">{{ object.bio }}</p>
<li><h3>{{ object.bio }}</h3></li>
</ul>
<h1>Books by {{ object }} I love:</h1> <h1>Books by {{ object }} I love:</h1>
<ul> <ul>
{% for book in books %} {% for book in books %}
<li> <li>
<h3> <a href="{{ book.get_absolute_url }}" style="font-size: 20px">
<a href="{{ book.get_absolute_url }}">
{{ book.title }} {{ book.title }}
</a> </a>
</h3>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
<div style="display: flex; justify-content: space-between;">
<a href="{% url 'bookshelf:home' %}">Home</a>
<a href="{% url 'bookshelf:books' %}">Books</a>
<a href="{% url 'bookshelf:authors' %}">Authors</a>
</div>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -2,17 +2,24 @@ ...@@ -2,17 +2,24 @@
{% load static %} {% load static %}
{% block content %} {% block content %}
<style>
h3 {
border-bottom: 2px solid black;
}
</style>
<h3>My Favourite Authors</h3> <h3>My Favourite Authors</h3>
<h1>Jayson's Favorite Authors:</h1> <h1>Jayson's Favorite Authors:</h1>
<ul> <ul>
{% for object in object_list %} {% for object in object_list %}
<li> <li>
<h3> <a href="{{ object.get_absolute_url }}" style="font-size: 20px">
<a href="{{ object.get_absolute_url }}">
{{ object }} {{ object }}
</a> </a>
</h3>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
<div style="display: flex; justify-content: space-between;">
<a href="{% url 'bookshelf:home' %}">Home</a>
<a href="{% url 'bookshelf:books' %}">Books</a>
</div>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -2,22 +2,22 @@ ...@@ -2,22 +2,22 @@
{% load static %} {% load static %}
{% block content %} {% block content %}
<style>
h3 {
border-bottom: 2px solid black;
}
</style>
<h3>{{ object.title }}</h3> <h3>{{ object.title }}</h3>
<h1>{{ object.title }}</h1> <h1>{{ object.title }}</h1>
<ul> <a href="{{ author.get_absolute_url }}" style="font-size: 24px">{{ author }}</a>
<li> <p style="font-size: 20px">{{ object.publisher }}</p>
<h3> <p style="font-size: 20px">{{ object.year_published }}</p>
<a href="{{ author.get_absolute_url }}">{{ author }}</a> <p style="font-size: 20px">{{ object.ISBN }}</p>
</h3> <p style="font-size: 20px">{{ object.blurb }}</p>
</li>
<li><h3>{{ object.publisher }}</h3></li>
<li><h3>{{ object.year_published }}</h3></li>
<li><h3>{{ object.ISBN }}</h3></li>
<li><h3>{{ object.blurb }}</h3></li>
</ul>
<div style="display: flex; justify-content: space-between;"> <div style="display: flex; justify-content: space-between;">
<a href="{% url 'bookshelf:home' %}">Home</a> <a href="{% url 'bookshelf:home' %}">Home</a>
<a href="{% url 'bookshelf:books' %}">Books</a>
<a href="{% url 'bookshelf:authors' %}">Authors</a> <a href="{% url 'bookshelf:authors' %}">Authors</a>
</div> </div>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -2,16 +2,19 @@ ...@@ -2,16 +2,19 @@
{% load static %} {% load static %}
{% block content %} {% block content %}
<h3>My Favourite Books</h3> <style>
h3 {
border-bottom: 2px solid black;
}
</style>
<h3>My Favourite Books & Authors</h3>
<h1>Jayson's Favorite Books:</h1> <h1>Jayson's Favorite Books:</h1>
<ul> <ul>
{% for object in object_list %} {% for object in object_list %}
<li> <li>
<h3> <a href="{{ object.get_absolute_url }}" style="font-size: 20px">
<a href="{{ object.get_absolute_url }}">
{{ object.title }} {{ object.title }}
</a> </a>
</h3>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<h3>My Favourite Books & Authors</h3> <h3>My Favourite Books & Authors</h3>
<h1>Welcome to Jayson's Database of Favorite Books and Authors!</h1> <h1>Welcome to Jayson's Database of Favorite Books and Authors!</h1>
<h2>Genres</h2> <h2>Genres</h2>
<p>I absolutely love to read and I can't get enough of four genres in particular: <p style="font-size: 20px">I absolutely love to read and I can't get enough of four genres in particular:
fiction, drama, thriller, and action-adventure. Fiction is just awesome because fiction, drama, thriller, and action-adventure. Fiction is just awesome because
it's so broad and diverse. I can explore all kinds of cool worlds and stories, it's so broad and diverse. I can explore all kinds of cool worlds and stories,
whether they're about love, sci-fi, or classic literature. Drama is another one whether they're about love, sci-fi, or classic literature. Drama is another one
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
whether they involve crime or psychological plot-twists. And lastly, I love diving whether they involve crime or psychological plot-twists. And lastly, I love diving
into worlds filled with action-adventure, from spy stories to crazy fantasy realms.</p> into worlds filled with action-adventure, from spy stories to crazy fantasy realms.</p>
<h2>Favorite Authors</h2> <h2>Favorite Authors</h2>
<p>I enjoy the works of: George R.R. Martin, Robert Ludlum, J.K. Rowling, Dan Brown, <p style="font-size: 20px">I enjoy the works of: George R.R. Martin, Robert Ludlum, J.K. Rowling, Dan Brown,
John Grisham, Tom Clancy, and J.R.R. Tolkien.</p> John Grisham, Tom Clancy, and J.R.R. Tolkien.</p>
<div style="display: flex; justify-content: space-between;"> <div style="display: flex; justify-content: space-between;">
<a href="{% url 'bookshelf:books' %}">Books</a> <a href="{% url 'bookshelf:books' %}">Books</a>
......
...@@ -16,12 +16,6 @@ class BooksListView(ListView): ...@@ -16,12 +16,6 @@ class BooksListView(ListView):
model = Books model = Books
template_name = 'bookshelf/books.html' template_name = 'bookshelf/books.html'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['home_url'] = reverse('bookshelf:home')
context['authors_url'] = reverse('bookshelf:authors')
return context
class AuthorsListView(ListView): class AuthorsListView(ListView):
model = Author model = Author
template_name = 'bookshelf/authors.html' template_name = 'bookshelf/authors.html'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment