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
7e0d9fba
Commit
7e0d9fba
authored
Jun 30, 2020
by
Michael Knepher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
series_index filter to show x.0 as x
parent
67dd4a72
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
8 deletions
+15
-8
jinjia.py
cps/jinjia.py
+7
-0
author.html
cps/templates/author.html
+2
-2
detail.html
cps/templates/detail.html
+1
-1
discover.html
cps/templates/discover.html
+1
-1
index.html
cps/templates/index.html
+2
-2
search.html
cps/templates/search.html
+1
-1
shelf.html
cps/templates/shelf.html
+1
-1
No files found.
cps/jinjia.py
View file @
7e0d9fba
...
@@ -111,3 +111,10 @@ def timestamptodate(date, fmt=None):
...
@@ -111,3 +111,10 @@ def timestamptodate(date, fmt=None):
@
jinjia
.
app_template_filter
(
'yesno'
)
@
jinjia
.
app_template_filter
(
'yesno'
)
def
yesno
(
value
,
yes
,
no
):
def
yesno
(
value
,
yes
,
no
):
return
yes
if
value
else
no
return
yes
if
value
else
no
@
jinjia
.
app_template_filter
(
'formatseriesindex'
)
def
formatseriesindex_filter
(
series_index
):
if
int
(
series_index
)
-
series_index
==
0
:
return
int
(
series_index
)
else
:
return
series_index
\ No newline at end of file
cps/templates/author.html
View file @
7e0d9fba
...
@@ -75,7 +75,7 @@
...
@@ -75,7 +75,7 @@
<a
href=
"{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}"
>
<a
href=
"{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}"
>
{{entry.series[0].name}}
{{entry.series[0].name}}
</a>
</a>
({{entry.series_index}})
({{entry.series_index
|formatseriesindex
}})
</p>
</p>
{% endif %}
{% endif %}
{% if entry.ratings.__len__() > 0 %}
{% if entry.ratings.__len__() > 0 %}
...
@@ -127,7 +127,7 @@
...
@@ -127,7 +127,7 @@
<a
href=
"{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}"
>
<a
href=
"{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}"
>
{{entry.series[0].name}}
{{entry.series[0].name}}
</a>
</a>
({{entry.series_index}})
({{entry.series_index
|formatseriesindex
}})
</p>
</p>
{% endif %}
{% endif %}
<div
class=
"rating"
>
<div
class=
"rating"
>
...
...
cps/templates/detail.html
View file @
7e0d9fba
...
@@ -114,7 +114,7 @@
...
@@ -114,7 +114,7 @@
{% endif %}
{% endif %}
{% if entry.series|length > 0 %}
{% if entry.series|length > 0 %}
<p>
{{_('Book')}} {{entry.series_index}} {{_('of')}}
<a
href=
"{{url_for('web.books_list', data='series',sort='abc', book_id=entry.series[0].id)}}"
>
{{entry.series[0].name}}
</a></p>
<p>
{{_('Book')}} {{entry.series_index
|formatseriesindex
}} {{_('of')}}
<a
href=
"{{url_for('web.books_list', data='series',sort='abc', book_id=entry.series[0].id)}}"
>
{{entry.series[0].name}}
</a></p>
{% endif %}
{% endif %}
{% if entry.languages.__len__() > 0 %}
{% if entry.languages.__len__() > 0 %}
...
...
cps/templates/discover.html
View file @
7e0d9fba
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
<a
href=
"{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}"
>
<a
href=
"{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}"
>
{{entry.series[0].name}}
{{entry.series[0].name}}
</a>
</a>
({{entry.series_index}})
({{entry.series_index
|formatseriesindex
}})
</p>
</p>
{% endif %}
{% endif %}
{% if entry.ratings.__len__() > 0 %}
{% if entry.ratings.__len__() > 0 %}
...
...
cps/templates/index.html
View file @
7e0d9fba
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
<a
href=
"{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}"
>
<a
href=
"{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}"
>
{{entry.series[0].name}}
{{entry.series[0].name}}
</a>
</a>
({{entry.series_index}})
({{entry.series_index
|formatseriesindex
}})
</p>
</p>
{% endif %}
{% endif %}
{% if entry.ratings.__len__() > 0 %}
{% if entry.ratings.__len__() > 0 %}
...
@@ -114,7 +114,7 @@
...
@@ -114,7 +114,7 @@
<a
href=
"{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}"
>
<a
href=
"{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}"
>
{{entry.series[0].name}}
{{entry.series[0].name}}
</a>
</a>
({{entry.series_index}})
({{entry.series_index
|formatseriesindex
}})
</p>
</p>
{% endif %}
{% endif %}
{% if entry.ratings.__len__() > 0 %}
{% if entry.ratings.__len__() > 0 %}
...
...
cps/templates/search.html
View file @
7e0d9fba
...
@@ -81,7 +81,7 @@
...
@@ -81,7 +81,7 @@
<a
href=
"{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}"
>
<a
href=
"{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}"
>
{{entry.series[0].name}}
{{entry.series[0].name}}
</a>
</a>
({{entry.series_index}})
({{entry.series_index
|formatseriesindex
}})
</p>
</p>
{% endif %}
{% endif %}
...
...
cps/templates/shelf.html
View file @
7e0d9fba
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
<a
href=
"{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}"
>
<a
href=
"{{url_for('web.books_list', data='series', sort='new', book_id=entry.series[0].id )}}"
>
{{entry.series[0].name}}
{{entry.series[0].name}}
</a>
</a>
({{entry.series_index|
int
}})
({{entry.series_index|
formatseriesindex
}})
</p>
</p>
{% endif %}
{% endif %}
{% if entry.ratings.__len__() > 0 %}
{% if entry.ratings.__len__() > 0 %}
...
...
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