Batch Upload
<%= simple_form_for(:batch, url: batch_uploads_path, method: :get, defaults: { required: false }, html: { class: "one-line-form" }) do |f| %>
<%= f.input :url, label: "URL", input_html: { size: 70, value: @url, placeholder: "https://www.pixiv.net/member_illust.php?mode=medium&illust_id=65981746" } %>
<%= f.submit "Fetch" %>
<% end %>
<% if @source.present? %>
<% @source.image_urls.each.with_index do |url, i| %>
<%= link_to "Image ##{i}", new_upload_path(url: url, ref: @url), target: "_blank" %>
<%= link_to new_upload_path(url: url, ref: @url), target: "_blank" do %>
<% if ImageProxy.needs_proxy?(url) %>
<%= image_tag(image_proxy_uploads_path(url: url)) %>
<% elsif url.is_a?(String) %>
<%= image_tag url %>
<% else %>
Direct Link
<% end %>
<% end %>
<% end %>
<%= link_to "Open all links in new windows", "#", :id => "link" %>
<% end %>