mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 14:49:07 +08:00
FIX: Again, try to get a flexible absolute logo_url
This commit is contained in:
parent
8328aa97fd
commit
4d1e8356b8
|
@ -12,7 +12,7 @@ module ApplicationHelper
|
|||
|
||||
def discourse_csrf_tags
|
||||
# anon can not have a CSRF token cause these are all pages
|
||||
# that may be cached, causing a mismatch between session CSRF
|
||||
# that may be cached, causing a mismatch between session CSRF
|
||||
# and CSRF on page and horrible impossible to debug login issues
|
||||
if current_user
|
||||
csrf_meta_tags
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<tr>
|
||||
<td>
|
||||
<a href="<%= Discourse.base_url %>">
|
||||
<%= image_tag(SiteSetting.logo_url, style: "height: 50px; margin-bottom: 15px; ") %>
|
||||
<img src="<%= logo_url %>" style="height: 50px; margin-bottom: 15px;"></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
@ -13,10 +13,16 @@ class EmailRenderer
|
|||
def html
|
||||
formatted_body = EmailStyles.new(PrettyText.cook(text, environment: 'email')).format
|
||||
|
||||
logo_url = SiteSetting.logo_url
|
||||
if logo_url !~ /http(s)?\:\/\//
|
||||
logo_url = "#{Discourse.base_url}#{logo_url}"
|
||||
end
|
||||
|
||||
ActionView::Base.new(Rails.configuration.paths["app/views"]).render(
|
||||
template: 'email/template',
|
||||
format: :html,
|
||||
locals: { html_body: formatted_body }
|
||||
locals: { html_body: formatted_body,
|
||||
logo_url: logo_url }
|
||||
)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user