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

63 lines
1.8 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'>
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
{alert(alerttxt);$.find('form').attr("data-submitted",'');return false}
else {return true}
}
}
function validate_form(thisform) {
with (thisform)
{
if (validate_required(name,"name must be filled out!")==false)
{name.focus();return false}
}
}
$(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>