53 lines
1.7 KiB
Plaintext
53 lines
1.7 KiB
Plaintext
<div id="c-uploads">
|
|
<div id="a-batch">
|
|
<h1>Batch Upload</h1>
|
|
|
|
<%= 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? %>
|
|
<section>
|
|
<% @source.image_urls.zip(@source.preview_urls).each.with_index do |(url, preview_url), i| %>
|
|
<div class="upload-preview">
|
|
<p class="caption-top">
|
|
<%= link_to "Image ##{i}", new_upload_path(url: url, ref: @url), target: "_blank" %>
|
|
</p>
|
|
|
|
<%= 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 %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<p><%= link_to "Open all links in new windows", "#", :id => "link" %></p>
|
|
</section>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
<% content_for(:page_title) do %>
|
|
Batch Upload - <%= Danbooru.config.app_name %>
|
|
<% end %>
|
|
|
|
<% content_for(:html_header) do %>
|
|
<script type="text/javascript">
|
|
$(function() {
|
|
$("#link").click(function() {
|
|
$(".upload-preview > a").each(function(i, v) {
|
|
window.open(v.href);
|
|
});
|
|
});
|
|
})
|
|
</script>
|
|
<% end %>
|
|
|
|
<%= render "uploads/secondary_links" %>
|