Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GeoInt_SIDT
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
GeoInt_SIDT
Commits
e5c4e4fc
Commit
e5c4e4fc
authored
May 30, 2017
by
Mario Chirinos Colunga
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
0f006d32
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
116 additions
and
3 deletions
+116
-3
urls.cpython-35.pyc
sidtSite/catalog/__pycache__/urls.cpython-35.pyc
+0
-0
views.cpython-35.pyc
sidtSite/catalog/__pycache__/views.cpython-35.pyc
+0
-0
base_generic.html
sidtSite/catalog/templates/base_generic.html
+21
-3
author_detail.html
sidtSite/catalog/templates/catalog/author_detail.html
+18
-0
author_list.html
sidtSite/catalog/templates/catalog/author_list.html
+19
-0
book_detail.html
sidtSite/catalog/templates/catalog/book_detail.html
+23
-0
book_list.html
sidtSite/catalog/templates/catalog/book_list.html
+19
-0
urls.py
sidtSite/catalog/urls.py
+3
-0
views.py
sidtSite/catalog/views.py
+13
-0
No files found.
sidtSite/catalog/__pycache__/urls.cpython-35.pyc
View file @
e5c4e4fc
No preview for this file type
sidtSite/catalog/__pycache__/views.cpython-35.pyc
View file @
e5c4e4fc
No preview for this file type
sidtSite/catalog/templates/base_generic.html
View file @
e5c4e4fc
...
@@ -23,13 +23,31 @@
...
@@ -23,13 +23,31 @@
{% block sidebar %}
{% block sidebar %}
<ul
class=
"sidebar-nav"
>
<ul
class=
"sidebar-nav"
>
<li><a
href=
"{% url 'index' %}"
>
Home
</a></li>
<li><a
href=
"{% url 'index' %}"
>
Home
</a></li>
<li><a
href=
""
>
All books
</a></li>
<li><a
href=
"
{% url 'books' %}
"
>
All books
</a></li>
<li><a
href=
""
>
All authors
</a></li>
<li><a
href=
"
{% url 'authors' %}
"
>
All authors
</a></li>
</ul>
</ul>
{% endblock %}
{% endblock %}
</div>
</div>
<div
class=
"col-sm-10 "
>
<div
class=
"col-sm-10 "
>
{% block content %}{% endblock %}
{% block content %}{% endblock %}
{% block pagination %}
{% if is_paginated %}
<div
class=
"pagination"
>
<span
class=
"page-links"
>
{% if page_obj.has_previous %}
<a
href=
"{{ request.path }}?page={{ page_obj.previous_page_number }}"
>
previous
</a>
{% endif %}
<span
class=
"page-current"
>
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}.
</span>
{% if page_obj.has_next %}
<a
href=
"{{ request.path }}?page={{ page_obj.next_page_number }}"
>
next
</a>
{% endif %}
</span>
</div>
{% endif %}
{% endblock %}
</div>
</div>
</div>
</div>
...
...
sidtSite/catalog/templates/catalog/author_detail.html
0 → 100644
View file @
e5c4e4fc
{% extends "base_generic.html" %}
{% block content %}
<h1>
Author: {{ author.first_name}} {{ author.last_name}}
</h1>
<div
style=
"margin-left:20px;margin-top:20px"
>
<h4>
Books
</h4>
{% for book in author.book_set.all %}
<hr>
<p><strong>
Imprint:
</strong>
{{book.title}}
</p>
{% endfor %}
</div>
{% endblock %}
sidtSite/catalog/templates/catalog/author_list.html
0 → 100644
View file @
e5c4e4fc
{% extends "base_generic.html" %}
{% block content %}
<h1>
Author List
</h1>
{% if author_list %}
<ul>
{% for author in author_list %}
<li>
<a
href=
"{{ author.get_absolute_url }}"
>
{{ author.first_name}} {{author.last_name}}
</a>
({{author.date_of_birth}}-{{author.date_of_death}})
</li>
{% endfor %}
</ul>
{% else %}
<p>
There are no books in the library.
</p>
{% endif %}
{% endblock %}
sidtSite/catalog/templates/catalog/book_detail.html
0 → 100644
View file @
e5c4e4fc
{% extends "base_generic.html" %}
{% block content %}
<h1>
Title: {{ book.title }}
</h1>
<p><strong>
Author:
</strong>
<a
href=
""
>
{{ book.author }}
</a></p>
<!-- author detail link not yet defined -->
<p><strong>
Summary:
</strong>
{{ book.summary }}
</p>
<p><strong>
ISBN:
</strong>
{{ book.isbn }}
</p>
<p><strong>
Language:
</strong>
{{ book.language }}
</p>
<p><strong>
Genre:
</strong>
{% for genre in book.genre.all %} {{ genre }}{% if not forloop.last %}, {% endif %}{% endfor %}
</p>
<div
style=
"margin-left:20px;margin-top:20px"
>
<h4>
Copies
</h4>
{% for copy in book.bookinstance_set.all %}
<hr>
<p
class=
"{% if copy.status == 'a' %}text-success{% elif copy.status == 'd' %}text-danger{% else %}text-warning{% endif %}"
>
{{ copy.get_status_display }}
</p>
{% if copy.status != 'a' %}
<p><strong>
Due to be returned:
</strong>
{{copy.due_back}}
</p>
{% endif %}
<p><strong>
Imprint:
</strong>
{{copy.imprint}}
</p>
<p
class=
"text-muted"
><strong>
Id:
</strong>
{{copy.id}}
</p>
{% endfor %}
</div>
{% endblock %}
sidtSite/catalog/templates/catalog/book_list.html
0 → 100644
View file @
e5c4e4fc
{% extends "base_generic.html" %}
{% block content %}
<h1>
Book List
</h1>
{% if book_list %}
<ul>
{% for book in book_list %}
<li>
<a
href=
"{{ book.get_absolute_url }}"
>
{{ book.title }}
</a>
({{book.author}})
</li>
{% endfor %}
</ul>
{% else %}
<p>
There are no books in the library.
</p>
{% endif %}
{% endblock %}
sidtSite/catalog/urls.py
View file @
e5c4e4fc
...
@@ -6,4 +6,7 @@ from . import views
...
@@ -6,4 +6,7 @@ from . import views
urlpatterns
=
[
urlpatterns
=
[
url
(
r'^$'
,
views
.
index
,
name
=
'index'
),
url
(
r'^$'
,
views
.
index
,
name
=
'index'
),
url
(
r'^books/$'
,
views
.
BookListView
.
as_view
(),
name
=
'books'
),
url
(
r'^books/$'
,
views
.
BookListView
.
as_view
(),
name
=
'books'
),
url
(
r'^authors/$'
,
views
.
AuthorListView
.
as_view
(),
name
=
'authors'
),
url
(
r'^book/(?P<pk>\d+)$'
,
views
.
BookDetailView
.
as_view
(),
name
=
'book-detail'
),
url
(
r'^authors/(?P<pk>\d+)$'
,
views
.
AuthorDetailView
.
as_view
(),
name
=
'author-detail'
),
]
]
sidtSite/catalog/views.py
View file @
e5c4e4fc
...
@@ -26,3 +26,16 @@ def index(request):
...
@@ -26,3 +26,16 @@ def index(request):
class
BookListView
(
generic
.
ListView
):
class
BookListView
(
generic
.
ListView
):
model
=
Book
model
=
Book
paginate_by
=
10
class
BookDetailView
(
generic
.
DetailView
):
model
=
Book
class
AuthorListView
(
generic
.
ListView
):
model
=
Author
paginate_by
=
10
class
AuthorDetailView
(
generic
.
DetailView
):
model
=
Author
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