socialforge/app/views/stores/index.html.erb

46 lines
1.4 KiB
Plaintext

<% content_for :top_field do%>
<%= render 'search_bar' %>
<% end %>
<div class="resource_sum">
<% @attach_array.each do |k|%>
<div class="line_block">
<p>
<%= @str_arr.shift %>
</p>
<table style="width: 100%">
<thead>
<tr>
<td><%=l(:label_attachment)%></td>
<td><%=l(:field_downloads)%></td>
<td><%=l(:button_download)%></td>
</tr>
</thead>
<tbody>
<% k.each do |c1|%>
<tr class="<%= cycle 'odd', 'even' %>">
<td class="filename" style="width:62%;"><%= link_to c1.filename, (attachFromUrl c1), {:title => c1.filename, :target => "_blank"} %> </td>
<td style="width:19%; text-align: center;"><%= c1.downloads %> </td>
<td class="filename download_icon" style="width:19%; text-align: center;">
<%= link_to_attachment c1, {:download => true, :text => image_tag("/images/button/download.png", width: "22px", alt: l(:button_download)) }%>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<% reset_cycle; end %>
</div>
<script type='text/javascript'>
$(document).ready(function($) {
$('.download_icon').find("a").attr("target", "_blank");
$('.download_icon').each(function(){
$(this).mouseenter(function(event) {
$(this).find('img').attr("src", "/images/button/download_focus.png")
});
$(this).mouseleave(function(event) {
$(this).find('img').attr("src", "/images/button/download.png")
});
});
});
</script>