Commit 8a31ffef authored by Julia Anishka's avatar Julia Anishka

applied basic CSS styling to all pages

parent d1b68803
Pipeline #3076 canceled with stages
...@@ -48,5 +48,8 @@ class Books(models.Model): ...@@ -48,5 +48,8 @@ class Books(models.Model):
def __str__(self): def __str__(self):
return self.title return self.title
def get_author(self):
return self.author
def get_absolute_url(self): def get_absolute_url(self):
return reverse('bookshelf:book_details', kwargs={'pk': self.pk}) return reverse('bookshelf:book_details', kwargs={'pk': self.pk})
\ No newline at end of file
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% block title %} {{ object }} {% endblock %} {% block title %} {{ object }} {% endblock %}
{% block header %} {% block header %}
<h2> {{ object }} </h2> <div class="title">
<h1> {{ object }} </h1>
</div>
{% endblock %} {% endblock %}
{% block body %} {% block body %}
...@@ -22,10 +24,9 @@ ...@@ -22,10 +24,9 @@
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
<div> <div class="btns">
<h5> <a href="/home/"> Home </a> <a href="/home/" class="btn"> Home </a>
<a href="/books/"> Books </a> <a href="/books/" class="btn"> Books </a>
<a href="/authors/"> Authors </a> <a href="/authors/" class="btn"> Authors </a>
</h5> </div>
</div>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -3,7 +3,10 @@ ...@@ -3,7 +3,10 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% block title %} My Favorite Authors {% endblock %} {% block title %} My Favorite Authors {% endblock %}
{% block header %} {% block header %}
<div class="title">
<h1> Nisha's Favorite Authors </h1> <h1> Nisha's Favorite Authors </h1>
</div>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
...@@ -18,5 +21,8 @@ ...@@ -18,5 +21,8 @@
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
<h5> <a href="/home/"> Home </a> <a href="/books/"> Books </a></h5> <div class="btns">
<center><a href="/home/" class="btn"> Home </a>
<a href="/books/" class="btn"> Books </a> </center>
</div>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -3,17 +3,25 @@ ...@@ -3,17 +3,25 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% block title %} {{ object.title }} {% endblock %} {% block title %} {{ object.title }} {% endblock %}
{% block header %} {% block header %}
<h2> {{ object.title }} </h2> <div class="title">
<h1> {{ object.title }} </h1>
</div>
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<h4> Author:
<h4> {{ object.publisher }} </h4> <a href="{{ object.get_author.get_absolute_url }}">
<h4> {{ object.year_published }} </h4> {{ object.get_author }}
<h4> {{ object.ISBN }} </h4> </a>
<h4> {{ object.blurb }} </h4> </h4>
<h5> <a href="/home/"> Home </a> <h4> Publisher: {{ object.publisher }} </h4>
<a href="/books/"> Books </a> <h4> Year published: {{ object.year_published }} </h4>
<a href="/authors/"> Authors </a> <h4> ISBN: {{ object.ISBN }} </h4>
</h5> <p> Blurb: {{ object.blurb }} </p>
<div class="btns">
<a href="/home/" class="btn"> Home </a>
<a href="/books/" class="btn"> Books </a>
<a href="/authors/" class="btn"> Authors </a>
</div>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% block title %} My Favorite Books {% endblock %} {% block title %} My Favorite Books {% endblock %}
{% block header %} {% block header %}
<div class="title">
<h1> Nisha's Favorite Books </h1> <h1> Nisha's Favorite Books </h1>
</div>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
...@@ -17,5 +20,8 @@ ...@@ -17,5 +20,8 @@
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
<h5> <a href="/home/"> Home </a> <a href="/authors/"> Authors </a></h5> <div class="btns">
<a href="/home/" class="btn"> Home </a>
<a href="/authors/" class="btn"> Authors </a>
</div>
{% endblock %} {% endblock %}
\ No newline at end of file
{% extends 'base.html' %} {% extends 'base.html' %}
{% block title %} My Favorite Books & Authors {% endblock %} {% block title %} My Favorite Books & Authors {% endblock %}
{% block header %}
<div class="home-title">
<h1> Welcome to Nisha's Database of <br> Favorite Books and Authors! </h1>
</div>
{% endblock %}
{% block body %} {% block body %}
<h3><center> Welcome to Nisha's Database of <br> Favorite Books and Authors! </center></h3> <div class="home-body">
<p> The genres I usually enjoy include mystery, romance, and fantasy. From narratives <p> The genres I usually enjoy include mystery, romance, and fantasy. From narratives
that revolve around crimes to supernatural elements in a fictional world, I find each that revolve around crimes to supernatural elements in a fictional world, I find each
scene interesting. I enjoyed books written by J.K Rowling, specifically, Harry Potter due scene interesting. I enjoyed books written by J.K Rowling, specifically, Harry Potter due
...@@ -9,5 +15,9 @@ ...@@ -9,5 +15,9 @@
emotional and engaging storytelling. The characters in her book are deeply relatable and emotional and engaging storytelling. The characters in her book are deeply relatable and
she's able to move her readers through genuine dialogues. she's able to move her readers through genuine dialogues.
</p> </p>
<a href="/books/"> Books </a> <a href="/authors/"> Authors </a></h5> </div>
<div class="btns">
<a href="/books/" class="btn"> Books </a>
<a href="/authors/" class="btn"> Authors </a>
</div>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -120,6 +120,7 @@ USE_TZ = True ...@@ -120,6 +120,7 @@ USE_TZ = True
# https://docs.djangoproject.com/en/3.2/howto/static-files/ # https://docs.djangoproject.com/en/3.2/howto/static-files/
STATIC_URL = '/static/' STATIC_URL = '/static/'
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
# Default primary key field type # Default primary key field type
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
......
.btn {
background-color: lightblue;
color: white;
border-radius: 2px;
padding: 4px;
margin-right: 100px;
font-family: "Montserrat";
}
.btns {
display: flex;
align-items: center;
justify-content: center;
}
h1 {
color: white;
font-family: "Montserrat";
text-align: center;
}
body {
font-family: "Montserrat";
padding: 50px;
}
.title {
background-color: pink;
}
.home-title {
background: -webkit-linear-gradient(to top, pink, lightblue);
background: linear-gradient(to top, pink, lightblue);
}
.home-body {
display: flex;
text-align: center;
}
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %} {% endblock %}</title> <title>{% block title %} {% endblock %}</title>
{% load static %}
<link rel="stylesheet" href="{% static 'base.css' %}" type="text/css">
{% block styles %}{% endblock %} {% block styles %}{% endblock %}
</head> </head>
<body> <body>
......
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