Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rachpurisima_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
Rachel
rachpurisima_reading
Commits
4b38a08b
Commit
4b38a08b
authored
Mar 30, 2023
by
rachbit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated base.html and templates w CSS via bootstrap
parent
5d7303e0
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
150 additions
and
86 deletions
+150
-86
0001_initial.py
rachpurisima_reading/bookshelf/migrations/0001_initial.py
+5
-3
0002_auto_20230328_1255.py
...a_reading/bookshelf/migrations/0002_auto_20230328_1255.py
+0
-29
0002_auto_20230330_0843.py
...a_reading/bookshelf/migrations/0002_auto_20230330_0843.py
+23
-0
0003_alter_book_isbn.py
...sima_reading/bookshelf/migrations/0003_alter_book_isbn.py
+19
-0
0004_auto_20230330_1356.py
...a_reading/bookshelf/migrations/0004_auto_20230330_1356.py
+30
-0
models.py
rachpurisima_reading/bookshelf/models.py
+7
-5
author_details.html
...reading/bookshelf/templates/bookshelf/author_details.html
+14
-11
authors.html
...risima_reading/bookshelf/templates/bookshelf/authors.html
+6
-6
book_details.html
...a_reading/bookshelf/templates/bookshelf/book_details.html
+13
-15
books.html
...purisima_reading/bookshelf/templates/bookshelf/books.html
+8
-9
home.html
rachpurisima_reading/bookshelf/templates/bookshelf/home.html
+6
-6
urls.py
rachpurisima_reading/rachpurisima_reading/urls.py
+1
-1
base.html
rachpurisima_reading/templates/base.html
+18
-1
No files found.
rachpurisima_reading/bookshelf/migrations/0001_initial.py
View file @
4b38a08b
# Generated by Django 3.2 on 2023-03-
28 12
:41
# Generated by Django 3.2 on 2023-03-
30 08
:41
import
django.core.validators
from
django.db
import
migrations
,
models
...
...
@@ -25,12 +25,14 @@ class Migration(migrations.Migration):
],
),
migrations
.
CreateModel
(
name
=
'Book
s
'
,
name
=
'Book'
,
fields
=
[
(
'id'
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'title'
,
models
.
CharField
(
max_length
=
100
)),
(
'publisher'
,
models
.
CharField
(
max_length
=
100
)),
(
'year_published'
,
models
.
CharField
(
max_length
=
4
,
validators
=
[
django
.
core
.
validators
.
RegexValidator
(
'^
\\
d{1,10}$'
)])),
(
'ISBN'
,
models
.
CharField
(
max_length
=
13
,
primary_key
=
True
,
serialize
=
False
,
validators
=
[
django
.
core
.
validators
.
MinLengthValidator
(
13
),
django
.
core
.
validators
.
RegexValidator
(
'^
\\
d{1,10}$'
)])),
(
'ISBN'
,
models
.
CharField
(
max_length
=
13
,
validators
=
[
django
.
core
.
validators
.
MinLengthValidator
(
13
)])),
(
'blurb'
,
models
.
CharField
(
max_length
=
200
,
validators
=
[
django
.
core
.
validators
.
MinLengthValidator
(
100
)])),
(
'author'
,
models
.
ForeignKey
(
default
=
''
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'bookshelf.author'
)),
],
),
...
...
rachpurisima_reading/bookshelf/migrations/0002_auto_20230328_1255.py
deleted
100644 → 0
View file @
5d7303e0
# Generated by Django 3.2 on 2023-03-28 12:55
import
django.core.validators
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'bookshelf'
,
'0001_initial'
),
]
operations
=
[
migrations
.
CreateModel
(
name
=
'Book'
,
fields
=
[
(
'title'
,
models
.
CharField
(
max_length
=
100
)),
(
'publisher'
,
models
.
CharField
(
max_length
=
100
)),
(
'year_published'
,
models
.
CharField
(
max_length
=
4
,
validators
=
[
django
.
core
.
validators
.
RegexValidator
(
'^
\\
d{1,10}$'
)])),
(
'ISBN'
,
models
.
CharField
(
max_length
=
13
,
primary_key
=
True
,
serialize
=
False
,
validators
=
[
django
.
core
.
validators
.
MinLengthValidator
(
13
),
django
.
core
.
validators
.
RegexValidator
(
'^
\\
d{1,10}$'
)])),
(
'blurb'
,
models
.
CharField
(
max_length
=
200
)),
(
'author'
,
models
.
ForeignKey
(
default
=
''
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'bookshelf.author'
)),
],
),
migrations
.
DeleteModel
(
name
=
'Books'
,
),
]
rachpurisima_reading/bookshelf/migrations/0002_auto_20230330_0843.py
0 → 100644
View file @
4b38a08b
# Generated by Django 3.2 on 2023-03-30 08:43
import
django.core.validators
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'bookshelf'
,
'0001_initial'
),
]
operations
=
[
migrations
.
RemoveField
(
model_name
=
'book'
,
name
=
'id'
,
),
migrations
.
AlterField
(
model_name
=
'book'
,
name
=
'ISBN'
,
field
=
models
.
CharField
(
max_length
=
13
,
primary_key
=
True
,
serialize
=
False
,
validators
=
[
django
.
core
.
validators
.
MinLengthValidator
(
13
),
django
.
core
.
validators
.
RegexValidator
(
'^
\\
d{1,10}$'
)]),
),
]
rachpurisima_reading/bookshelf/migrations/0003_alter_book_
blurb
.py
→
rachpurisima_reading/bookshelf/migrations/0003_alter_book_
isbn
.py
View file @
4b38a08b
# Generated by Django 3.2 on 2023-03-
28 13:00
# Generated by Django 3.2 on 2023-03-
30 08:47
import
django.core.validators
from
django.db
import
migrations
,
models
...
...
@@ -7,13 +7,13 @@ from django.db import migrations, models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'bookshelf'
,
'0002_auto_202303
28_1255
'
),
(
'bookshelf'
,
'0002_auto_202303
30_0843
'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'book'
,
name
=
'
blurb
'
,
field
=
models
.
CharField
(
max_length
=
200
,
validators
=
[
django
.
core
.
validators
.
MinLengthValidator
(
100
)]),
name
=
'
ISBN
'
,
field
=
models
.
CharField
(
max_length
=
13
,
primary_key
=
True
,
serialize
=
False
,
validators
=
[
django
.
core
.
validators
.
RegexValidator
(
'^
\\
d{1,10}$'
)]),
),
]
rachpurisima_reading/bookshelf/migrations/0004_auto_20230330_1356.py
0 → 100644
View file @
4b38a08b
# Generated by Django 3.2 on 2023-03-30 13:56
import
django.core.validators
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'bookshelf'
,
'0003_alter_book_isbn'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'book'
,
name
=
'ISBN'
,
field
=
models
.
CharField
(
max_length
=
13
,
primary_key
=
True
,
serialize
=
False
,
validators
=
[
django
.
core
.
validators
.
MinLengthValidator
(
13
),
django
.
core
.
validators
.
RegexValidator
(
'^(
\\
d{13})$'
)]),
),
migrations
.
AlterField
(
model_name
=
'book'
,
name
=
'author'
,
field
=
models
.
ForeignKey
(
default
=
''
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
related_name
=
'books'
,
to
=
'bookshelf.author'
),
),
migrations
.
AlterField
(
model_name
=
'book'
,
name
=
'year_published'
,
field
=
models
.
PositiveIntegerField
(
validators
=
[
django
.
core
.
validators
.
MaxValueValidator
(
2023
)]),
),
]
rachpurisima_reading/bookshelf/models.py
View file @
4b38a08b
from
django.db
import
models
from
django.core.validators
import
MinLengthValidator
,
RegexValidator
from
django.core.validators
import
MinLengthValidator
,
RegexValidator
,
MaxValueValidator
from
django.urls
import
reverse
from
datetime
import
date
class
Author
(
models
.
Model
):
...
...
@@ -13,16 +15,16 @@ class Author(models.Model):
return
'{} {}'
.
format
(
self
.
first_name
,
self
.
last_name
)
def
get_absolute_url
(
self
):
return
reverse
(
"bookshelf:author_details"
,
kwargs
=
{
'pk'
:
self
.
pk
})
return
reverse
(
'bookshelf:author_details'
,
kwargs
=
{
'pk'
:
self
.
pk
})
class
Book
(
models
.
Model
):
title
=
models
.
CharField
(
max_length
=
100
)
author
=
models
.
ForeignKey
(
Author
,
on_delete
=
models
.
CASCADE
,
default
=
""
)
author
=
models
.
ForeignKey
(
Author
,
on_delete
=
models
.
CASCADE
,
related_name
=
"books"
,
default
=
""
)
publisher
=
models
.
CharField
(
max_length
=
100
)
year_published
=
models
.
CharField
(
max_length
=
4
,
validators
=
[
RegexValidator
(
r'^\d{1,10}$'
)])
ISBN
=
models
.
CharField
(
primary_key
=
True
,
max_length
=
13
,
validators
=
[
MinLengthValidator
(
13
),
RegexValidator
(
r'^\d{1,10}
$'
)])
year_published
=
models
.
PositiveIntegerField
(
validators
=
[
MaxValueValidator
(
date
.
today
()
.
year
)])
ISBN
=
models
.
CharField
(
primary_key
=
True
,
max_length
=
13
,
validators
=
[
MinLengthValidator
(
13
),
RegexValidator
(
'^(
\
d{13})
$'
)])
blurb
=
models
.
CharField
(
max_length
=
200
,
validators
=
[
MinLengthValidator
(
100
)])
def
__str__
(
self
):
...
...
rachpurisima_reading/bookshelf/templates/bookshelf/author_details.html
View file @
4b38a08b
{% extends 'base.html' %}
{% load static %}
{% block title %}{{object.first_name}}{{object.last_name}}{% endblock %}
{% block title %}{{object.first_name}}
{{object.last_name}}{% endblock %}
{% block content %}
<h1>
{{object.
titl
e}}
</h1>
<h1>
{{object.
first_name}} {{object.last_nam
e}}
</h1>
<ul>
<li>
{{object.age}}
</li>
<li>
{{object.nationality}}
</li>
<li>
{{object.bio}}
</li>
Age: {{object.age}}
<br>
Nationality: {{object.nationality}}
<br>
About the Author:
<br>
<div
class=
"container"
>
{{object.bio}}
<br>
</div>
</ul>
<br>
<h2>
Books by {{object.first_name}} {{object.last_name}} that I love:
</h2>
<ul>
{% for book in object.books.all %}
<li>
<a
href=
"{{
book.get_absolute_url
}}"
>
{{book.title}}
</a>
<a
href=
"{{
book.get_absolute_url
}}"
>
{{book.title}}
</a>
</li>
{% endfor %}
</ul>
<div
class=
"container space-evenly"
>
<a
href=
"/home"
>
Home
</a>
<a
href=
"/books"
>
Books
</a
>
<a
href=
"/authors"
>
Authors
</a
>
<
/div
>
{% endblock %}
{% block navbar %}
<li><a
href=
"/bookshelf/home"
>
Home
</a></li
>
<li><a
href=
"/bookshelf/books"
>
Books
</a></li
>
<
li><a
href=
"/bookshelf/authors"
>
Authors
</a></li
>
{% endblock %}
rachpurisima_reading/bookshelf/templates/bookshelf/authors.html
View file @
4b38a08b
...
...
@@ -3,8 +3,7 @@
{% block title %}My Favorite Authors{% endblock %}
{% block content %}
<h1
class=
"text-center"
>
Rach's Favorite Authors:
</h1>
<br>
<h1>
Rach's Favorite Authors:
</h1>
<ul>
{% for object in object_list %}
<li>
...
...
@@ -14,8 +13,9 @@
</li>
{% endfor %}
</ul>
<div
class=
"container space-evenly"
>
<a
href=
"/home"
>
Home
</a>
<a
href=
"/books"
>
Books
</a>
</div>
{% endblock %}
{% block navbar %}
<li><a
href=
"/bookshelf/home"
>
Home
</a></li>
<li><a
href=
"/bookshelf/books"
>
Books
</a></li>
<li><a
href=
"#"
>
Authors
</a></li>
{% endblock %}
rachpurisima_reading/bookshelf/templates/bookshelf/book_details.html
View file @
4b38a08b
...
...
@@ -3,20 +3,18 @@
{% block title %}{{object.title}}{% endblock %}
{% block content %}
<h1>
{{object.title}}
</h1>
<ul>
<li>
<a
href=
"{{ object.author.get_absolute_url }}"
>
{{object.author}}
</a>
</li>
<li>
{{object.publisher}}
</li>
<li>
{{object.year_published}}
</li>
<li>
{{object.ISBN}}
</li>
<h1>
{{object.title}} ({{object.year_published}})
</h1>
<ul>
By
<a
href=
"{{ object.author.get_absolute_url }}"
>
{{object.author}}
</a><br>
Published by {{object.publisher}}
<br>
<br>
<li>
ISBN: {{object.ISBN}}
</li>
<li>
{{object.blurb}}
</li>
</ul>
</ul>
<br>
<div
class=
"container space-evenly"
>
<a
href=
"/home"
>
Home
</a>
<a
href=
"/books"
>
Books
</a
>
<a
href=
"/authors"
>
Authors
</a
>
<
/div
>
{% endblock %}
{% block navbar %}
<li><a
href=
"/bookshelf/home"
>
Home
</a></li
>
<li><a
href=
"/bookshelf/books"
>
Books
</a></li
>
<
li><a
href=
"/bookshelf/authors"
>
Authors
</a></li
>
{% endblock %}
rachpurisima_reading/bookshelf/templates/bookshelf/books.html
View file @
4b38a08b
...
...
@@ -3,20 +3,19 @@
{% block title %}My Favorite Books{% endblock %}
{% block content %}
<h1
class=
"text-center"
>
Rach's Favorite Books:
</h1>
<br>
<h1>
Rach's Favorite Books:
</h1>
<ul>
{% for object in object_list %}
<li>
<a
href=
"{{
object.get_absolute_url
}}"
>
{{
object.title
}}
<a
href=
"{{
object.get_absolute_url
}}"
>
{{
object.title
}}
</a>
</li>
{% endfor %}
</ul>
<div
class=
"container space-evenly"
>
<a
href=
"/home"
>
Home
</a>
<a
href=
"/authors"
>
Authors
</a
>
<
/div
>
{% endblock %}
{% block navbar %}
<li><a
href=
"/bookshelf/home"
>
Home
</a></li
>
<
li><a
href=
"#"
>
Books
</a></li
>
<li><a
href=
"/bookshelf/authors"
>
Authors
</a></li>
{% endblock %}
rachpurisima_reading/bookshelf/templates/bookshelf/home.html
View file @
4b38a08b
...
...
@@ -2,15 +2,15 @@
{% load static %}
{% block title %}My Favorite Books
&
Authors{% endblock %}
{% block content %}
<h1
class=
"text-center"
>
Welcome to Rach's Database of Favorite Books and Authors!
</h1>
<br>
<p
class=
"text-center"
>
!! Book !! Review !! I do not like reading that much but these are some of the books I would like to gatekeep.
</p>
<br>
<div
class=
"container space-evenly"
>
<a
href=
"/books"
>
Books
</a
>
<a
href=
"/authors"
>
Authors
</a
>
<
/div
>
{% endblock %}
{% block navbar %}
<li><a
href=
"#"
>
Home
</a></li
>
<li><a
href=
"/bookshelf/books"
>
Books
</a></li
>
<
li><a
href=
"/bookshelf/authors"
>
Authors
</a></li
>
{% endblock %}
rachpurisima_reading/rachpurisima_reading/urls.py
View file @
4b38a08b
...
...
@@ -18,5 +18,5 @@ from django.urls import path, include
urlpatterns
=
[
path
(
'admin/'
,
admin
.
site
.
urls
),
path
(
''
,
include
(
'bookshelf.urls'
,
namespace
=
'bookshelf'
)),
path
(
'
bookshelf/
'
,
include
(
'bookshelf.urls'
,
namespace
=
'bookshelf'
)),
]
rachpurisima_reading/templates/base.html
View file @
4b38a08b
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<link
rel=
"stylesheet"
href=
"
style
.css"
>
<link
rel=
"stylesheet"
href=
"
https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min
.css"
>
<title>
{% block title %}My amazing site{% endblock %}
</title>
{% block styles %}{% endblock %}
<nav
class=
"navbar navbar-default"
>
<div
class=
"container-fluid"
>
<ul
class=
"nav navbar-nav"
>
{% block navbar %}
{% endblock %}
</ul>
</div>
</nav>
</head>
<body>
<div
id=
"content"
>
<div
class=
"container"
>
{% block content %}{% endblock %}
</div>
</div>
<br><br><br>
{% block scripts %}{% endblock %}
<div
class=
"container"
>
<p
class=
"text-centered"
>
<img
src=
"https://media.tenor.com/l1pItZnKEsoAAAAM/funny-as-hell.gif"
alt=
"honkhonk"
>
where is he going
</p>
</div>
</body>
</html>
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