%
# Copyright (C) 2011 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see .
%>
<% skip_ul ||= false; exclude_files ||= false %>
<% unless skip_ul %>
<% end %>
<% folders ||= [] %>
<% nested_content.compact.select{|i| !i.is_a?(Attachment) || !exclude_files}.each do |item|
new_f = folders.to_a.find{|i| i.id == item.id} if folders && item.is_a?(Folder)
item = new_f if new_f
subcontent = folders.select{|f| f.parent_folder_id == f.id } if exclude_files && !folders.empty?
subcontent ||= item.subcontent(:exclude_files => exclude_files) if item.respond_to?(:subcontent)
%>
- <%= 'folder_locked' if item.is_a?(Folder) && item.currently_locked %> <%= item.mime_class rescue "" %> <%= item.is_a?(Attachment) ? "file" : "folder" %>_<%= item ? item.id : "blank" %>">
<%= item.id %>
<%= item.display_name %>
<% if subcontent %>
<%= render :partial => "files/nested_content", :object => subcontent, :locals => {:exclude_files => exclude_files} %>
<% end %>
<% end %>
<% unless skip_ul %>
<% end %>