From d8974ef1846d91185fa15889615194963b2fad39 Mon Sep 17 00:00:00 2001 From: XuCheng642 <287102909@qq.com> Date: Wed, 6 Sep 2017 09:26:19 +0800 Subject: [PATCH 1/3] =?UTF-8?q?issue=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 72 +++++++++++------- app/views/layouts/base_management.html.erb | 30 ++++---- .../_classroom_classment_list.html.erb | 9 ++- .../managements/_classroom_list.html.erb | 36 ++++++--- .../_departments_part_list.html.erb | 2 +- app/views/managements/_user_list.html.erb | 4 +- .../_users_authorization_list.html.erb | 2 + app/views/managements/classroom.html.erb | 22 +++--- .../managements/classroom_classment.html.erb | 2 +- app/views/managements/departments.html.erb | 2 +- app/views/managements/users.html.erb | 75 +++++++++++++++++-- app/views/managements/users_trial.html.erb | 1 + .../syllabuses/_join_syllabuses.html.erb | 32 ++++---- app/views/syllabuses/_my_syllabuses.html.erb | 33 ++++---- app/views/syllabuses/index.html.erb | 23 +++--- app/views/users/shixuns.html.erb | 7 +- config/routes.rb | 1 + public/stylesheets/css/edu-admin.css | 6 +- public/stylesheets/css/edu-common.css | 12 +-- 19 files changed, 240 insertions(+), 131 deletions(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index dc33b059d..ee59dc8b5 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -147,6 +147,15 @@ class ManagementsController < ApplicationController end end + # 用户修改界面 + def update_user + @menu_type = 7 + @sub_type = 1 + respond_to do |format| + format.js + format.html + end + end # 实训留言 def shixun_feedback @menu_type = 9 @@ -168,7 +177,7 @@ class ManagementsController < ApplicationController # 专业列表 def profession @major=Major.where("0=0") - @menu_type = 12 + # @menu_type = 12 @sub_type = 1 @sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order] major_level_option = params[:major_level] if params[:major_level] @@ -224,9 +233,9 @@ class ManagementsController < ApplicationController # 实训适用课程 def applicable_course - @menu_type = 12 + # @menu_type = 12 @sub_type = 2 - @major = Major.where(:major_level => 2) + @major = Major.where(:major_level => 2,:support_shixuns => 1) @courselist = CourseList.where("0=0") search=params[:search] unless search.blank? @@ -273,7 +282,8 @@ end if search.blank? @department = @department else - @department = @department.where("name like '%#{search}%'") + apply = School.where("name like '%#{search}%'").map(&:id) + @department = @department.where(:school_id => apply) end @department = @department.reorder("created_at #{@sx_order}") @department_count =@department.count @@ -603,32 +613,32 @@ end @sub_type = 1 @syllabus = Syllabus.where("0=0") @sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order] - major_level_option = params[:major_level] if params[:major_level] - discipline_category_option = params[:discipline_category_id] if params[:discipline_category_id] - first_level_discipline_option = params[:first_level_discipline_id] if params[:first_level_discipline_id] - syllabus_major_option = params[:major_id] if params[:major_id] + # major_level_option = params[:major_level] if params[:major_level] + # discipline_category_option = params[:discipline_category_id] if params[:discipline_category_id] + # first_level_discipline_option = params[:first_level_discipline_id] if params[:first_level_discipline_id] + # syllabus_major_option = params[:major_id] if params[:major_id] keyword = params[:keyword] search = params[:search] - if major_level_option && major_level_option != '0' - @syllabus = @syllabus.where(:major_level=>major_level_option) - end + # if major_level_option && major_level_option != '0' + # @syllabus = @syllabus.where(:major_level=>major_level_option) + # end + # + # if discipline_category_option && discipline_category_option != '0' + # @syllabus=@syllabus.where(:discipline_category_id=>discipline_category_option) + # end + # + # if first_level_discipline_option && first_level_discipline_option != '0' + # @syllabus=@syllabus.where(:first_level_discipline_id=>first_level_discipline_option) + # end + # + # if syllabus_major_option && syllabus_major_option != '0' + # @syllabus=@syllabus.where(:major_id=>syllabus_major_option) + # end - if discipline_category_option && discipline_category_option != '0' - @syllabus=@syllabus.where(:discipline_category_id=>discipline_category_option) - end - - if first_level_discipline_option && first_level_discipline_option != '0' - @syllabus=@syllabus.where(:first_level_discipline_id=>first_level_discipline_option) - end - - if syllabus_major_option && syllabus_major_option != '0' - @syllabus=@syllabus.where(:major_id=>syllabus_major_option) - end - - if params[:school_id] && params[:school_id] != '' - @syllabus = @syllabus.includes(:user => {:user_extensions => []}).where("user_extensions.school_id = #{params[:school_id]}") - end + # if params[:school_id] && params[:school_id] != '' + # @syllabus = @syllabus.includes(:user => {:user_extensions => []}).where("user_extensions.school_id = #{params[:school_id]}") + # end if search.blank? @syllabus = @syllabus @@ -807,7 +817,7 @@ end @sub_type = 1 status = params[:user_status].nil? ? 0 : params[:user_status].to_i @us_order = params[:us_order].blank? ? "desc" : params[:us_order] # 排序 - @order_key = params[:order_key].blank? ? "created_on" : params[:order_key] # 排序关键字 + @order_key = params[:order_key].blank? ? "last_login_on" : params[:order_key] # 排序关键字 condition = (params[:research_condition].nil? || params[:research_condition] == "name") ? "concat(lastname, firstname)" : params[:research_condition] if 0 == status if params[:research_condition] == "phone" && params[:research_contents].blank? @@ -822,6 +832,9 @@ end @users = User.where("status = #{status} and #{condition} like '%#{params[:research_contents]}%'").order("#{@order_key} #{@us_order}").all end end + # if params[:school_id] && params[:school_id] !='' + # @users = @users.find(params[:school_id]) + # end @users_count = @users.count @limit = 20 @is_remote = true @@ -1047,12 +1060,13 @@ end elsif params[:research_condition] == "email" @users = User.where(:id => user_id).where("mail like '%#{params[:research_contents]}%'").order("created_on desc") elsif params[:research_condition] == "phone" + @users = User.where(:id => user_id).where("phone like '%#{params[:research_contents]}%'").order("created_on desc") + elsif params[:research_condition] == "nickname" if params[:research_contents].blank? @users = User.where(:id => user_id).order("created_on desc") else - @users = User.where(:id => user_id).where("phone like '%#{params[:research_contents]}%'").order("created_on desc") + @users = User.where(:id => user_id).where("nickname like '%#{params[:research_contents]}%'").order("created_on desc") end - end @users_count = @users.count diff --git a/app/views/layouts/base_management.html.erb b/app/views/layouts/base_management.html.erb index a851c7840..e35bd484c 100644 --- a/app/views/layouts/base_management.html.erb +++ b/app/views/layouts/base_management.html.erb @@ -30,28 +30,32 @@ <% when 3 %> <%= @sub_type == 1 ? "实训列表" :(@sub_type == 2 ? "已发布的实训": (@sub_type == 3 ? "已关闭的实训": "镜像管理")) %> <% when 4 %> - <%= @sub_type == 1 ? "实训路径" : "已发布实训套件" %> + <%= @sub_type == 1 ? "实训路径列表" : "已发布实训路径" %> <% when 5 %> 竞赛 <% when 6 %> <%= @sub_type == 1 ? "单位列表" :"单位部门列表" %> <% when 7 %> <%= @sub_type == 1 ? "用户列表" :"试用授权列表" %> + + + + <% when 8 %> 消息 <% when 9 %> <%= @sub_type == 1 ? "实训留言列表" : "" %> <% when 10 %> - <%= @sub_type == 1 ? "实名认证":(@sub_type == 2? "试用授权":(@sub_type == 3?"部门审批":(@sub_type == 4?"单位审批":(@sub_type == 5?"全部实训发布":(@sub_type == 6?"课程实训发布":"职业认证")))))%> + <%= @sub_type == 1 ? "实名认证":(@sub_type == 2? "试用授权":(@sub_type == 3?"部门审批":(@sub_type == 4?"单位审批":(@sub_type == 5?"实训发布":(@sub_type == 6?"实训路径发布":"职业认证")))))%> <% when 11 %> 工程认证+ <% when 12 %> - <%= @sub_type == 1 ?"专业列表" : "实训适用课程列表" %> + <%#= @sub_type == 1 ?"专业列表" : "实训适用课程列表" %> <% end %>
<%= link_to User.current.show_real_name, user_path(User.current) %> > <%= link_to '在线课堂', courses_path() %> > 我的课堂
-<%= @user.show_name %> > 全部实训 > 我的实训
-<%= sy.name %>
diff --git a/app/views/courses/_course_index_search.html.erb b/app/views/courses/_course_index_search.html.erb index 7214be2ab..3c07cd79c 100644 --- a/app/views/courses/_course_index_search.html.erb +++ b/app/views/courses/_course_index_search.html.erb @@ -1,10 +1,10 @@ - diff --git a/app/views/courses/index.html.erb b/app/views/courses/index.html.erb index aea82e37a..49dd1a06e 100644 --- a/app/views/courses/index.html.erb +++ b/app/views/courses/index.html.erb @@ -12,11 +12,11 @@确实让创新更美好
++ 亲爱的<%= @login %>,您好~ +
- 您好!
- 您已经成功注册为Trustie用户!
- 请点击以下链接激活您的帐号:
+ 您已经成功注册为Educoder用户,请在24小时内点击以下链接激活您的账号:
+ 如非本人操作,请忽略此邮件。
<%= link_to h(@url), @url, :style => "font-weight: normal; color:#3b94d6;" %>
(如果链接点击无效,请手动复制链接并粘贴到浏览器地址栏中,然后按“回车”打开页面即可)
-
+
+ 此邮件为系统所发,请勿直接回复。
-
- 扫一扫,关注 Trustie 微信公众号,更方便获任务通知,作业等提醒
- 想了解更多信息,请访问 www.trustie.net
+
+ 如果您并未发过此请求,则可能是因为其他用户在尝试重设密码时误输了您的邮件地址,而使您收到了这封邮件,那么您可以放心的忽略此邮件,无需进一步采取任何操作。
<% if User.current.manager_of_shixun?(@shixun) %> - 编辑 + 编辑 + <% if @shixun.status == 2 %> + 永久关闭 + <% end %> <% end %>
<%= link_to User.current.show_name, user_path(User.current) %> > <%= link_to "实训路径", subjects_path() %> - > 编辑 + > 编辑实训路径
<%= link_to User.current.show_name, user_path(User.current) %> > <%= link_to "实训路径", subjects_path() %> - > 新建 + > 新建实训路径
" + - "" + - " " + had_passed_testsests_error_count + '/' + test_sets_count + "" + latest_output + "
"; - - } else { - $d = "" + - "" + - "" + test_sets_count + "/" + test_sets_count + " 全部通过
"; - } - - } - var $forHtml = ""; - var $Bear = ""; - for (var i = 0; i < test_sets.length; i++) { -/* console.log("test_sets[" +i+"]" + test_sets[i].result); - console.log("test_sets[" +i+"]" + test_sets[i].is_public); - console.log("test_sets[" +i+"]" + test_sets[i].actual_output); - console.log("test_sets[" +i+"]" + test_sets[i].output); - console.log("test_sets[" +i+"]" + test_sets[i].input);*/ - if (test_sets[i].result == 0) { - $g = "" - } - if (test_sets[i].result == 1) { - $g = "" - } - if (test_sets[i].is_public == 0) { - $g = "" - } - if (test_sets[i].is_public == 1) { - $h = "" + ( test_sets[i].input == null ? "空" : test_sets[i].input.replace(/\r\n/g, "
") ) + "
" + ( test_sets[i].output == null ? "空" : test_sets[i].output.replace(/\r\n/g, "
").replace(/ /g, "") ) + "
" + (test_sets[i].actual_output == null ? "空" : test_sets[i].actual_output.replace(/\r\n/g, "
").replace(/ /g, "")) + "
此为隐藏测试项,暂不支持查看
" + - "" + - "" + - "" + had_passed_testsests_error_count + "/" + test_sets_count + " " + latest_output + "
"; - - } else { - $n = "" + - "" + - "" + test_sets_count + "/" + test_sets_count + " 全部通过
"; - } - // $("#evaluating_info").html($n); - } - $EvaluationInformation = "+ <%= course.name %> + + <%= User.where(:id => course.tea_id).first.show_name %> + <%= time_from_now course.updated_at %>更新 +
+ <% end %> +<%= link_to User.current.show_real_name, user_path(User.current) %> > <%= link_to '在线课堂', courses_path() %> > 我的课堂
@@ -6,42 +6,20 @@