Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
concrexit
Commits
0caae2a4
Commit
0caae2a4
authored
Apr 01, 2017
by
Thom Wiggers
📐
Browse files
Merge branch 'comment-thumbnail-generation' into 'master'
utils/thumbnails: document thumbnail url usage See merge request
!435
parents
b63243c0
fd94bb19
Changes
1
Hide whitespace changes
Inline
Side-by-side
website/utils/templatetags/thumbnail.py
View file @
0caae2a4
...
...
@@ -31,6 +31,9 @@ def thumbnail(path, size, fit=True):
os
.
path
.
getmtime
(
full_path
)
>
os
.
path
.
getmtime
(
full_thumbpath
)):
pathuri
=
urlquote
(
path
,
safe
=
[
''
])
thumburi
=
urlquote
(
thumbpath
,
safe
=
[
''
])
# We provide a URL instead of calling it as a function, so that using
# it means kicking off a new GET request. If we would generate all
# thumbnails inline, loading an album overview would have high latency.
return
reverse
(
'generate-thumbnail'
,
args
=
[
size_fit
,
pathuri
,
thumburi
])
...
...
@@ -41,4 +44,7 @@ def thumbnail(path, size, fit=True):
return
settings
.
MEDIA_URL
+
thumbpath
# Otherwise simply place it in media/thumbnails.
# We provide a URL instead of calling it as a function, so that using
# it means kicking off a new GET request. If we would generate all
# thumbnails inline, loading an album overview would have high latency.
return
reverse
(
'private-thumbnails'
,
args
=
[
size_fit
,
path
])
Write
Preview
Supports
Markdown
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