diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 1701e6b7c..4259aa333 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -49,6 +49,7 @@ class AdminController < ApplicationController end end + #管理员界面精品课程列表 def excellent_courses @courses = Course.where("is_excellent =? or excellent_option =?", 1, 1 ) respond_to do |format| @@ -56,6 +57,19 @@ class AdminController < ApplicationController end end + #管理员界面课程资源列表 + def course_resource_list + @resource = Attachment.find_all_by_container_id(12) + + @resource = paginateHelper @resource,30 + @page = (params['page'] || 1).to_i - 1 + + respond_to do |format| + format.html + end + + end + def users sort_init 'login', 'asc' sort_update %w(login firstname lastname mail admin created_on last_login_on) diff --git a/app/views/admin/course_resource_list.html.erb b/app/views/admin/course_resource_list.html.erb new file mode 100644 index 000000000..7a2ac1af1 --- /dev/null +++ b/app/views/admin/course_resource_list.html.erb @@ -0,0 +1,67 @@ +

<%=l(:label_course_resource_list)%>

+ + +
+ + + + + + + + + + + + + + + <% @resource.each do |resource| %> + "> + + + + + + + + + <% end %> + + + + +
+ 资源名称 + + 资源大小 + + 资源类型 + + 上传时间 + + 下载次数 + + 上传者 + + 所属课程 +
+ <%= resource.filename %> + + <%= number_to_human_size(resource.filesize)%> + + 课程资源 + + <%= format_date(resource.created_on)%> + + <%= resource.downloads %> + + <%= link_to(User.find(resource.author_id).realname, user_path(User.find(resource.author_id)) ) %> + + <%=link_to Course.find(resource.container_id).name, course_path(Course.find(resource.container_id)), :class => "hidden fl w170" %> +
+
+ + \ No newline at end of file diff --git a/app/views/welcome/_search_attachment_results.html.erb b/app/views/welcome/_search_attachment_results.html.erb index 21ba68336..e51706085 100644 --- a/app/views/welcome/_search_attachment_results.html.erb +++ b/app/views/welcome/_search_attachment_results.html.erb @@ -21,6 +21,6 @@ <% end %>
- <%= paginate attachments,:params => {:controller => 'welcome', :action => 'search',:search_type=>'attachment'}%> + {:controller => 'welcome', :action => 'search',:search_type=>'attachment'}%>
<% end %> \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index ec4d69147..86a285342 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1521,6 +1521,7 @@ en: label_course_empty_select: You have not selected course! label_enterprise_page_made: enterprise_page label_excellent_courses_list: excellent_courses + label_course_resource_list: course_resource_list #api label_recently_updated_notification: Recently updated notification diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 98983ffa7..8884b0e67 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -484,6 +484,7 @@ zh: label_new_course: 课程列表 label_course_all: 课程列表 label_excellent_courses_list: 精品课程列表 + label_course_resource_list: 课程资源列表 label_teacher_all: 所有教师 label_requirement_enterprise_list: 众包列表 label_new_homework: 作业 diff --git a/config/routes.rb b/config/routes.rb index 445cecaf9..e92590895 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -934,6 +934,7 @@ RedmineApp::Application.routes.draw do match 'admin/projects', :via => :get get 'admin/courses' get 'admin/excellent_courses' + get 'admin/course_resource_list' match 'admin/users', :via => :get match 'admin/messages', :via => :get match 'admin/first_page_made', as: :first_page_made diff --git a/lib/redmine.rb b/lib/redmine.rb index 7bb43f905..21309b710 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -392,6 +392,7 @@ Redmine::MenuManager.map :admin_menu do |menu| menu.push :notices, {:controller => 'admin', :action => 'notices'}, :caption => :label_notification_list menu.push :latest_login_users, {:controller => 'admin', :action => 'latest_login_users'}, :caption => :label_latest_login_user_list menu.push :excellent_courses, {:controller => 'admin', :action => 'excellent_courses'}, :caption => :label_excellent_courses_list + menu.push :var, {:controller => 'admin', :action => 'course_resource_list'}, :caption => :label_course_resource_list menu.push :homework, {:controller => 'admin', :action => 'homework'}, :caption => :label_user_homework end