Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
garethcastillo_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
Gareth Xerxes Yap Castillo
garethcastillo_reading
Commits
53fd3492
Commit
53fd3492
authored
Mar 28, 2023
by
Gareth Xerxes Yap Castillo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add base.html and add other html files
parent
dc38eaf9
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
55 additions
and
7 deletions
+55
-7
urls.cpython-39.pyc
...astillo_reading/bookshelf/__pycache__/urls.cpython-39.pyc
+0
-0
views.cpython-39.pyc
...stillo_reading/bookshelf/__pycache__/views.cpython-39.pyc
+0
-0
authors.html
...stillo_reading/bookshelf/templates/bookshelf/authors.html
+15
-0
books.html
...castillo_reading/bookshelf/templates/bookshelf/books.html
+15
-0
home.html
...hcastillo_reading/bookshelf/templates/bookshelf/home.html
+2
-1
urls.py
garethcastillo_reading/bookshelf/urls.py
+6
-2
views.py
garethcastillo_reading/bookshelf/views.py
+15
-2
settings.cpython-39.pyc
...arethcastillo_reading/__pycache__/settings.cpython-39.pyc
+0
-0
urls.cpython-39.pyc
...ng/garethcastillo_reading/__pycache__/urls.cpython-39.pyc
+0
-0
base.html
garethcastillo_reading/templates/base.html
+2
-2
No files found.
garethcastillo_reading/bookshelf/__pycache__/urls.cpython-39.pyc
View file @
53fd3492
No preview for this file type
garethcastillo_reading/bookshelf/__pycache__/views.cpython-39.pyc
View file @
53fd3492
No preview for this file type
garethcastillo_reading/bookshelf/templates/bookshelf/authors.html
View file @
53fd3492
{% extends 'base.html' %}
{% load static %}
{% block title %}My Favorite Authors:{% endblock %}
{% block content %}
<h1>
Gareth's Favorite Authors:
</h1>
<ol>
{% for object in object_list %}
<li><a
href =
"authors/{{ object.id }}/details/"
>
{{ object.first_name }}, {{ object.last_name }}
</a></li>
{% empty %}
<li>
No books registered.
</li>
{% endfor %}
</ol>
{% endblock %}
\ No newline at end of file
garethcastillo_reading/bookshelf/templates/bookshelf/books.html
View file @
53fd3492
{% extends 'base.html' %}
{% load static %}
{% block title %}My Favorite Books:{% endblock %}
{% block content %}
<h1>
Gareth's Favorite Books:
</h1>
<ol>
{% for object in object_list %}
<li><a
href =
"books/{{ object.id }}/details/"
>
{{ object.title }}
</a></li>
{% empty %}
<li>
No books registered.
</li>
{% endfor %}
</ol>
{% endblock %}
\ No newline at end of file
garethcastillo_reading/bookshelf/templates/bookshelf/home.html
View file @
53fd3492
...
@@ -4,5 +4,6 @@
...
@@ -4,5 +4,6 @@
{% block title %}My Favorite Books and Authors{% endblock %}
{% block title %}My Favorite Books and Authors{% endblock %}
{% block content %}
{% block content %}
<h1>
Hello World. This is the content
</h1>
<h1>
Welcome to Gareth's Database of Favorite Books and Authors!
</h1>
<p>
I enjoy a variety of genres, no specific one, as long as it is good.
</p>
{% endblock %}
{% endblock %}
\ No newline at end of file
garethcastillo_reading/bookshelf/urls.py
View file @
53fd3492
from
django.urls
import
path
from
django.urls
import
path
from
.
views
import
index
from
.
import
views
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
index
,
name
=
'index'
),
path
(
'home/'
,
views
.
homepage_view
,
name
=
'home'
),
path
(
'books/'
,
views
.
book_view
.
as_view
(),
name
=
'books'
),
path
(
'authors/'
,
views
.
author_view
.
as_view
(),
name
=
'authors'
),
#path('book_details/', views.homepage_view, name='home'),
#path('author_details/', views.homepage_view, name='home'),
]
]
app_name
=
"bookshelf"
app_name
=
"bookshelf"
\ No newline at end of file
garethcastillo_reading/bookshelf/views.py
View file @
53fd3492
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
django.shortcuts
import
render
from
django.views
import
View
from
.models
import
Author
,
Books
def
index
(
request
):
def
homepage_view
(
request
):
return
HttpResponse
(
"Welcome to Gareth's Music Library!"
)
return
render
(
request
,
'bookshelf/home.html'
)
\ No newline at end of file
class
book_view
(
View
):
def
get
(
self
,
request
):
book
=
Books
.
objects
.
order_by
(
"title"
)
return
render
(
request
,
'bookshelf/books.html'
,
{
'object_list'
:
book
})
class
author_view
(
View
):
def
get
(
self
,
request
):
name
=
Author
.
objects
.
order_by
(
"first_name"
)
return
render
(
request
,
'bookshelf/authors.html'
,
{
'object_list'
:
name
})
\ No newline at end of file
garethcastillo_reading/garethcastillo_reading/__pycache__/settings.cpython-39.pyc
View file @
53fd3492
No preview for this file type
garethcastillo_reading/garethcastillo_reading/__pycache__/urls.cpython-39.pyc
View file @
53fd3492
No preview for this file type
garethcastillo_reading/templates/base.html
View file @
53fd3492
<html
lang=
"en"
>
<html
lang=
"en"
>
<head>
<head>
<
link
rel=
"stylesheet"
href=
"style.css"
>
<
!--<link rel="stylesheet" href="style.css">--
>
<title>
{% block title %}My amazing site{% endblock %}
</title>
<title>
{% block title %}My amazing site{% endblock %}
</title>
{% block styles %}{% endblock %}
{% block styles %}{% endblock %}
</head>
</head>
...
...
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