<% page_title "Batch Upload" %> <%= render "uploads/secondary_links" %>

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.zip(@source.preview_urls).each.with_index do |(url, preview_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: preview_url)) %> <% elsif url.is_a?(String) %> <%= image_tag preview_url %> <% else %> Direct Link <% end %> <% end %>
<% end %>

<%= link_to "Open all links in new tabs", "#", :id => "link" %>

<% end %>