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