Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
javing_reading
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
John Aidan Vincent M. Ng
javing_reading
Commits
4002e438
Commit
4002e438
authored
Mar 27, 2023
by
Javi Ng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added comments to html, css and model files
parent
ed5ebb70
Pipeline
#2963
failed with stages
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
28 additions
and
2 deletions
+28
-2
models.cpython-310.pyc
javing_reading/bookshelf/__pycache__/models.cpython-310.pyc
+0
-0
models.py
javing_reading/bookshelf/models.py
+2
-0
author_details.html
...reading/bookshelf/templates/bookshelf/author_details.html
+4
-0
authors.html
javing_reading/bookshelf/templates/bookshelf/authors.html
+4
-0
book_details.html
...g_reading/bookshelf/templates/bookshelf/book_details.html
+2
-0
books.html
javing_reading/bookshelf/templates/bookshelf/books.html
+5
-1
home.html
javing_reading/bookshelf/templates/bookshelf/home.html
+1
-0
style.css
javing_reading/static/style.css
+6
-0
base.html
javing_reading/templates/base.html
+4
-1
No files found.
javing_reading/bookshelf/__pycache__/models.cpython-310.pyc
View file @
4002e438
No preview for this file type
javing_reading/bookshelf/models.py
View file @
4002e438
...
...
@@ -15,6 +15,7 @@ class Author (models.Model):
def
__str__
(
self
):
return
self
.
first_name
+
" "
+
self
.
last_name
# getting url for detail page
def
get_absolute_url
(
self
):
return
(
reverse
(
'authordetail'
,
kwargs
=
{
'pk'
:
self
.
pk
}))
...
...
@@ -28,5 +29,6 @@ class Book (models.Model):
ISBN
=
models
.
IntegerField
()
blurb
=
models
.
TextField
(
max_length
=
200
)
# getting url for detail page
def
get_absolute_url
(
self
):
return
(
reverse
(
'bookdetail'
,
kwargs
=
{
'pk'
:
self
.
pk
}))
\ No newline at end of file
javing_reading/bookshelf/templates/bookshelf/author_details.html
View file @
4002e438
{% extends 'base.html' %}
{# title only uses object, as object call returns string of firstname lastname #}
{% block title %} {{ object }} {% endblock %}
{% block content %}
...
...
@@ -7,6 +9,7 @@
<b>
Nationality:
</b>
{{ object.nationality }}
<br>
<b>
Biography:
</b>
{{ object.bio }}
<br>
<br>
{# iterate through set of related books (related_name is booklist) #}
<b>
Books by {{ object }} I love:
</b>
<ul>
{% for book in object.booklist.all %}
...
...
@@ -20,6 +23,7 @@
{% endblock %}
{# navigation bar block #}
{% block table %}
<td><a
href =
'../../home'
>
Home
</a></td>
<td><a
href =
'../../books'
>
Books
</a></td>
...
...
javing_reading/bookshelf/templates/bookshelf/authors.html
View file @
4002e438
{% extends 'base.html' %}
{% block title %} My Favorite Authors {% endblock %}
{% block content %}
<h1>
Javi's Favorite Authors:
</h1>
{# Iterate through authors passed, use url method to link to detail pages #}
<ul>
{% for author in author_list %}
<li>
...
...
@@ -15,6 +18,7 @@
{% endblock %}
{# navigation bar block #}
{% block table %}
<td><a
href =
'../home'
>
Home
</a></td>
<td><a
href =
'../books'
>
Books
</a></td>
...
...
javing_reading/bookshelf/templates/bookshelf/book_details.html
View file @
4002e438
{% extends 'base.html' %}
{% block title %} {{ object.title }} {% endblock %}
{% block content %}
...
...
@@ -15,6 +16,7 @@
{% endblock %}
{# navigation bar block #}
{% block table %}
<td><a
href =
'../../home'
>
Home
</a></td>
<td><a
href =
'../../books'
>
Books
</a></td>
...
...
javing_reading/bookshelf/templates/bookshelf/books.html
View file @
4002e438
{% extends 'base.html' %}
{% block title %} My Favorite Books {% endblock %}
{% block content %}
<h1>
Javi's Favorite Books:
</h1>
{# Iterate through books in book_list, also with urls #}
<ul>
{% for book in book_list %}
<li>
...
...
@@ -14,7 +17,8 @@
</ul>
{% endblock %}
{# navigation bar block #}
{% block table %}
<td><a
href =
'../home'
>
Home
</a></td>
<td><a
href =
'../authors'
>
Authors
</a></td>
...
...
javing_reading/bookshelf/templates/bookshelf/home.html
View file @
4002e438
...
...
@@ -7,6 +7,7 @@
I like to think that the jokes are also reflective of my personality though.
{% endblock %}
{# navigation bar block #}
{% block table %}
<td><a
href =
'../books'
>
Books
</a></td>
<td><a
href =
'../authors'
>
Authors
</a></td>
...
...
javing_reading/static/style.css
View file @
4002e438
/* Change font of headers */
h1
{
font-family
:
'Courier New'
;
}
/* Make table spread across screen, beige bg color, double border */
table
{
width
:
100%
;
background-color
:
bisque
;
border
:
2px
solid
;
}
/* Give table some padding space, align links to center */
td
{
text-align
:
center
;
padding
:
5px
;
border
:
2px
solid
;
}
/* Make bullet points into my face */
ul
{
list-style-image
:
url('bulletpoint.png')
;
}
/* Make background image also my face but just in the corner, rest of background is offwhite */
body
{
background-image
:
url(background.png)
;
background-color
:
ivory
;
background-position
:
right
bottom
;
background-repeat
:
no-repeat
;
}
\ No newline at end of file
javing_reading/templates/base.html
View file @
4002e438
<html
lang=
"en"
>
{% load static %}
<head>
{# calling stylesheet, block for page title #}
<link
rel=
"stylesheet"
href=
" {% static '/style.css' %} "
>
<title>
{% block title %}My Favorite Books and Authors{% endblock %}
</title>
...
...
@@ -10,12 +11,14 @@
<body>
{# block for content #}
<div
id=
"content"
>
{% block content %}{% endblock %}
</div>
<br>
{# block for navigation bar, app pages simply put table data for needed links #}
<table>
<tr>
{% block table %}{% endblock %}
</table>
</tr>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment