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
c56a02ba
Commit
c56a02ba
authored
Sep 30, 2017
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #339
parent
031a1754
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
14 additions
and
12 deletions
+14
-12
author.html
cps/templates/author.html
+3
-3
detail.html
cps/templates/detail.html
+1
-1
index.html
cps/templates/index.html
+1
-1
json.txt
cps/templates/json.txt
+2
-2
search.html
cps/templates/search.html
+1
-1
shelf.html
cps/templates/shelf.html
+1
-1
web.py
cps/web.py
+5
-3
No files found.
cps/templates/author.html
View file @
c56a02ba
...
...
@@ -39,7 +39,7 @@
<p
class=
"title"
>
{{entry.title|shortentitle}}
</p>
<p
class=
"author"
>
{% for author in entry.authors %}
<a
href=
"{{url_for('author', book_id=author.id) }}"
>
{{author.name}}
</a>
<a
href=
"{{url_for('author', book_id=author.id) }}"
>
{{author.name
.replace('|',',')
}}
</a>
{% if not loop.last %}
&
{% endif %}
...
...
@@ -66,7 +66,7 @@
{% if other_books %}
<div
class=
"discover"
>
<h3>
{{_("More by")}} {{ author.name|safe }}
</h3>
<h3>
{{_("More by")}} {{ author.name
.replace('|',',')
|safe }}
</h3>
<div
class=
"row"
>
{% for entry in other_books %}
<div
class=
"col-sm-3 col-lg-2 col-xs-6 book"
>
...
...
@@ -80,7 +80,7 @@
<p
class=
"author"
>
{% for author in entry.authors %}
<a
href=
"https://www.goodreads.com/author/show/{{ author.gid }}"
target=
"_blank"
rel=
"noopener"
>
{{author.name}}
{{author.name
.replace('|',',')
}}
</a>
{% if not loop.last %}
&
...
...
cps/templates/detail.html
View file @
c56a02ba
...
...
@@ -62,7 +62,7 @@
<h2>
{{entry.title}}
</h2>
<p
class=
"author"
>
{% for author in entry.authors %}
<a
href=
"{{url_for('author', book_id=author.id ) }}"
>
{{author.name}}
</a>
<a
href=
"{{url_for('author', book_id=author.id ) }}"
>
{{author.name
.replace('|',',')
}}
</a>
{% if not loop.last %}
&
{% endif %}
...
...
cps/templates/index.html
View file @
c56a02ba
...
...
@@ -56,7 +56,7 @@
<p
class=
"title"
>
{{entry.title|shortentitle}}
</p>
<p
class=
"author"
>
{% for author in entry.authors %}
<a
href=
"{{url_for('author', book_id=author.id) }}"
>
{{author.name}}
</a>
<a
href=
"{{url_for('author', book_id=author.id) }}"
>
{{author.name
.replace('|',',')
}}
</a>
{% if not loop.last %}
&
{% endif %}
...
...
cps/templates/json.txt
View file @
c56a02ba
...
...
@@ -41,7 +41,7 @@
"rating":{% if entry.ratings.__len__() > 0 %} "{{entry.ratings[0].rating}}.0"{% else %}0.0{% endif %},
"authors": [
{% for author in entry.authors %}
"{{author.name}}"{% if not loop.last %},{% endif %}
"{{author.name
.replace('|',',')
}}"{% if not loop.last %},{% endif %}
{% endfor %}
],
"other_formats": {
...
...
cps/templates/search.html
View file @
c56a02ba
...
...
@@ -24,7 +24,7 @@
<p
class=
"title"
>
{{entry.title|shortentitle}}
</p>
<p
class=
"author"
>
{% for author in entry.authors %}
<a
href=
"{{url_for('author', book_id=author.id ) }}"
>
{{author.name}}
</a>
<a
href=
"{{url_for('author', book_id=author.id ) }}"
>
{{author.name
.replace('|',',')
}}
</a>
{% if not loop.last %}
&
{% endif %}
...
...
cps/templates/shelf.html
View file @
c56a02ba
...
...
@@ -24,7 +24,7 @@
<p
class=
"title"
>
{{entry.title|shortentitle}}
</p>
<p
class=
"author"
>
{% for author in entry.authors %}
<a
href=
"{{url_for('author', book_id=author.id) }}"
>
{{author.name}}
</a>
<a
href=
"{{url_for('author', book_id=author.id) }}"
>
{{author.name
.replace('|',',')
}}
</a>
{% if not loop.last %}
&
{% endif %}
...
...
cps/web.py
View file @
c56a02ba
...
...
@@ -1122,6 +1122,8 @@ def author_list():
entries
=
db
.
session
.
query
(
db
.
Authors
,
func
.
count
(
'books_authors_link.book'
)
.
label
(
'count'
))
\
.
join
(
db
.
books_authors_link
)
.
join
(
db
.
Books
)
.
filter
(
common_filters
())
\
.
group_by
(
'books_authors_link.author'
)
.
order_by
(
db
.
Authors
.
sort
)
.
all
()
for
entry
in
entries
:
entry
.
Authors
.
name
=
entry
.
Authors
.
name
.
replace
(
'|'
,
','
)
return
render_title_template
(
'list.html'
,
entries
=
entries
,
folder
=
'author'
,
title
=
_
(
u"Author list"
))
...
...
@@ -1135,7 +1137,7 @@ def author(book_id, page):
flash
(
_
(
u"Error opening eBook. File does not exist or file is not accessible:"
),
category
=
"error"
)
return
redirect
(
url_for
(
"index"
))
name
=
db
.
session
.
query
(
db
.
Authors
)
.
filter
(
db
.
Authors
.
id
==
book_id
)
.
first
()
.
name
name
=
(
db
.
session
.
query
(
db
.
Authors
)
.
filter
(
db
.
Authors
.
id
==
book_id
)
.
first
()
.
name
)
.
replace
(
'|'
,
','
)
author_info
=
None
other_books
=
[]
...
...
@@ -2740,7 +2742,7 @@ def edit_book(book_id):
except
Exception
:
book
.
languages
[
index
]
.
language_name
=
_
(
isoLanguages
.
get
(
part3
=
book
.
languages
[
index
]
.
lang_code
)
.
name
)
for
author
in
book
.
authors
:
author_names
.
append
(
author
.
name
)
author_names
.
append
(
author
.
name
.
replace
(
'|'
,
','
)
)
# Show form
if
request
.
method
!=
'POST'
:
...
...
@@ -2783,7 +2785,7 @@ def edit_book(book_id):
book
.
title
=
to_save
[
"book_title"
]
edited_books_id
.
add
(
book
.
id
)
input_authors
=
to_save
[
"author_name"
]
.
split
(
'&'
)
input_authors
=
map
(
lambda
it
:
it
.
strip
(),
input_authors
)
input_authors
=
map
(
lambda
it
:
it
.
strip
()
.
replace
(
','
,
'|'
)
,
input_authors
)
# we have all author names now
if
input_authors
==
[
''
]:
input_authors
=
[
_
(
u'unknown'
)]
# prevent empty 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