Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rossybossy_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
Ross Batacan
rossybossy_reading
Commits
8cb26d91
Commit
8cb26d91
authored
Apr 25, 2023
by
Ross Batacan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added link Add Author on homepage and created template add-author.html
parent
679e809d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
5 deletions
+21
-5
add-author.html
...ssy_reading/bookshelf/templates/bookshelf/add-author.html
+9
-0
home.html
rossybossy_reading/bookshelf/templates/bookshelf/home.html
+2
-2
urls.py
rossybossy_reading/bookshelf/urls.py
+4
-2
views.py
rossybossy_reading/bookshelf/views.py
+6
-1
No files found.
rossybossy_reading/bookshelf/templates/bookshelf/add-author.html
0 → 100644
View file @
8cb26d91
{% extends 'base.html' %}
{% block title %}Add New Author{% endblock %}
{% block content %}
<form
method=
"POST"
>
{% csrf_token %}
{{ form.as_p }}
<input
type=
"Submit"
value=
"Add Author"
>
</form>
{% endblock %}
\ No newline at end of file
rossybossy_reading/bookshelf/templates/bookshelf/home.html
View file @
8cb26d91
...
@@ -10,6 +10,6 @@
...
@@ -10,6 +10,6 @@
&
nbsp
&
nbsp
&
nbsp
&
nbsp
&
nbsp
&
nbsp
&
nbsp
&
nbsp
<br>
<br>
<a
href=
"{% url 'bookshelf:book-add' %}"
>
Add Book
</a>
<br>
<br>
<a
href=
"{% url 'bookshelf:book-add' %}"
>
Add Book
</a>
&
nbsp
&
nbsp
&
nbsp
&
nbsp
&
nbsp
&
nbsp
&
nbsp
&
nbsp
<a
href=
"{% url 'bookshelf:author-add' %}"
>
Add Author
</a>
{% endblock %}
{% endblock %}
rossybossy_reading/bookshelf/urls.py
View file @
8cb26d91
from
django.urls
import
path
from
django.urls
import
path
from
.
import
views
from
.
import
views
from
.views
import
BooksListView
,
BooksDetailsView
,
AuthorsListView
,
AuthorDetailsView
,
BookCreateView
from
.views
import
BooksListView
,
BooksDetailsView
,
AuthorsListView
,
AuthorDetailsView
,
BookCreateView
,
AuthorCreateView
urlpatterns
=
[
urlpatterns
=
[
path
(
'home/'
,
views
.
home
,
name
=
"home"
),
path
(
'home/'
,
views
.
home
,
name
=
"home"
),
...
@@ -9,7 +9,9 @@ urlpatterns = [
...
@@ -9,7 +9,9 @@ urlpatterns = [
path
(
'books/<int:pk>/details/'
,
BooksDetailsView
.
as_view
(),
name
=
"book-detail"
),
path
(
'books/<int:pk>/details/'
,
BooksDetailsView
.
as_view
(),
name
=
"book-detail"
),
path
(
'authors/'
,
AuthorsListView
.
as_view
(),
name
=
"authors"
),
path
(
'authors/'
,
AuthorsListView
.
as_view
(),
name
=
"authors"
),
path
(
'authors/<int:pk>/details/'
,
AuthorDetailsView
.
as_view
(),
name
=
"author-detail"
),
path
(
'authors/<int:pk>/details/'
,
AuthorDetailsView
.
as_view
(),
name
=
"author-detail"
),
path
(
'books/add'
,
BookCreateView
.
as_view
(),
name
=
'book-add'
)
path
(
'books/add'
,
BookCreateView
.
as_view
(),
name
=
'book-add'
),
path
(
'authors/add'
,
AuthorCreateView
.
as_view
(),
name
=
'author-add'
),
]
]
app_name
=
'bookshelf'
app_name
=
'bookshelf'
rossybossy_reading/bookshelf/views.py
View file @
8cb26d91
...
@@ -29,4 +29,9 @@ class AuthorDetailsView(DetailView):
...
@@ -29,4 +29,9 @@ class AuthorDetailsView(DetailView):
class
BookCreateView
(
CreateView
):
class
BookCreateView
(
CreateView
):
model
=
Books
model
=
Books
fields
=
'__all__'
fields
=
'__all__'
template_name
=
'bookshelf/add-book.html'
template_name
=
'bookshelf/add-book.html'
\ No newline at end of file
class
AuthorCreateView
(
CreateView
):
model
=
Author
fields
=
'__all__'
template_name
=
'bookshelf/add-author.html'
\ No newline at end of file
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