Commit e2cd20cc authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'ee_empty_brand_image' into 'master'

empty brand image are displayed as empty image_tag on login page

When using a custom appearance without uploading an image, an empty HTML img-tag is rendered, showing up badly in some browsers: http://i.imgur.com/EN9WpuA.png
Also, the empty img-tag was rendered in the admin/appearance form.
parents 63df2fa6 fcd27b76
...@@ -8,13 +8,15 @@ module AppearancesHelper ...@@ -8,13 +8,15 @@ module AppearancesHelper
end end
def brand_image def brand_image
logo = if brand_item if brand_item
brand_item.logo if brand_item.logo?
else image_tag brand_item.logo
'brand_logo.png' else
end nil
end
image_tag logo else
image_tag 'brand_logo.png'
end
end end
def brand_text def brand_text
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
.form-group .form-group
= f.label :logo, class: 'control-label' = f.label :logo, class: 'control-label'
.col-sm-10 .col-sm-10
- if @appearance.logo - if @appearance.logo?
= image_tag @appearance.logo, class: 'appearance-logo-preview' = image_tag @appearance.logo, class: 'appearance-logo-preview'
= f.file_field :logo, class: "" = f.file_field :logo, class: ""
.hint .hint
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment