<%
if @directory.path.include?(dir.path)
dir = @directory
active = n
end
n = n + 1
%>
<% if !dir.subdirs.ordered.empty? or dir.parent.id != Directory::ROOT %>
Directories
<% end %>
<% if dir.parent.id != Directory::ROOT %>
<%= link_to "Parent", dir.parent %>
<% end %>
<% dir.subdirs.ordered.each do |subdir| %>
<%= namelink subdir %>
<% end %>
Files
<% dir.files.unrelated.each do |file| %>
<%= namelink file %>
Size: <%= file.size_s %> MB, Comments: <%= file.comments.count %>
MD5: <%= file.md5_s %>
<%= link_to "Direct Download", file.url, :class => "green" %>
<% if file.can_update? cuser %>
[ <%= link_to 'Edit', edit_data_file_path(file) %> ]
<% end; if file.can_destroy? cuser %>
[ <%= link_to 'Destroy', file, :confirm => 'Are you sure?', :method => :delete %> ]
<% end %>
<% end %>
<% if dir.files.empty? %>
Empty directory.
<% end %>
<% if cuser and cuser.admin? %>
<%= link_to "Edit Directory", edit_directory_path(dir) %> |
<%= link_to "Delete Directory", dir, :confirm => "Are you REALLY sure?", :method => :delete %> |
<%= link_to "New Directory", :controller => "directories", :action => "new", :id => dir %> |
<%= link_to "New File", :controller => "data_files", :action => "new", :id => dir %>
<% end %>