diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index a01bba913..086ecfb7f 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -42,7 +42,11 @@ class AdminController < ApplicationController end def courses - + @name = params[:name] + @courses = Course.like(@name) + respond_to do |format| + format.html + end end def users diff --git a/app/views/admin/courses.html.erb b/app/views/admin/courses.html.erb index d1d06ad36..1615bccbc 100644 --- a/app/views/admin/courses.html.erb +++ b/app/views/admin/courses.html.erb @@ -1 +1,76 @@ -1111 \ No newline at end of file +
+ <%= link_to l(:label_course_new), {:controller => 'courses', :action => 'new'}, :class => 'icon icon-add' %> +
+ +

+ <%=l(:label_course_all)%> +

+ +<%= form_tag({}, :method => :get) do %> +
+ + <%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '课程名称' %> + <%= submit_tag l(:button_apply), :class => "small", :name => nil %> + + <%= l(:button_clear)%> + +
+<% end %> +  + +
+ + + + + + + + + + + + + <% @courses.each do |course| %> + "> + + + + + + + + <% end %> + +
+ 序号 + + 课程 + + 主讲老师 + + 学时 + + <%=l(:field_is_public)%> + + <%=l(:field_created_on)%> +
+ <%= course.id %> + + + <%= link_to(course.name, course_path(course.id)) %> + + + <%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %> + + <%= course.class_period %> + + <%= checked_image course.is_public? %> + + <%= format_date(course.created_at) %> +
+
+ +<% html_title(l(:label_course_all)) -%> diff --git a/config/locales/commons/zh.yml b/config/locales/commons/zh.yml index f83d3810c..5dee0b505 100644 --- a/config/locales/commons/zh.yml +++ b/config/locales/commons/zh.yml @@ -263,7 +263,7 @@ zh: label_tags_numbers: "Tag统计" label_issue_plural: 问题跟踪 - label_project_plural: 项目列表 +# label_project_plural: 项目列表 label_user_plural: 用户列表 label_tags_call: 需求 field_filename: 文件