diff --git a/app/helpers/contribution_helper.rb b/app/helpers/contribution_helper.rb index da8a77d7..eb01776f 100644 --- a/app/helpers/contribution_helper.rb +++ b/app/helpers/contribution_helper.rb @@ -19,7 +19,7 @@ module ContributionHelper :item_link => link) output = translate("contributions.contributed_description.main.#{main_key}_html", :item_description => description) - output << image_tag(item.thumbnail.secure_url) if show_image + output << image_tag(item.thumbnail_url) if show_image output else translate('contributions.contributed_description.parents.item.blank') diff --git a/app/models/image.rb b/app/models/image.rb deleted file mode 100644 index 75f027aa..00000000 --- a/app/models/image.rb +++ /dev/null @@ -1,14 +0,0 @@ -class Image - attr_reader :insecure_url, :secure_url - - def initialize(insecure_url, secure_url) - @insecure_url = insecure_url - @secure_url = secure_url - end - - def self.from_insecure_url(insecure_url) - # TODO: We used to use a "Camo" server for this, but we don't anymore. - # Replace this with actual logic to actually secure the URLs! - Image.new insecure_url, insecure_url - end -end diff --git a/app/models/item.rb b/app/models/item.rb index 18e9a5b2..a6893cd4 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -413,16 +413,6 @@ class Item < ApplicationRecord modeled_body_ids.size.to_f / predicted_body_ids.size end - def thumbnail - if thumbnail_url.present? - url = thumbnail_url - else - url = ActionController::Base.helpers.asset_path( - "broken_item_thumbnail.gif") - end - @thumbnail ||= Image.from_insecure_url(url) - end - def as_json(options={}) json = { :description => description, diff --git a/app/views/items/_item_link.html.haml b/app/views/items/_item_link.html.haml index 27fb65ef..e50aafd3 100644 --- a/app/views/items/_item_link.html.haml +++ b/app/views/items/_item_link.html.haml @@ -1,4 +1,4 @@ = link_to item_path(item) do - = image_tag item.thumbnail.secure_url, :alt => item.description, :title => item.description + = image_tag item.thumbnail_url, :alt => item.description, :title => item.description %span.name= item.name = nc_icon_for(item) diff --git a/app/views/items/show.html.haml b/app/views/items/show.html.haml index 8dfc521b..4cb64ce9 100644 --- a/app/views/items/show.html.haml +++ b/app/views/items/show.html.haml @@ -2,7 +2,7 @@ - canonical_path @item %header#item-header - = image_tag @item.thumbnail.secure_url, :id => 'item-thumbnail' + = image_tag @item.thumbnail_url, :id => 'item-thumbnail' %div %h2#item-name= @item.name = nc_icon_for(@item) diff --git a/app/views/outfits/new.html.haml b/app/views/outfits/new.html.haml index f49c7e83..3031052d 100644 --- a/app/views/outfits/new.html.haml +++ b/app/views/outfits/new.html.haml @@ -88,7 +88,7 @@ - @newest_unmodeled_items.each do |item| - localized_cache "items/#{item.id} modeling_progress updated_at=#{item.updated_at.to_i}" do %li{'data-item-id' => item.id} - = link_to image_tag(item.thumbnail.secure_url), item, :class => 'image-link' + = link_to image_tag(item.thumbnail_url), item, :class => 'image-link' = link_to item, :class => 'header' do %h2= item.name %span.meter{style: "width: #{@newest_unmodeled_items_predicted_modeled_ratio[item]*100}%"} @@ -101,7 +101,7 @@ - @newest_modeled_items.each do |item| %li.object = link_to item, title: item.name, alt: item.name do - = image_tag item.thumbnail.secure_url + = image_tag item.thumbnail_url = nc_icon_for(item)