diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 58190b14a..5afefc51c 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -136,7 +136,7 @@ class ManagementsController < ApplicationController end if params[:support_shixuns] - @major = @major.where(:support_shixuns => params[:support_shixuns].to_i) + @major = @major.where(:support_shixuns => params[:support_shixuns].to_i,:major_level=> 1) end @major = @major.order("created_at #{@sx_order}") @@ -603,6 +603,7 @@ end def class_shixuns @menu_type = 4 @sub_type = 1 + @sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order] @edit_class_sx_num=Subject.where(:status => 0).count @audit_class_sx_num=Subject.where(:status => 1).count @publish_class_sx_num=Subject.where(:status => 2).count @@ -631,6 +632,8 @@ end user_exs = UserExtensions.where(:user_id => @c_shixuns.map(&:user_id)) @schools = School.where(:id => user_exs.map(&:school_id)) end + @c_shixuns = @c_shixuns.order("created_at #{@sx_order}") + @c_shixuns_count = @c_shixuns.count limit = 20 @c_shixuns_pages = Paginator.new @c_shixuns_count, limit, params['page'] || 1 @@ -651,6 +654,7 @@ end def class_publish_shixuns @menu_type = 4 @sub_type = 2 + @sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order] search = params[:search] # 搜索字 keyword = params[:keyword].blank? ? "u_name" : params[:keyword] # 根据姓名/课程名搜索 if params[:school_id] && params[:school_id] != '0' @@ -670,7 +674,7 @@ end user_exs = UserExtensions.where(:user_id => @c_shixuns.map(&:user_id)) @schools = School.where(:id => user_exs.map(&:school_id)) end - @c_shixuns = @c_shixuns.order("created_at desc") + @c_shixuns = @c_shixuns.order("created_at #{@sx_order}") @c_shixuns_count = @c_shixuns.count limit = 20 @c_shixuns_pages = Paginator.new @c_shixuns_count, limit, params['page'] || 1 @@ -1106,6 +1110,7 @@ end format.html end end + # 课程实训发布审批 def deal_subject_authorization apply_action = ApplyAction.find(params[:apply_id]) @@ -1131,6 +1136,7 @@ end format.js end end + # 项目实训发布审批 def deal_shixun_authorization apply_action = ApplyAction.find(params[:apply_id]) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index d2df3f69f..b7ed11076 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -668,7 +668,8 @@ class UsersController < ApplicationController @offset ||= @course_result_pages.offset @course_result = paginateHelper @course_result, @limit else - @shixuns_result = Shixun.where(:status => [2,3]).where("name like ?", "%#{@search}%").reorder("created_at desc") + # @shixuns_result = Shixun.where(:status => [2,3]).where("name like ?", "%#{@search}%").reorder("created_at desc") + @shixuns_result = Shixun.where("name like ?", "%#{@search}%").reorder("created_at desc") @shixuns_result_count = @shixuns_result.count @shixun_pages = Paginator.new @shixuns_result_count, @limit, params['page'] || 1 @offset ||= @shixun_pages.offset diff --git a/app/views/challenges/_edit_skill.html.erb b/app/views/challenges/_edit_skill.html.erb index 599337fa2..27b3a53cf 100644 --- a/app/views/challenges/_edit_skill.html.erb +++ b/app/views/challenges/_edit_skill.html.erb @@ -1,28 +1,28 @@
-
"> -
-

- <% if User.current.manager_of_shixun?(@shixun) %> - 编辑 - <% end %> -

-
- -
-
diff --git a/app/views/challenges/_skill_form.html.erb b/app/views/challenges/_skill_form.html.erb index 682901801..8540374d9 100644 --- a/app/views/challenges/_skill_form.html.erb +++ b/app/views/challenges/_skill_form.html.erb @@ -31,7 +31,7 @@ - + @@ -57,6 +57,7 @@ // 获取父节点的id var obj = $(thisObj).parent(); $(obj).remove(); + $("#challenge_skill_update").submit(); } $(document).click(function(e){ if(e.target.id==$("#edit_skill").attr("id")||e.target.id==$("#add_knowledge").attr("id")||e.target.className==$(".knowledge_frame").attr("class")||e.target.className==$(".close").attr("class")||e.target.id==$("#shixun_skill_input").attr("id")){ diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index 3861be090..de597ba44 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -111,8 +111,8 @@ var keyword = $("input[name='search_keyword']").val(); // 搜索关键字 var index = $("#all_status_show_value").text(); // 搜索课程/项目 index = index == "课堂" ? 1 : 2; - console.log("课堂" === index); - console.log("实训" === index); +// console.log("课堂" === index); +// console.log("实训" === index); window.location.href = "<%= search_shixuns_or_courses_users_path %>" + "?search=" + keyword + "&index=" + index; /* $.ajax({ url: "<%#= search_shixuns_or_courses_users_path %>", diff --git a/app/views/managements/_class_publish_shixuns_list.html.erb b/app/views/managements/_class_publish_shixuns_list.html.erb index ab4fd8871..2a57856d7 100644 --- a/app/views/managements/_class_publish_shixuns_list.html.erb +++ b/app/views/managements/_class_publish_shixuns_list.html.erb @@ -5,7 +5,7 @@ 实训套件名称 单位 创建者 - 发布时间 + 发布时间 color-light-green ml5"> @@ -29,3 +29,15 @@
+ \ No newline at end of file diff --git a/app/views/managements/_class_shixuns_list.html.erb b/app/views/managements/_class_shixuns_list.html.erb index de0d67b18..8d36b085e 100644 --- a/app/views/managements/_class_shixuns_list.html.erb +++ b/app/views/managements/_class_shixuns_list.html.erb @@ -51,17 +51,6 @@ diff --git a/app/views/managements/_close_shixun_list.html.erb b/app/views/managements/_close_shixun_list.html.erb index bbaae10a5..155fe70a7 100644 --- a/app/views/managements/_close_shixun_list.html.erb +++ b/app/views/managements/_close_shixun_list.html.erb @@ -1,7 +1,7 @@ - + @@ -14,7 +14,7 @@ <% @shixuns.each do |shixun| %> - + diff --git a/app/views/managements/_depart_list.html.erb b/app/views/managements/_depart_list.html.erb index 6473af2a5..2e0d468cc 100644 --- a/app/views/managements/_depart_list.html.erb +++ b/app/views/managements/_depart_list.html.erb @@ -1,3 +1,4 @@ +<% unless @apply_status.blank? %>
ID实训名称实训名称 未通关
<%= shixun.identifier %><%= link_to shixun.name, shixun_path(shixun), :target => "_blank", :title => shixun.name %><%= link_to shixun.name, shixun_path(shixun), :target => "_blank", :title => shixun.name %> <%= PraiseTread.where(:praise_tread_object_id => shixun.challenges, :praise_tread_object_type => "Challenge").count %>
@@ -24,6 +25,9 @@ <% end %>
+<% else %> + <%= render :partial => "welcome/no_data" %> +<% end %>