mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 06:29:30 +08:00
FIX: digest email has broken images in popular topics section
This commit is contained in:
parent
47be1a8be9
commit
7d37c2b919
|
@ -97,4 +97,10 @@ module UserNotificationsHelper
|
||||||
UrlHelper.absolute("#{Discourse.base_uri}/images/emails/#{basename}")
|
UrlHelper.absolute("#{Discourse.base_uri}/images/emails/#{basename}")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def url_for_email(href)
|
||||||
|
URI(href).host.present? ? href : UrlHelper.absolute("#{Discourse.base_uri}#{href}")
|
||||||
|
rescue URI::InvalidURIError, URI::InvalidComponentError
|
||||||
|
href
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -129,7 +129,7 @@ body, table, td, th, h1, h2, h3 {font-family: Helvetica, Arial, sans-serif !impo
|
||||||
|
|
||||||
<% if t.image_url.present? %>
|
<% if t.image_url.present? %>
|
||||||
<td style="color:#0a0a0a;line-height:1.3;margin:0;padding:0 16px 8px 8px;text-align:right;width:20%" align="right">
|
<td style="color:#0a0a0a;line-height:1.3;margin:0;padding:0 16px 8px 8px;text-align:right;width:20%" align="right">
|
||||||
<img src="<%= Discourse.base_url_no_prefix + t.image_url -%>" height="64" style="-ms-interpolation-mode:bicubic;margin:auto;max-height:64px;max-width:100%;outline:0;text-align:right;text-decoration:none;">
|
<img src="<%= url_for_email(t.image_url) -%>" height="64" style="-ms-interpolation-mode:bicubic;margin:auto;max-height:64px;max-width:100%;outline:0;text-align:right;text-decoration:none;">
|
||||||
</td>
|
</td>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user