Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mavlee_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
Mavrick Jordan Lee
mavlee_reading
Commits
2b1f993b
Commit
2b1f993b
authored
Apr 24, 2023
by
Mavrick Jordan Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated BookDetailsPage. Added EditBookPage.
parent
33b5ff59
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
2 deletions
+20
-2
book_details.html
...e_reading/bookshelf/templates/bookshelf/book_details.html
+3
-0
edit-book.html
mavlee_reading/bookshelf/templates/bookshelf/edit-book.html
+9
-0
urls.py
mavlee_reading/bookshelf/urls.py
+2
-1
views.py
mavlee_reading/bookshelf/views.py
+6
-1
db.sqlite3
mavlee_reading/db.sqlite3
+0
-0
No files found.
mavlee_reading/bookshelf/templates/bookshelf/book_details.html
View file @
2b1f993b
...
...
@@ -8,6 +8,9 @@
{{ object.year_published }}
<br>
{{ object.ISBN }}
<br>
{{ object.blurb }}
<br>
<a
href=
"{% url 'bookshelf:edit-book' book.id %}"
>
<button>
Edit Book
</button>
</a>
</p>
<a
href=
"{% url 'bookshelf:home' %}"
>
Home
</a>
&
nbsp
&
nbsp
&
nbsp
&
nbsp
&
nbsp
&
nbsp
&
nbsp
&
nbsp
...
...
mavlee_reading/bookshelf/templates/bookshelf/edit-book.html
0 → 100644
View file @
2b1f993b
{% extends 'base.html' %}
{% block title %}Edit Book{% endblock %}
{% block content %}
<form
method=
"POST"
>
{% csrf_token %}
{{ form.as_p }}
<input
type=
"Submit"
value=
"Save Changes"
>
</form>
{% endblock %}
\ No newline at end of file
mavlee_reading/bookshelf/urls.py
View file @
2b1f993b
...
...
@@ -3,7 +3,7 @@ from django.urls import path
from
.
import
views
from
.views
import
(
BooksListView
,
BookDetailsView
,
AuthorsListView
,
AuthorDetailsView
,
BookCreateView
,
AuthorCreateView
BookCreateView
,
AuthorCreateView
,
BookUpdateView
)
urlpatterns
=
[
...
...
@@ -14,6 +14,7 @@ urlpatterns = [
path
(
'authors/<int:pk>/details/'
,
AuthorDetailsView
.
as_view
(),
name
=
"author-detail"
),
path
(
'books/add/'
,
BookCreateView
.
as_view
(),
name
=
"add-book"
),
path
(
'authors/add/'
,
AuthorCreateView
.
as_view
(),
name
=
"add-author"
),
path
(
'books/<int:pk>/edit/'
,
BookUpdateView
.
as_view
(),
name
=
"edit-book"
),
]
app_name
=
'bookshelf'
\ No newline at end of file
mavlee_reading/bookshelf/views.py
View file @
2b1f993b
...
...
@@ -35,3 +35,8 @@ class AuthorCreateView(CreateView):
model
=
Author
fields
=
'__all__'
template_name
=
'bookshelf/add-author.html'
class
BookUpdateView
(
UpdateView
):
model
=
Book
fields
=
'__all__'
template_name
=
'bookshelf/edit-book.html'
\ No newline at end of file
mavlee_reading/db.sqlite3
View file @
2b1f993b
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