diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 90981b52a..305d5cae9 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -61,7 +61,13 @@ class AdminController < ApplicationController #管理员界面课程资源列表 def course_resource_list - @resource = Attachment.where(:container_type => 'Course') + #sort_init 'created_on','desc' + #sort_update %w(filename filesize filetype created_on downloads author course) + if params[:file_size] + @resource = Attachment.where(:container_type => 'Course').order("downloads desc") + else + @resource = Attachment.where(:container_type => 'Course').order("created_on desc") + end @resource = paginateHelper @resource,30 @page = (params['page'] || 1).to_i - 1 diff --git a/app/views/admin/course_resource_list.html.erb b/app/views/admin/course_resource_list.html.erb index 4316555f7..be39e568b 100644 --- a/app/views/admin/course_resource_list.html.erb +++ b/app/views/admin/course_resource_list.html.erb @@ -10,7 +10,7 @@ 资源名称 - 资源大小 + <%= link_to "资源大小",admin_course_resource_list_path(:sort => "file_size") %> 资源类型 diff --git a/config/locales/en.yml b/config/locales/en.yml index 3da533eb7..a82c6b502 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1535,3 +1535,12 @@ en: error_upload_avatar_to_large: "too big (%{max_size})" not_valid_image_file: not a valid image file + #resource + label_resource_name: Resource_name + label_resource_type: Rescource_type + label_resource_size: Rescource_size + label_resource_upload_date: Resource_upload_date + label_resource_download_times: Resource_download_times + label_resource_upload_author: Resource_upload_author + label_resource_belongs_course: Resource_belongs_course + label_resource_belongs_project: Resource_belongs_project diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 37d26dbd8..1e4bdd90e 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2111,4 +2111,14 @@ zh: # 课程推荐 label_homework_commont: 作业 - label_homework_recommendation: 课程推荐 \ No newline at end of file + label_homework_recommendation: 课程推荐 + + #资源 + label_resource_name: 资源名称 + label_resource_type: 资源类型 + label_resource_size: 资源大小 + label_resource_upload_date: 上传时间 + label_resource_download_times: 下载次数 + label_resource_upload_author: 上传者 + label_resource_belongs_course: 所属课程 + label_resource_belongs_project: 所属项目 \ No newline at end of file