2014-01-11 09:08:15 +08:00
|
|
|
<% content_for :top_field do%>
|
2014-01-17 15:05:50 +08:00
|
|
|
<%= render 'search_bar' %>
|
2014-01-11 09:08:15 +08:00
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<div class="resource_sum">
|
2014-01-13 21:32:34 +08:00
|
|
|
<% @attach_array.each do |k|%>
|
2014-01-11 09:08:15 +08:00
|
|
|
<div class="line_block">
|
2014-01-13 20:46:27 +08:00
|
|
|
<p>
|
2014-01-14 16:18:48 +08:00
|
|
|
<%= @str_arr.shift %>
|
2014-01-13 20:46:27 +08:00
|
|
|
</p>
|
2014-01-11 09:08:15 +08:00
|
|
|
<table style="width: 100%">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2014-01-15 16:02:41 +08:00
|
|
|
<td><%=l(:label_attachment)%></td>
|
|
|
|
<td><%=l(:field_downloads)%></td>
|
|
|
|
<td><%=l(:button_download)%></td>
|
2014-01-11 09:08:15 +08:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2014-01-13 21:32:34 +08:00
|
|
|
<% k.each do |c1|%>
|
2014-01-11 09:08:15 +08:00
|
|
|
<tr class="<%= cycle 'odd', 'even' %>">
|
2014-01-14 15:01:11 +08:00
|
|
|
<td class="filename" style="width:62%;"><%= link_to c1.filename, (attachFromUrl c1), {:title => c1.filename, :target => "_blank"} %> </td>
|
2014-01-15 16:02:41 +08:00
|
|
|
<td style="width:19%; text-align: center;"><%= c1.downloads %> </td>
|
2014-01-15 17:28:53 +08:00
|
|
|
<td class="filename download_icon" style="width:19%; text-align: center;">
|
2014-01-17 11:13:24 +08:00
|
|
|
<%= link_to_attachment c1, {:download => true, :text => image_tag("/images/button/download.png", width: "22px", alt: l(:button_download)) }%>
|
2014-01-15 17:28:53 +08:00
|
|
|
</td>
|
2014-01-11 09:08:15 +08:00
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<% reset_cycle; end %>
|
|
|
|
</div>
|
2014-01-15 17:28:53 +08:00
|
|
|
<script type='text/javascript'>
|
2014-01-17 15:37:57 +08:00
|
|
|
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}
|
|
|
|
}
|
|
|
|
}
|
2014-01-15 17:28:53 +08:00
|
|
|
$(document).ready(function($) {
|
2014-01-17 09:10:15 +08:00
|
|
|
$('.download_icon').find("a").attr("target", "_blank");
|
2014-01-15 17:28:53 +08:00
|
|
|
$('.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>
|