Files
danbooru/app/views/uploads/_image.html.erb
evazion 6a7cd6ce8e Fix #3984: Twitter: undefined method `first' for nil:NilClass.
Fix Sources::Strategies::Twitter#image_urls to return an empty array
instead of nil when the tweet doesn't contain any images.
2018-11-11 17:41:32 -06:00

20 lines
706 B
Plaintext

<% if params[:url] %>
<% if ImageProxy.needs_proxy?(@source.image_url) %>
<%= image_tag(image_proxy_uploads_path(:url => @source.image_url), :title => "Preview", :id => "image") %>
<% elsif @source.image_url.present? %>
<%= image_tag(@source.image_url, :title => "Preview", :id => "image") %>
<% end %>
<ul id="upload-image-metadata">
<% if @remote_size %>
<li><strong>Size:</strong> <%= number_to_human_size(@remote_size) %></li>
<% end %>
<% if params[:ref] %>
<li><strong>Referrer:</strong> <%= params[:ref] %></li>
<% end %>
<li><span id="scale"></span> (<%= link_to "toggle size", "#", :id => "image-resize-to-window-link" %>)</li>
</ul>
<% end %>