Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
neptunesy_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
Star Neptune R. Sy
neptunesy_reading
Commits
5a3fd42b
Commit
5a3fd42b
authored
Apr 25, 2023
by
Star Neptune R. Sy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edit-book.html and edit-author.html works
parent
8c74acea
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
47 additions
and
19 deletions
+47
-19
add-author.html
...esy_reading/bookshelf/templates/bookshelf/add-author.html
+0
-15
authors_details.html
...eading/bookshelf/templates/bookshelf/authors_details.html
+1
-0
book_detais.html
...sy_reading/bookshelf/templates/bookshelf/book_detais.html
+2
-1
edit-author.html
...sy_reading/bookshelf/templates/bookshelf/edit-author.html
+17
-0
edit-book.html
...nesy_reading/bookshelf/templates/bookshelf/edit-book.html
+17
-0
home.html
neptunesy_reading/bookshelf/templates/home.html
+1
-1
urls.py
neptunesy_reading/bookshelf/urls.py
+3
-2
views.py
neptunesy_reading/bookshelf/views.py
+6
-0
db.sqlite3
neptunesy_reading/db.sqlite3
+0
-0
No files found.
neptunesy_reading/bookshelf/templates/bookshelf/add-author.html
View file @
5a3fd42b
...
...
@@ -9,21 +9,6 @@
<form
id=
'addAuthor'
method=
"post"
>
{% csrf_token %}
{{form.as_p}}
<!--<label for="firstName">First name:</label>
<input type="text" id="textField" name="firstName"><br><br>
<label for="lastName">Last name:</label>
<input type="text" id="textField" name="lastName"><br><br>
<label for="age">Age:</label>
<input type="number" id="textField" name="age"><br><br>
<label for="publisher">Publisher:</label>
<input type="text" id="textField" name="publisher"><br><br>
<label for="yearPublished">Year published:</label>
<input type="date" id="dateField" name="yearPublished"><br><br>
<label for="ISBN">ISBN:</label>
<input type="text" id="textField" name="ISBN"><br><br>
<label for="blurb">Blurb:</label>
<textarea name="blurb" form='addBook' rows=50 cols=50></textarea>
<input type="text" id="textField" name="blurb" ><br><br>-->
<input
type=
"submit"
id=
"submitButton"
value=
"Add Author"
>
</form>
...
...
neptunesy_reading/bookshelf/templates/bookshelf/authors_details.html
View file @
5a3fd42b
...
...
@@ -23,6 +23,7 @@
<a
class=
"navBtn"
href=
"/home"
>
Home
</a>
<a
class=
"navBtn"
href=
"/books"
>
Books
</a>
<a
class=
"navBtn"
href=
"/authors"
>
Authors
</a>
<a
class=
"navBtn"
href=
"../edit/"
>
Edit Author
</a>
</div>
</div>
{% endblock %}
neptunesy_reading/bookshelf/templates/bookshelf/book_detais.html
View file @
5a3fd42b
...
...
@@ -8,7 +8,7 @@
<b>
Author:
</b>
<a
href=
"/authors/{{object.get_absolute_url}}/details/"
>
{{ object.author }}
</a>
<br>
<b>
Publisher:
</b>
{{ object.publisher}}
<br>
<b>
Year published:
</b>
{{ object.
year_p
ublished}}
<br>
<b>
Year published:
</b>
{{ object.
getYearP
ublished}}
<br>
<b>
ISBN:
</b>
{{ object.ISBN}}
<br>
<b>
Blurb:
</b>
{{ object.blurb}}
<br>
...
...
@@ -19,5 +19,6 @@
<a
class=
"navBtn"
href=
"/home"
>
Home
</a>
<a
class=
"navBtn"
href=
"/books"
>
Books
</a>
<a
class=
"navBtn"
href=
"/authors"
>
Authors
</a>
<a
class=
"navBtn"
href=
"../edit/"
>
Edit book
</a>
{% endblock %}
neptunesy_reading/bookshelf/templates/bookshelf/edit-author.html
0 → 100644
View file @
5a3fd42b
{% extends 'base.html' %}
{% block title %} Edit Author {% endblock %}
{% block additional %} Edit Author {% endblock %}
{% block content %}
<form
id=
'addAuthor'
method=
"post"
>
{% csrf_token %}
{{form.as_p}}
<input
type=
"submit"
id=
"submitButton"
value=
"Edit Author"
>
</form>
{% endblock %}
neptunesy_reading/bookshelf/templates/bookshelf/edit-book.html
0 → 100644
View file @
5a3fd42b
{% extends 'base.html '%}
{% block title %} Edit Book {% endblock %}
{% block additional %} Edit Book {% endblock %}
{% block content %}
<form
id=
"addBook"
method=
"post"
>
{% csrf_token %}
{{ form.as_p }}
<input
type=
"submit"
id=
"submitButton"
value=
"Submit"
>
</form>
{% endblock %}
neptunesy_reading/bookshelf/templates/home.html
View file @
5a3fd42b
...
...
@@ -9,7 +9,7 @@
<div>
<a
class=
"navBtn"
href=
"/books"
>
Books
</a>
<a
class=
"navBtn"
href=
"/authors"
>
Authors
</a>
<br>
<br>
<br><br>
<a
class=
"navBtn"
href=
"/books/add"
>
Add Book
</a>
<a
class=
"navBtn"
href=
"/authors/add"
>
Add Author
</a>
</div>
...
...
neptunesy_reading/bookshelf/urls.py
View file @
5a3fd42b
# bookshelf/urls.py
from
django.urls
import
path
from
.views
import
(
homeView
,
BooksView
,
BooksAddView
,
BooksDetail
,
AuthorView
,
AuthorAddView
,
AuthorDetail
)
from
.views
import
(
homeView
,
BooksView
,
BooksAddView
,
BooksDetail
,
BooksEdit
,
AuthorView
,
AuthorAddView
,
AuthorDetail
,
AuthorEdit
)
from
django.conf.urls.static
import
static
urlpatterns
=
[
path
(
'home/'
,
homeView
,
name
=
'home'
),
path
(
'books/'
,
BooksView
.
as_view
(),
name
=
"books"
),
path
(
'books/<int:pk>/details/'
,
BooksDetail
.
as_view
(),
name
=
"book_details"
),
path
(
'books/<int:pk>/edit/'
,
BooksEdit
.
as_view
(),
name
=
"book_edit"
),
path
(
'authors/'
,
AuthorView
.
as_view
(),
name
=
"authors"
),
path
(
'authors/<int:pk>/details/'
,
AuthorDetail
.
as_view
(),
name
=
"author_details"
),
#path for the forms that add
path
(
'authors/<int:pk>/edit/'
,
AuthorEdit
.
as_view
(),
name
=
"author_edit"
),
path
(
'books/add'
,
BooksAddView
.
as_view
(),
name
=
'add_books'
),
path
(
'authors/add'
,
AuthorAddView
.
as_view
(),
name
=
'add_author'
),
]
...
...
neptunesy_reading/bookshelf/views.py
View file @
5a3fd42b
...
...
@@ -40,8 +40,11 @@ class BooksDetail(DetailView):
class
BooksEdit
(
UpdateView
):
model
=
Book
fields
=
"__all__"
template_name
=
"bookshelf/edit-book.html"
success_url
=
"../details"
class
AuthorView
(
ListView
):
model
=
Author
...
...
@@ -71,4 +74,7 @@ class AuthorDetail(DetailView):
class
AuthorEdit
(
UpdateView
):
model
=
Author
fields
=
"__all__"
template_name
=
"bookshelf/edit-author.html"
success_url
=
"../details"
neptunesy_reading/db.sqlite3
View file @
5a3fd42b
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