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
15aa49e1
Commit
15aa49e1
authored
Feb 25, 2019
by
Virgil Grigoras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shorten authors in author / discover / index / search and shelf
parent
3272b4ca
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
88 additions
and
26 deletions
+88
-26
author.html
cps/templates/author.html
+23
-11
discover.html
cps/templates/discover.html
+13
-3
index.html
cps/templates/index.html
+26
-6
search.html
cps/templates/search.html
+13
-3
shelf.html
cps/templates/shelf.html
+13
-3
No files found.
cps/templates/author.html
View file @
15aa49e1
...
@@ -41,10 +41,20 @@
...
@@ -41,10 +41,20 @@
</a>
</a>
<p
class=
"author"
>
<p
class=
"author"
>
{% for author in entry.authors %}
{% for author in entry.authors %}
<a
href=
"{{url_for('author', book_id=author.id) }}"
>
{{author.name.replace('|',',')}}
</a>
{% if loop.index > config_authors_max and config_authors_max != 0 %}
{% if not loop.last %}
{% if not loop.first %}
&
<span
class=
"author-hidden-divider"
>
&
</span>
{% endif %}
{% endif %}
<a
class=
"author-name author-hidden"
href=
"{{url_for('author', book_id=author.id) }}"
>
{{author.name.replace('|',',')|shortentitle(30)}}
</a>
{% if loop.last %}
<a
href=
"#"
class=
"author-expand"
data-authors-max=
"{{config_authors_max}}"
data-collapse-caption=
"({{_('reduce')}})"
>
(...)
</a>
{% endif %}
{% else %}
{% if not loop.first %}
<span>
&
</span>
{% endif %}
<a
class=
"author-name"
href=
"{{url_for('author', book_id=author.id) }}"
>
{{author.name.replace('|',',')|shortentitle(30)}}
</a>
{% endif %}
{% endfor %}
{% endfor %}
</p>
</p>
{% if entry.ratings.__len__() > 0 %}
{% if entry.ratings.__len__() > 0 %}
...
@@ -80,13 +90,15 @@
...
@@ -80,13 +90,15 @@
<div
class=
"meta"
>
<div
class=
"meta"
>
<p
class=
"title"
>
{{entry.title|shortentitle}}
</p>
<p
class=
"title"
>
{{entry.title|shortentitle}}
</p>
<p
class=
"author"
>
<p
class=
"author"
>
{% for author in entry.authors %}
{% for author in entry.authors %}
<a
href=
"https://www.goodreads.com/author/show/{{ author.gid }}"
target=
"_blank"
rel=
"noopener"
>
{% if loop.index > config_authors_max and config_authors_max != 0 %}
{{author.name.replace('|',',')}}
<a
class=
"author-name author-hidden"
href=
"https://www.goodreads.com/author/show/{{ author.gid }}"
target=
"_blank"
rel=
"noopener"
>
{{author.name.replace('|',',')}}
</a>
</a>
{% if loop.last %}
{% if not loop.last %}
<a
href=
"#"
class=
"author-expand"
data-authors-max=
"{{config_authors_max}}"
data-collapse-caption=
"({{_('reduce')}})"
>
(...)
</a>
&
{% endif %}
{% endif %}
{% else %}
<a
class=
"author-name"
href=
"https://www.goodreads.com/author/show/{{ author.gid }}"
target=
"_blank"
rel=
"noopener"
>
{{author.name.replace('|',',')}}
</a>
{% endif %}
{% endfor %}
{% endfor %}
</p>
</p>
<div
class=
"rating"
>
<div
class=
"rating"
>
...
...
cps/templates/discover.html
View file @
15aa49e1
...
@@ -19,9 +19,19 @@
...
@@ -19,9 +19,19 @@
</a>
</a>
<p
class=
"author"
>
<p
class=
"author"
>
{% for author in entry.authors %}
{% for author in entry.authors %}
<a
href=
"{{url_for('author', book_id=author.id) }}"
>
{{author.name.replace('|',',')|shortentitle(30)}}
</a>
{% if loop.index > config_authors_max and config_authors_max != 0 %}
{% if not loop.last %}
{% if not loop.first %}
&
<span
class=
"author-hidden-divider"
>
&
</span>
{% endif %}
<a
class=
"author-name author-hidden"
href=
"{{url_for('author', book_id=author.id) }}"
>
{{author.name.replace('|',',')|shortentitle(30)}}
</a>
{% if loop.last %}
<a
href=
"#"
class=
"author-expand"
data-authors-max=
"{{config_authors_max}}"
data-collapse-caption=
"({{_('reduce')}})"
>
(...)
</a>
{% endif %}
{% else %}
{% if not loop.first %}
<span>
&
</span>
{% endif %}
<a
class=
"author-name"
href=
"{{url_for('author', book_id=author.id) }}"
>
{{author.name.replace('|',',')|shortentitle(30)}}
</a>
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
</p>
</p>
...
...
cps/templates/index.html
View file @
15aa49e1
...
@@ -22,9 +22,19 @@
...
@@ -22,9 +22,19 @@
</a>
</a>
<p
class=
"author"
>
<p
class=
"author"
>
{% for author in entry.authors %}
{% for author in entry.authors %}
<a
href=
"{{url_for('author', book_id=author.id) }}"
>
{{author.name.replace('|',',')|shortentitle(30)}}
</a>
{% if loop.index > config_authors_max and config_authors_max != 0 %}
{% if not loop.last %}
{% if not loop.first %}
&
<span
class=
"author-hidden-divider"
>
&
</span>
{% endif %}
<a
class=
"author-name author-hidden"
href=
"{{url_for('author', book_id=author.id) }}"
>
{{author.name.replace('|',',')|shortentitle(30)}}
</a>
{% if loop.last %}
<a
href=
"#"
class=
"author-expand"
data-authors-max=
"{{config_authors_max}}"
data-collapse-caption=
"({{_('reduce')}})"
>
(...)
</a>
{% endif %}
{% else %}
{% if not loop.first %}
<span>
&
</span>
{% endif %}
<a
class=
"author-name"
href=
"{{url_for('author', book_id=author.id) }}"
>
{{author.name.replace('|',',')|shortentitle(30)}}
</a>
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
</p>
</p>
...
@@ -67,9 +77,19 @@
...
@@ -67,9 +77,19 @@
</a>
</a>
<p
class=
"author"
>
<p
class=
"author"
>
{% for author in entry.authors %}
{% for author in entry.authors %}
<a
href=
"{{url_for('author', book_id=author.id) }}"
>
{{author.name.replace('|',',')|shortentitle(30)}}
</a>
{% if loop.index > config_authors_max and config_authors_max != 0 %}
{% if not loop.last %}
{% if not loop.first %}
&
<span
class=
"author-hidden-divider"
>
&
</span>
{% endif %}
<a
class=
"author-name author-hidden"
href=
"{{url_for('author', book_id=author.id) }}"
>
{{author.name.replace('|',',')|shortentitle(30)}}
</a>
{% if loop.last %}
<a
href=
"#"
class=
"author-expand"
data-authors-max=
"{{config_authors_max}}"
data-collapse-caption=
"({{_('reduce')}})"
>
(...)
</a>
{% endif %}
{% else %}
{% if not loop.first %}
<span>
&
</span>
{% endif %}
<a
class=
"author-name"
href=
"{{url_for('author', book_id=author.id) }}"
>
{{author.name.replace('|',',')|shortentitle(30)}}
</a>
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
</p>
</p>
...
...
cps/templates/search.html
View file @
15aa49e1
...
@@ -46,9 +46,19 @@
...
@@ -46,9 +46,19 @@
</a>
</a>
<p
class=
"author"
>
<p
class=
"author"
>
{% for author in entry.authors %}
{% for author in entry.authors %}
<a
href=
"{{url_for('author', book_id=author.id ) }}"
>
{{author.name.replace('|',',')}}
</a>
{% if loop.index > config_authors_max and config_authors_max != 0 %}
{% if not loop.last %}
{% if not loop.first %}
&
<span
class=
"author-hidden-divider"
>
&
</span>
{% endif %}
<a
class=
"author-name author-hidden"
href=
"{{url_for('author', book_id=author.id) }}"
>
{{author.name.replace('|',',')|shortentitle(30)}}
</a>
{% if loop.last %}
<a
href=
"#"
class=
"author-expand"
data-authors-max=
"{{config_authors_max}}"
data-collapse-caption=
"({{_('reduce')}})"
>
(...)
</a>
{% endif %}
{% else %}
{% if not loop.first %}
<span>
&
</span>
{% endif %}
<a
class=
"author-name"
href=
"{{url_for('author', book_id=author.id) }}"
>
{{author.name.replace('|',',')|shortentitle(30)}}
</a>
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
</p>
</p>
...
...
cps/templates/shelf.html
View file @
15aa49e1
...
@@ -28,9 +28,19 @@
...
@@ -28,9 +28,19 @@
</a>
</a>
<p
class=
"author"
>
<p
class=
"author"
>
{% for author in entry.authors %}
{% for author in entry.authors %}
<a
href=
"{{url_for('author', book_id=author.id) }}"
>
{{author.name.replace('|',',')}}
</a>
{% if loop.index > config_authors_max and config_authors_max != 0 %}
{% if not loop.last %}
{% if not loop.first %}
&
<span
class=
"author-hidden-divider"
>
&
</span>
{% endif %}
<a
class=
"author-name author-hidden"
href=
"{{url_for('author', book_id=author.id) }}"
>
{{author.name.replace('|',',')|shortentitle(30)}}
</a>
{% if loop.last %}
<a
href=
"#"
class=
"author-expand"
data-authors-max=
"{{config_authors_max}}"
data-collapse-caption=
"({{_('reduce')}})"
>
(...)
</a>
{% endif %}
{% else %}
{% if not loop.first %}
<span>
&
</span>
{% endif %}
<a
class=
"author-name"
href=
"{{url_for('author', book_id=author.id) }}"
>
{{author.name.replace('|',',')|shortentitle(30)}}
</a>
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
</p>
</p>
...
...
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