FIX: If a site has no logo, don't show a broken image in the digest.

This commit is contained in:
Robin Ward 2014-07-21 14:18:32 -04:00
parent bddd7f5ea3
commit eafde36228
2 changed files with 7 additions and 1 deletions

View File

@ -28,6 +28,8 @@ module UserNotificationsHelper
def logo_url
logo_url = SiteSetting.digest_logo_url
logo_url = SiteSetting.logo_url if logo_url.blank?
return nil if logo_url.blank?
if logo_url !~ /http(s)?\:\/\//
logo_url = "#{Discourse.base_url}#{logo_url}"
end

View File

@ -2,7 +2,11 @@
<tr>
<td style="padding: 10px 10px; background-color: #<%= @header_color %>;">
<a href="<%= Discourse.base_url %>">
<img src="<%= logo_url %>" style="max-height: 35px; min-height: 35px; height: 35px;" class='site-logo'></a>
<%- if logo_url.blank? %>
<%= SiteSetting.title %>
<%- else %>
<img src="<%= logo_url %>" style="max-height: 35px; min-height: 35px; height: 35px;" class='site-logo'></a>
<%- end %>
</td>
</tr>
<tr>