Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
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
captainwong
douban-api-proxy
Commits
2929d95b
Commit
2929d95b
authored
Jul 08, 2017
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display all authors names in shelf, like on all other pages (#202)
parent
aed626b9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
shelf.html
cps/templates/shelf.html
+8
-3
web.py
cps/web.py
+7
-3
No files found.
cps/templates/shelf.html
View file @
2929d95b
...
@@ -22,9 +22,14 @@
...
@@ -22,9 +22,14 @@
</div>
</div>
<div
class=
"meta"
>
<div
class=
"meta"
>
<p
class=
"title"
>
{{entry.title|shortentitle}}
</p>
<p
class=
"title"
>
{{entry.title|shortentitle}}
</p>
{% if entry.authors|length > 0 %}
<p
class=
"author"
>
<p
class=
"author"
><a
href=
"{{url_for('author', book_id=entry.authors[0].id) }}"
>
{{entry.authors[0].name}}
</a></p>
{% for author in entry.authors %}
{% endif %}
<a
href=
"{{url_for('author', book_id=author.id) }}"
>
{{author.name}}
</a>
{% if not loop.last %}
&
{% endif %}
{% endfor %}
</p>
{% if entry.ratings.__len__() > 0 %}
{% if entry.ratings.__len__() > 0 %}
<div
class=
"rating"
>
<div
class=
"rating"
>
{% for number in range((entry.ratings[0].rating/2)|int(2)) %}
{% for number in range((entry.ratings[0].rating/2)|int(2)) %}
...
...
cps/web.py
View file @
2929d95b
...
@@ -1979,15 +1979,19 @@ def show_shelf(shelf_id):
...
@@ -1979,15 +1979,19 @@ def show_shelf(shelf_id):
ub
.
and_
(
ub
.
Shelf
.
is_public
==
1
,
ub
.
and_
(
ub
.
Shelf
.
is_public
==
1
,
ub
.
Shelf
.
id
==
shelf_id
)))
.
first
()
ub
.
Shelf
.
id
==
shelf_id
)))
.
first
()
result
=
list
()
result
=
list
()
# user is allowed to access shelf
if
shelf
:
if
shelf
:
books_in_shelf
=
ub
.
session
.
query
(
ub
.
BookShelf
)
.
filter
(
ub
.
BookShelf
.
shelf
==
shelf_id
)
.
order_by
(
books_in_shelf
=
ub
.
session
.
query
(
ub
.
BookShelf
)
.
filter
(
ub
.
BookShelf
.
shelf
==
shelf_id
)
.
order_by
(
ub
.
BookShelf
.
order
.
asc
())
.
all
()
ub
.
BookShelf
.
order
.
asc
())
.
all
()
for
book
in
books_in_shelf
:
for
book
in
books_in_shelf
:
cur_book
=
db
.
session
.
query
(
db
.
Books
)
.
filter
(
db
.
Books
.
id
==
book
.
book_id
)
.
first
()
cur_book
=
db
.
session
.
query
(
db
.
Books
)
.
filter
(
db
.
Books
.
id
==
book
.
book_id
)
.
first
()
result
.
append
(
cur_book
)
result
.
append
(
cur_book
)
return
render_title_template
(
'shelf.html'
,
entries
=
result
,
title
=
_
(
u"Shelf: '
%(name)
s'"
,
name
=
shelf
.
name
),
return
render_title_template
(
'shelf.html'
,
entries
=
result
,
title
=
_
(
u"Shelf: '
%(name)
s'"
,
name
=
shelf
.
name
),
shelf
=
shelf
)
shelf
=
shelf
)
else
:
flash
(
_
(
u"Error opening shelf. Shelf does not exist or file is not accessible"
),
category
=
"error"
)
return
redirect
(
url_for
(
"index"
))
@
app
.
route
(
"/shelf/order/<int:shelf_id>"
,
methods
=
[
"GET"
,
"POST"
])
@
app
.
route
(
"/shelf/order/<int:shelf_id>"
,
methods
=
[
"GET"
,
"POST"
])
...
@@ -2673,7 +2677,7 @@ def edit_book(book_id):
...
@@ -2673,7 +2677,7 @@ def edit_book(book_id):
return
render_title_template
(
'book_edit.html'
,
book
=
book
,
authors
=
author_names
,
cc
=
cc
,
return
render_title_template
(
'book_edit.html'
,
book
=
book
,
authors
=
author_names
,
cc
=
cc
,
title
=
_
(
u"edit metadata"
))
title
=
_
(
u"edit metadata"
))
else
:
else
:
flash
(
_
(
u"Error opening eBook. File does not exist or file is not accessible
:
"
),
category
=
"error"
)
flash
(
_
(
u"Error opening eBook. File does not exist or file is not accessible"
),
category
=
"error"
)
return
redirect
(
url_for
(
"index"
))
return
redirect
(
url_for
(
"index"
))
...
...
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