lib/fatcow/icon.rb in fatcow-0.1.6 vs lib/fatcow/icon.rb in fatcow-0.1.7
- old
+ new
@@ -40,30 +40,30 @@
alias :to_s :to_html
def composite?
if status
- file_exists = File.file? File.join(Fatcow::ASSET_ROOT, '../', asset_path)
+ file_exists = File.file? File.join(__dir__, '../../app/assets/images', asset_path)
return !file_exists
end
false
end
def asset_path
return base_icon_path unless status
- "/assets/normal/#{subdirectory}/#{name}_#{status}.png" if status
+ "fatcow/#{subdirectory}/#{name}_#{status}.png" if status
end
def base_icon_path
- "/assets/normal/#{subdirectory}/#{name}.png"
+ "fatcow/#{subdirectory}/#{name}.png"
end
def bullet_icon_path
- return "/assets/normal/#{subdirectory}/bullet_#{status}.png" if bullet_exists?
- "/assets/normal/FatCow_Icons16x16/#{status}.png"
+ return "fatcow/#{subdirectory}/bullet_#{status}.png" if bullet_exists?
+ "fatcow/FatCow_Icons16x16/#{status}.png"
end
def bullet_exists?
bullets = %i[archive attach back bell brush bug bulb_off bulb_on burn camera cd chart code_red code connect database document down dvd edit excel find flash gear lightning link magnify medal office palette php powerpoint table textfield up valid vector word world user blue purple pink red orange yellow green white black add delete go error key wrench toggle_minus toggle_plus feed picture disk star arrow_bottom arrow_down arrow_left_2 arrow_left arrow_right_2 arrow_right arrow_top arrow_up]
bullets.include? status
@@ -73,13 +73,13 @@
return @document if @document
@document ||= Nokogiri::HTML::Builder.new do |doc|
doc.div(class: container_class) {
if status && composite?
- doc.parent << Nokogiri::HTML.fragment(@app.image_tag(base_icon_path))
- doc.parent << Nokogiri::HTML.fragment(@app.image_tag(bullet_icon_path, class: bullet_class))
+ doc.parent << Nokogiri::HTML.fragment(@app.image_tag(@app.image_url base_icon_path))
+ doc.parent << Nokogiri::HTML.fragment(@app.image_tag(@app.image_url(bullet_icon_path), class: bullet_class))
else
- doc.parent << Nokogiri::HTML.fragment(@app.image_tag(asset_path))
+ doc.parent << Nokogiri::HTML.fragment(@app.image_tag(@app.image_url asset_path))
end
}
end.doc.root
end