Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
eurysee_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
Eury See
eurysee_reading
Commits
91a06345
Commit
91a06345
authored
Apr 26, 2023
by
Eury See
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated Homepage and added New Book Page and New Author Page.
parent
494ccdd8
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
89 additions
and
4 deletions
+89
-4
README.txt
README.txt
+1
-1
.DS_Store
eurysee_reading/.DS_Store
+0
-0
add-author.html
...see_reading/bookshelf/templates/bookshelf/add-author.html
+28
-0
add-book.html
eurysee_reading/bookshelf/templates/bookshelf/add-book.html
+28
-0
home.html
eurysee_reading/bookshelf/templates/bookshelf/home.html
+1
-0
urls.py
eurysee_reading/bookshelf/urls.py
+8
-1
views.py
eurysee_reading/bookshelf/views.py
+23
-2
db.sqlite3
eurysee_reading/db.sqlite3
+0
-0
No files found.
README.txt
View file @
91a06345
...
...
@@ -2,4 +2,4 @@ Eurydice Gabrielle Madison Ong See, 204656, CSCI 40-F
Lab 03: My Favorite Books and Authors
March 28, 2023
This project was fully and truthfully accomplished by the individual whose name is indicated in the aforementioned.
<sgd> Eurydice Gabrielle Madison Ong See, March 28, 2023
\ No newline at end of file
<sgd> Eurydice Gabrielle Madison Ong See, March 30, 2023
\ No newline at end of file
eurysee_reading/.DS_Store
View file @
91a06345
No preview for this file type
eurysee_reading/bookshelf/templates/bookshelf/add-author.html
0 → 100644
View file @
91a06345
{% extends 'bookshelf/base.html' %}
{% load static %}
{% block title %} Add New Author {% endblock %}
{% block content %}
<link
rel=
"stylesheet"
href=
"{% static 'styles.css' %"
}
>
<form
method=
"post"
>
{% csrf_token %}
{{ form.as_p }}
<button
type=
"submit"
>
Add Author
</button>
</form>
{% block styles %}
<style>
body
{
background-color
:
#FEC98F
;
font-family
:
Georgia
,
serif
;
font-size
:
16px
;
font-weight
:
bold
;
color
:
#d87847
;
}
</style>
{% endblock %}
</div>
{% endblock %}
\ No newline at end of file
eurysee_reading/bookshelf/templates/bookshelf/add-book.html
0 → 100644
View file @
91a06345
{% extends 'bookshelf/base.html' %}
{% load static %}
{% block title %} Add New Book {% endblock %}
{% block content %}
<link
rel=
"stylesheet"
href=
"{% static 'styles.css' %"
}
>
<form
method=
"post"
>
{% csrf_token %}
{{ form.as_p }}
<button
type=
"submit"
>
Add Book
</button>
</form>
{% block styles %}
<style>
body
{
background-color
:
#FEA8A5
;
font-family
:
Georgia
,
serif
;
font-size
:
16px
;
font-weight
:
bold
;
color
:
#c35c5a
;
}
</style>
{% endblock %}
</div>
{% endblock %}
\ No newline at end of file
eurysee_reading/bookshelf/templates/bookshelf/home.html
View file @
91a06345
...
...
@@ -11,6 +11,7 @@
<p>
I enjoy reading books that range from genres including crime, thriller, magical realism, and historical fiction. Some of my favorite authors are Haruki Murakami and Dan Brown.
</p>
<p><a
href=
"http://127.0.0.1:8000/bookshelf/books"
>
Books
</a>
<a
href=
"http://127.0.0.1:8000/bookshelf/authors"
>
Authors
</a></p>
<p><a
href=
"http://127.0.0.1:8000/bookshelf/books/add"
>
Add Book
</a>
<a
href=
"http://127.0.0.1:8000/bookshelf/authors/add"
>
Add Author
</a></p>
</div>
...
...
eurysee_reading/bookshelf/urls.py
View file @
91a06345
from
django.urls
import
path
from
.views
import
(
BooksListView
,
BooksDetailView
,
AuthorListView
,
AuthorDetailView
)
from
.views
import
(
BooksListView
,
BooksDetailView
,
AuthorListView
,
AuthorDetailView
,
AddBooksView
,
AddAuthorsView
)
# EditBooksView, EditAuthorsView
from
.
import
views
urlpatterns
=
[
...
...
@@ -8,6 +11,10 @@ urlpatterns = [
path
(
"books/<int:pk>/details"
,
BooksDetailView
.
as_view
(),
name
=
"books-detail"
),
path
(
"authors"
,
AuthorListView
.
as_view
(),
name
=
"authors"
),
path
(
"authors/<int:pk>/details"
,
AuthorDetailView
.
as_view
(),
name
=
"author-detail"
),
path
(
"books/add/"
,
AddBooksView
.
as_view
(),
name
=
"add-book"
),
path
(
"authors/add/"
,
AddAuthorsView
.
as_view
(),
name
=
"add-author"
),
# path("books/<int:pk>/edit/", EditBooksView.as_view(), name = "edit-book"),
# path("authors/<int:pk>/edit/", EditAuthorsView.as_view(), name = "edit-author"),
]
app_name
=
"bookshelf"
\ No newline at end of file
eurysee_reading/bookshelf/views.py
View file @
91a06345
...
...
@@ -2,6 +2,8 @@ from django.shortcuts import render
from
django.views
import
View
from
django.views.generic.list
import
ListView
from
django.views.generic.detail
import
DetailView
from
django.views.generic.edit
import
CreateView
from
django.views.generic.edit
import
UpdateView
from
.models
import
Books
,
Author
...
...
@@ -36,3 +38,22 @@ class AuthorDetailView(DetailView):
context
[
'books'
]
=
self
.
object
.
books
return
context
class
AddBooksView
(
CreateView
):
model
=
Books
fields
=
'__all__'
template_name
=
'bookshelf/add-book.html'
class
AddAuthorsView
(
CreateView
):
model
=
Author
fields
=
'__all__'
template_name
=
'bookshelf/add-author.html'
# class EditBooksView(UpdateView):
# model = Author
# fields = '__all__'
# template_name = 'bookshelf/edit-book.html'
# class EditAuthorsView(UpdateView):
# model = Author
# fields = '__all__'
# template_name = 'bookshelf/edit-author.html'
\ No newline at end of file
eurysee_reading/db.sqlite3
View file @
91a06345
No preview for this file type
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