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
Simon Daron
panikweb
Commits
e590e996
Commit
e590e996
authored
Feb 22, 2018
by
fred
Browse files
feeds: also use an absolute URL for item image
parent
b0c95fed
Changes
3
Hide whitespace changes
Inline
Side-by-side
panikweb/paniktags/templatetags/paniktags.py
View file @
e590e996
...
...
@@ -367,3 +367,9 @@ def set_absolute_urls(text):
text
=
text
.
replace
(
'src="/'
,
'src="%s'
%
settings
.
WEBSITE_BASE_URL
)
text
=
text
.
replace
(
'href="/'
,
'href="%s'
%
settings
.
WEBSITE_BASE_URL
)
return
text
@
register
.
filter
def
as_absolute_url
(
url
):
if
url
.
startswith
(
'/'
):
url
=
settings
.
WEBSITE_BASE_URL
+
url
.
lstrip
(
'/'
)
return
url
panikweb_templates/templates/feed/newsitem.html
View file @
e590e996
{% load paniktags thumbnail %}
{% if obj.image %}
{% thumbnail obj.image "320x240" crop="50% 25%" as im %}
<img
src=
"{{im.url}}"
/>
<img
src=
"{{im.url
|as_absolute_url
}}"
/>
{% endthumbnail %}
{% endif %}
...
...
panikweb_templates/templates/feed/soundfile.html
View file @
e590e996
{% load paniktags thumbnail %}
{% if obj.episode.image %}
{% thumbnail obj.episode.image "320x240" crop="50% 25%" as im %}
<img
src=
"{
{im.
url}}"
/>
<img
src=
"{
% url '{{im.url|as_absolute_
url}}"
/>
{% endthumbnail %}
{% endif %}
...
...
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