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
33b5ff59
Commit
33b5ff59
authored
Apr 24, 2023
by
Mavrick Jordan Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated homepage. Added AddNewBookPage and AddNewAuthorPage.
parent
93f8fdf4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
3 deletions
+40
-3
add-author.html
mavlee_reading/bookshelf/templates/bookshelf/add-author.html
+9
-0
add-book.html
mavlee_reading/bookshelf/templates/bookshelf/add-book.html
+9
-0
home.html
mavlee_reading/bookshelf/templates/bookshelf/home.html
+4
-1
urls.py
mavlee_reading/bookshelf/urls.py
+6
-1
views.py
mavlee_reading/bookshelf/views.py
+12
-1
db.sqlite3
mavlee_reading/db.sqlite3
+0
-0
No files found.
mavlee_reading/bookshelf/templates/bookshelf/add-author.html
0 → 100644
View file @
33b5ff59
{% 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
mavlee_reading/bookshelf/templates/bookshelf/add-book.html
0 → 100644
View file @
33b5ff59
{% extends 'base.html' %}
{% block title %}Add New Book{% endblock %}
{% block content %}
<form
method=
"POST"
>
{% csrf_token %}
{{ form.as_p }}
<input
type=
"Submit"
value=
"Add Book"
>
</form>
{% endblock %}
\ No newline at end of file
mavlee_reading/bookshelf/templates/bookshelf/home.html
View file @
33b5ff59
...
...
@@ -5,5 +5,8 @@
<p>
Mav like Japanese manga with authors that writes in a serious tone.
</p>
<a
href=
"{% url 'bookshelf:books' %}"
>
Books
</a>
&
nbsp
&
nbsp
&
nbsp
&
nbsp
&
nbsp
&
nbsp
&
nbsp
&
nbsp
<a
href=
"{% url 'bookshelf:authors' %}"
>
Authors
</a>
<a
href=
"{% url 'bookshelf:authors' %}"
>
Authors
</a><br>
<a
href=
"{% url 'bookshelf:add-book' %}"
>
Add Book
</a>
&
nbsp
&
nbsp
&
nbsp
&
nbsp
&
nbsp
&
nbsp
&
nbsp
&
nbsp
<a
href=
"{% url 'bookshelf:add-author' %}"
>
Add Author
</a>
{% endblock %}
\ No newline at end of file
mavlee_reading/bookshelf/urls.py
View file @
33b5ff59
from
django.urls
import
path
from
.
import
views
from
.views
import
BooksListView
,
BookDetailsView
,
AuthorsListView
,
AuthorDetailsView
from
.views
import
(
BooksListView
,
BookDetailsView
,
AuthorsListView
,
AuthorDetailsView
,
BookCreateView
,
AuthorCreateView
)
urlpatterns
=
[
path
(
'home/'
,
views
.
home_view
,
name
=
"home"
),
...
...
@@ -9,6 +12,8 @@ urlpatterns = [
path
(
'books/<int:pk>/details/'
,
BookDetailsView
.
as_view
(),
name
=
"book-detail"
),
path
(
'authors/'
,
AuthorsListView
.
as_view
(),
name
=
"authors"
),
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"
),
]
app_name
=
'bookshelf'
\ No newline at end of file
mavlee_reading/bookshelf/views.py
View file @
33b5ff59
from
django.shortcuts
import
render
from
django.views.generic.list
import
ListView
from
django.views.generic.detail
import
DetailView
from
django.views.generic.edit
import
CreateView
,
UpdateView
from
.models
import
Author
,
Book
...
...
@@ -23,4 +24,14 @@ class AuthorsListView(ListView):
class
AuthorDetailsView
(
DetailView
):
model
=
Author
template_name
=
'bookshelf/author_details.html'
\ No newline at end of file
template_name
=
'bookshelf/author_details.html'
class
BookCreateView
(
CreateView
):
model
=
Book
fields
=
'__all__'
template_name
=
'bookshelf/add-book.html'
class
AuthorCreateView
(
CreateView
):
model
=
Author
fields
=
'__all__'
template_name
=
'bookshelf/add-author.html'
\ No newline at end of file
mavlee_reading/db.sqlite3
View file @
33b5ff59
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