/uploads/batch: add thumbnail previews (#3194).
This commit is contained in:
@@ -47,4 +47,28 @@ div#c-uploads {
|
||||
display: inline;
|
||||
}
|
||||
}
|
||||
|
||||
div.upload-preview {
|
||||
display: inline-block;
|
||||
|
||||
> a {
|
||||
width: 154px;
|
||||
height: 154px;
|
||||
margin: 0 10px 10px 0;
|
||||
display: inline-block;
|
||||
|
||||
img {
|
||||
margin: auto;
|
||||
border: 2px solid transparent;
|
||||
|
||||
max-width: 154px;
|
||||
max-height: 154px;
|
||||
}
|
||||
}
|
||||
|
||||
.caption-top {
|
||||
font-size: 0.8em;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,19 @@
|
||||
<div id="a-new">
|
||||
<h1>Batch Upload</h1>
|
||||
|
||||
<ul id="links">
|
||||
<section>
|
||||
<% @urls.each.with_index do |url, i| %>
|
||||
<li><%= link_to "Image ##{i}", new_upload_path(:url => url, :ref => params[:url]), :target => "_blank" %></li>
|
||||
<div class="upload-preview">
|
||||
<p class="caption-top">
|
||||
<%= link_to "Image ##{i}", new_upload_path(url: url, ref: params[:url]), target: "_blank" %>
|
||||
</p>
|
||||
|
||||
<%= link_to new_upload_path(url: url, ref: params[:url]), target: "_blank" do %>
|
||||
<%= image_tag url %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<p><%= link_to "Open all links in new windows", "#", :id => "link" %></p>
|
||||
</div>
|
||||
@@ -20,7 +28,7 @@
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("#link").click(function() {
|
||||
$("#links a").each(function(i, v) {
|
||||
$(".upload-preview > a").each(function(i, v) {
|
||||
window.open(v.href);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user