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
fb1e763b
Commit
fb1e763b
authored
4 years ago
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Plain Diff
Fix browser caching problem on change cover
parents
ecea7e74
560ade00
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
7 deletions
+22
-7
jinjia.py
cps/jinjia.py
+6
-0
book_edit.html
cps/templates/book_edit.html
+1
-1
detail.html
cps/templates/detail.html
+3
-3
web.py
cps/web.py
+12
-3
No files found.
cps/jinjia.py
View file @
fb1e763b
...
...
@@ -25,6 +25,7 @@
from
__future__
import
division
,
print_function
,
unicode_literals
import
datetime
import
mimetypes
from
uuid
import
uuid4
from
babel.dates
import
format_date
from
flask
import
Blueprint
,
request
,
url_for
...
...
@@ -127,3 +128,8 @@ def formatseriesindex_filter(series_index):
return
series_index
return
0
@
jinjia
.
app_template_filter
(
'uuidfilter'
)
def
uuidfilter
(
var
):
return
uuid4
()
This diff is collapsed.
Click to expand it.
cps/templates/book_edit.html
View file @
fb1e763b
...
...
@@ -3,7 +3,7 @@
{% if book %}
<div
class=
"col-sm-3 col-lg-3 col-xs-12"
>
<div
class=
"cover"
>
<img
src=
"{{ url_for('web.get_cover', book_id=book.id
)
}}"
alt=
"{{ book.title }}"
/>
<img
src=
"{{ url_for('web.get_cover', book_id=book.id
, edit=1|uuidfilter)
}}"
alt=
"{{ book.title }}"
/>
</div>
{% if g.user.role_delete_books() %}
<div
class=
"text-center"
>
...
...
This diff is collapsed.
Click to expand it.
cps/templates/detail.html
View file @
fb1e763b
...
...
@@ -4,13 +4,13 @@
<div
class=
"row"
>
<div
class=
"col-sm-3 col-lg-3 col-xs-5"
>
<div
class=
"cover"
>
<img
src=
"{{ url_for('web.get_cover', book_id=entry.id) }}"
alt=
"{{ entry.title }}"
/>
<img
src=
"{{ url_for('web.get_cover', book_id=entry.id
, edit=1|uuidfilter
) }}"
alt=
"{{ entry.title }}"
/>
</div>
</div>
<div
class=
"col-sm-9 col-lg-9 book-meta"
>
<div
class=
"btn-toolbar"
role=
"toolbar"
>
<div
class=
"btn-group"
role=
"group"
aria-label=
"Download, send to Kindle, reading"
>
{% if g.user.role_download()
%}
{% if g.user.role_download()
%}
{% if entry.data|length %}
<div
class=
"btn-group"
role=
"group"
>
{% if entry.data|length
<
2
%}
...
...
@@ -278,7 +278,7 @@
{% endif %}
{% endif %}
{% if g.user.role_edit()
%}
{% if g.user.role_edit()
%}
<div
class=
"btn-toolbar"
role=
"toolbar"
>
<div
class=
"btn-group"
role=
"group"
aria-label=
"Edit/Delete book"
>
<a
href=
"{{ url_for('editbook.edit_book', book_id=entry.id) }}"
class=
"btn btn-sm btn-primary"
id=
"edit_book"
role=
"button"
><span
class=
"glyphicon glyphicon-edit"
></span>
{{_('Edit Metadata')}}
</a>
...
...
This diff is collapsed.
Click to expand it.
cps/web.py
View file @
fb1e763b
...
...
@@ -1922,9 +1922,18 @@ def show_book(book_id):
if
media_format
.
format
.
lower
()
in
constants
.
EXTENSIONS_AUDIO
:
audioentries
.
append
(
media_format
.
format
.
lower
())
return
render_title_template
(
'detail.html'
,
entry
=
entries
,
audioentries
=
audioentries
,
cc
=
cc
,
is_xhr
=
request
.
headers
.
get
(
'X-Requested-With'
)
==
'XMLHttpRequest'
,
title
=
entries
.
title
,
books_shelfs
=
book_in_shelfs
,
have_read
=
have_read
,
is_archived
=
is_archived
,
kindle_list
=
kindle_list
,
reader_list
=
reader_list
,
page
=
"book"
)
return
render_title_template
(
'detail.html'
,
entry
=
entries
,
audioentries
=
audioentries
,
cc
=
cc
,
is_xhr
=
request
.
headers
.
get
(
'X-Requested-With'
)
==
'XMLHttpRequest'
,
title
=
entries
.
title
,
books_shelfs
=
book_in_shelfs
,
have_read
=
have_read
,
is_archived
=
is_archived
,
kindle_list
=
kindle_list
,
reader_list
=
reader_list
,
page
=
"book"
)
else
:
log
.
debug
(
u"Error opening eBook. File does not exist or file is not accessible"
)
flash
(
_
(
u"Error opening eBook. File does not exist or file is not accessible"
),
category
=
"error"
)
...
...
This diff is collapsed.
Click to expand it.
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