Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
eldondagdag_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
Eldon Dagdag
eldondagdag_reading
Commits
f316a682
Commit
f316a682
authored
Apr 25, 2023
by
Eldon Dagdag
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add/Update features for Book/Author models created
parent
c1b179a7
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
61 additions
and
9 deletions
+61
-9
forms.py
eldondagdag_reading/bookshelf/forms.py
+12
-0
add-author.html
...dag_reading/bookshelf/templates/bookshelf/add-author.html
+11
-2
add-book.html
...agdag_reading/bookshelf/templates/bookshelf/add-book.html
+11
-2
author_details.html
...reading/bookshelf/templates/bookshelf/author_details.html
+2
-0
book_details.html
...g_reading/bookshelf/templates/bookshelf/book_details.html
+1
-0
edit-author.html
...ag_reading/bookshelf/templates/bookshelf/edit-author.html
+11
-2
edit-book.html
...gdag_reading/bookshelf/templates/bookshelf/edit-book.html
+11
-2
home.html
eldondagdag_reading/bookshelf/templates/bookshelf/home.html
+2
-1
No files found.
eldondagdag_reading/bookshelf/forms.py
0 → 100644
View file @
f316a682
from
django
import
forms
from
.models
import
Book
,
Author
class
BookForm
(
forms
.
ModelForm
):
class
Meta
:
model
=
Book
fields
=
'__all__'
class
AuthorForm
(
forms
.
ModelForm
):
class
Meta
:
model
=
Author
fields
=
'__all__'
\ No newline at end of file
eldondagdag_reading/bookshelf/templates/bookshelf/add-author.html
View file @
f316a682
{% extends 'base.html' %}
{% extends 'base.html' %}
{% load static %}
{% load static %}
{% block title %} {{ object.first_name }} {{ object.last_name }}{% endblock %}
{% block title %}Add New Author{% endblock %}
{% block content %}
{% block content %}
\ No newline at end of file
<br>
<form
method=
"post"
>
{% csrf_token %}
{% for field in form %}
{{ field.label }}: {{ field }}
<br>
{% endfor %}
<input
type=
"submit"
value=
"Add Author"
>
</form>
{% endblock %}
\ No newline at end of file
eldondagdag_reading/bookshelf/templates/bookshelf/add-book.html
View file @
f316a682
{% extends 'base.html' %}
{% extends 'base.html' %}
{% load static %}
{% load static %}
{% block title %} {{ object.first_name }} {{ object.last_name }}{% endblock %}
{% block title %}Add New Book{% endblock %}
{% block content %}
{% block content %}
\ No newline at end of file
<br>
<form
method=
"post"
>
{% csrf_token %}
{% for field in form %}
{{ field.label }}: {{ field }}
<br>
{% endfor %}
<input
type=
"submit"
value=
"Add Book"
>
</form>
{% endblock %}
\ No newline at end of file
eldondagdag_reading/bookshelf/templates/bookshelf/author_details.html
View file @
f316a682
...
@@ -9,6 +9,8 @@
...
@@ -9,6 +9,8 @@
<h3>
Nationality: {{ object.nationality }}
</h3>
<h3>
Nationality: {{ object.nationality }}
</h3>
<h3>
Biography: {{ object.bio }}
</h3>
<h3>
Biography: {{ object.bio }}
</h3>
<a
href=
"/bookshelf/authors/{{ object.pk }}/edit/"
>
Edit Author
</a>
<h2>
Books by {{ object.first_name }} {{ object.last_name }} I love:
</h2>
<h2>
Books by {{ object.first_name }} {{ object.last_name }} I love:
</h2>
<ul>
<ul>
{% for book in object.books.all %}
{% for book in object.books.all %}
...
...
eldondagdag_reading/bookshelf/templates/bookshelf/book_details.html
View file @
f316a682
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
<h3>
Published in {{ object.year_published }}
</h3>
<h3>
Published in {{ object.year_published }}
</h3>
<h3>
ISBN: {{ object.ISBN }}
</h3>
<h3>
ISBN: {{ object.ISBN }}
</h3>
<h3>
"{{ object.blurb }}"
</h3>
<h3>
"{{ object.blurb }}"
</h3>
<a
href=
"/bookshelf/books/{{ object.pk }}/edit/"
>
Edit Book
</a>
</body>
</body>
<br>
<br>
<div
class=
"container space-evenly"
>
<div
class=
"container space-evenly"
>
...
...
eldondagdag_reading/bookshelf/templates/bookshelf/edit-author.html
View file @
f316a682
{% extends 'base.html' %}
{% extends 'base.html' %}
{% load static %}
{% load static %}
{% block title %} {{ object.first_name }} {{ object.last_name }}{% endblock %}
{% block title %}Edit Author{% endblock %}
{% block content %}
{% block content %}
\ No newline at end of file
<br>
<form
method=
"post"
>
{% csrf_token %}
{% for field in form %}
{{ field.label }}: {{ field }}
<br>
{% endfor %}
<input
type=
"submit"
value=
"Save Changes"
>
</form>
{% endblock %}
\ No newline at end of file
eldondagdag_reading/bookshelf/templates/bookshelf/edit-book.html
View file @
f316a682
{% extends 'base.html' %}
{% extends 'base.html' %}
{% load static %}
{% load static %}
{% block title %} {{ object.first_name }} {{ object.last_name }}{% endblock %}
{% block title %}Edit Book{% endblock %}
{% block content %}
{% block content %}
\ No newline at end of file
<br>
<form
method=
"post"
>
{% csrf_token %}
{% for field in form %}
{{ field.label }}: {{ field }}
<br>
{% endfor %}
<input
type=
"submit"
value=
"Save Changes"
>
</form>
{% endblock %}
\ No newline at end of file
eldondagdag_reading/bookshelf/templates/bookshelf/home.html
View file @
f316a682
...
@@ -8,7 +8,8 @@
...
@@ -8,7 +8,8 @@
<div
class=
"container space-evenly"
>
<div
class=
"container space-evenly"
>
<a
href=
"/bookshelf/books/"
>
Books
</a>
<a
href=
"/bookshelf/books/"
>
Books
</a>
<a
href=
"/bookshelf/authors/"
>
Authors
</a>
<a
href=
"/bookshelf/authors/"
>
Authors
</a>
<br>
</div>
<div
class=
"container space-evenly"
>
<a
href=
"/bookshelf/books/add/"
>
Add Book
</a>
<a
href=
"/bookshelf/books/add/"
>
Add Book
</a>
<a
href=
"/bookshelf/authors/add/"
>
Add Author
</a>
<a
href=
"/bookshelf/authors/add/"
>
Add Author
</a>
</div>
</div>
...
...
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