% if attachments.nil? || attachments.empty? %>
<% else %>
<% attachments.each do |attach| %>
-
-
<%= link_to truncate(attach.filename, :length => 30), download_named_attachment_path(attach.id, attach.filename), :title => attach.filename, :class => 'resourcesBlack resource-list-middle hidden mw280' %>
<% if attach.is_public == 0 && @type == "6" && attach.author != User.current %>
<% end %>
-
<% if attach.is_public == 0 && @type == "6" && attach.author != User.current %>
<% ah = attach.get_status_by_attach(User.current.id) %>
<% if ah.nil? %>
<%= link_to("请求分享", apply_resource_user_path(User.current.id, :attachment_id => attach.id), :class => 'green_btn_share c_white', :remote => true) %>
<% elsif ah == 1 %>
等待回复
<% elsif ah == 2 %>
可引用
<% elsif ah == 3 %>
已拒绝
<% end %>
<% else %>
--
<% end %>
- <%= format_date(attach.created_on) %>
- <%= attach.quotes.nil? ? 0 : attach.quotes %>
- <%= attach.downloads %>
- <%= attach.author_id %>
- <%= (number_to_human_size(attach.filesize)).gsub("ytes", "") %>
- <%=User.find(attach.author_id).realname.blank? ? User.find(attach.author_id).nickname : User.find(attach.author_id).realname %>
- <%= get_resource_type(attach.container_type)%>
- <%= get_resource_origin(attach) %>
- <%= attach.id %>
<% end %>
<% end %>