This commit is contained in:
linchun 2016-03-15 15:23:43 +08:00
parent 4da8a3828f
commit d3ed89d87e
4 changed files with 28 additions and 3 deletions

View File

@ -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

View File

@ -10,7 +10,7 @@
资源名称
</th>
<th style="width: 30px;">
资源大小
<%= link_to "资源大小",admin_course_resource_list_path(:sort => "file_size") %>
</th>
<th style="width: 25px;">
资源类型

View File

@ -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

View File

@ -2111,4 +2111,14 @@ zh:
# 课程推荐
label_homework_commont: 作业
label_homework_recommendation: 课程推荐
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: 所属项目