|
|
@ -40,7 +40,19 @@ class FilesController < ApplicationController
|
|
|
|
render :layout => !request.xhr?
|
|
|
|
render :layout => !request.xhr?
|
|
|
|
elsif params[:course_id]
|
|
|
|
elsif params[:course_id]
|
|
|
|
@isproject = false
|
|
|
|
@isproject = false
|
|
|
|
@containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@course.id)]
|
|
|
|
@order = params[:sort].split(",")[0];
|
|
|
|
|
|
|
|
@orderBy = @order.split(":")[0];
|
|
|
|
|
|
|
|
@orderType = @order.split(":")[1];
|
|
|
|
|
|
|
|
if @orderBy=="size"
|
|
|
|
|
|
|
|
@orderBy="filesize"
|
|
|
|
|
|
|
|
elsif @orderBy=="field_file_dense"
|
|
|
|
|
|
|
|
@orderBy="is_public"
|
|
|
|
|
|
|
|
elsif @orderBy=="attach_type"
|
|
|
|
|
|
|
|
@orderBy="attachtype"
|
|
|
|
|
|
|
|
elsif @orderBy=="content_type"
|
|
|
|
|
|
|
|
@orderBy="attachtype"
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
@containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.#{@orderBy} #{@orderType}").find(@course.id)]
|
|
|
|
render :layout => 'base_courses'
|
|
|
|
render :layout => 'base_courses'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|