|
|
|
@ -16,11 +16,9 @@
|
|
|
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
|
|
|
|
|
class FilesController < ApplicationController
|
|
|
|
|
if @project
|
|
|
|
|
|
|
|
|
|
layout 'base_projects' #by young
|
|
|
|
|
else
|
|
|
|
|
layout 'base_courses'
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
menu_item :files
|
|
|
|
|
|
|
|
|
|
before_filter :find_project_by_project_id#, :except => [:getattachtype]
|
|
|
|
@ -303,26 +301,39 @@ class FilesController < ApplicationController
|
|
|
|
|
@isproject = true
|
|
|
|
|
@containers = [ Project.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@project.id)]
|
|
|
|
|
@containers += @project.versions.includes(:attachments).reorder(sort).all
|
|
|
|
|
show_attachments @containers
|
|
|
|
|
@attachtype = params[:type].to_i
|
|
|
|
|
@contenttype = params[:contentType].to_s
|
|
|
|
|
respond_to do |format|
|
|
|
|
|
format.js
|
|
|
|
|
format.html {
|
|
|
|
|
render :layout => 'base_projects'
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#render :layout => 'base_projects'
|
|
|
|
|
elsif @course
|
|
|
|
|
@isproject = false
|
|
|
|
|
@containers = [ Course.includes(:attachments).reorder(sort).find(@course.id)]
|
|
|
|
|
# show_attachments @containers
|
|
|
|
|
# @attachtype = params[:type].to_i
|
|
|
|
|
# @contenttype = params[:contentType].to_s
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
show_attachments @containers
|
|
|
|
|
@attachtype = params[:type].to_i
|
|
|
|
|
@contenttype = params[:contentType].to_s
|
|
|
|
|
show_attachments @containers
|
|
|
|
|
@attachtype = params[:type].to_i
|
|
|
|
|
@contenttype = params[:contentType].to_s
|
|
|
|
|
# render layout: 'base_courses'
|
|
|
|
|
respond_to do |format|
|
|
|
|
|
format.js
|
|
|
|
|
format.html {
|
|
|
|
|
render :layout => 'base_courses'
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
|
format.js
|
|
|
|
|
format.html
|
|
|
|
|
end
|
|
|
|
|
# show_attachments @containers
|
|
|
|
|
# @attachtype = params[:type].to_i
|
|
|
|
|
# @contenttype = params[:contentType].to_s
|
|
|
|
|
#
|
|
|
|
|
# respond_to do |format|
|
|
|
|
|
# format.js
|
|
|
|
|
# format.html
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|