Skip to content

Commit

Permalink
When determining icon path, check if fileicon is truthy since item.de…
Browse files Browse the repository at this point in the history
…corate always will be.

Also, use `image_tag` instead of `tag(:img)`

https://bugzilla.redhat.com/show_bug.cgi?id=1439517
  • Loading branch information
hayesr committed Apr 19, 2017
1 parent dbd4052 commit 35b2877
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions app/helpers/quadicon_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,7 @@ def flobj_img_simple(image = nil, cls = '', size = 72)
image ||= "layout/base-single.png"

content_tag(:div, :class => "flobj #{cls}") do
tag(:img, :border => 0, :src => ActionController::Base.helpers.image_path(image),
:width => size, :height => size)
image_tag(image, :size => size)
end
end

Expand Down Expand Up @@ -561,11 +560,7 @@ def render_ems_cluster_quadicon(item, options)
def render_non_listicon_single_quadicon(item, options)
output = []

img_path = if item.decorate
item.decorate.try(:fileicon)
else
"100/#{item.class.base_class.to_s.underscore}.png"
end
img_path = item.try(:decorate).try(:fileicon) || "100/#{item.class.base_class.to_s.underscore}.png"

output << flobj_img_simple("layout/base-single.png")
output << flobj_img_simple(img_path, "e72")
Expand Down

0 comments on commit 35b2877

Please sign in to comment.