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

<%= render_flash_messages %> diff --git a/app/views/managements/_classroom_classment_list.html.erb b/app/views/managements/_classroom_classment_list.html.erb index 61255f9ce..7b3dfeffe 100644 --- a/app/views/managements/_classroom_classment_list.html.erb +++ b/app/views/managements/_classroom_classment_list.html.erb @@ -2,7 +2,7 @@ ID - 课堂名称 + 课堂名称 成员 资源 作业 @@ -10,9 +10,9 @@ 私有 状态 创建者单位 - 创建者 + 创建者 动态时间 color-light-green ml5" title="功能完善中,敬请期待"> - 首页显示 + 操作 @@ -30,8 +30,9 @@ <%= link_to course.teacher.show_real_name, user_path(course.teacher) %> <%= format_time(course.updatetime) %> + 删除 class="ml-3 mr5 magic-checkbox" id="join_course_role_<%= course.id %>"> - + <% end %> diff --git a/app/views/managements/_classroom_list.html.erb b/app/views/managements/_classroom_list.html.erb index a77607945..c005118e3 100644 --- a/app/views/managements/_classroom_list.html.erb +++ b/app/views/managements/_classroom_list.html.erb @@ -2,28 +2,42 @@ ID - 层级 - 学科门类 - 一级学科 - 专业名称 - 课程名称 - 创建者 - 创建时间 color-light-green ml5"> + + + + + 课程名称 + 课堂 + 实训 + 创建者 + 创建时间 color-light-green ml5"> + 操作 <% @syllabus.each_with_index do |syllabus,index| %> <%= index + 1 %> - <%= syllabus.syllabus_major_level == '' ? "--" : syllabus.syllabus_major_level %> - <%= syllabus.syllabus_discipline_category == '' ? "--" : syllabus.syllabus_discipline_category %> - <%= syllabus.syllabus_first_level_discipline == "" ? "--" : syllabus.syllabus_first_level_discipline %> - <%= syllabus.syllabus_major == "" ? "--" : syllabus.syllabus_major %> + + + + <%= link_to syllabus.title,syllabus_path(syllabus.id) %> + + <%= syllabus.courses.count %> + + + <%= %> + <%= link_to syllabus.user.show_real_name, user_path(syllabus.user) %> <%= format_time syllabus.created_at %> + + 删除 + + + <% end %> diff --git a/app/views/managements/_departments_part_list.html.erb b/app/views/managements/_departments_part_list.html.erb index c233826d9..8c4ec992b 100644 --- a/app/views/managements/_departments_part_list.html.erb +++ b/app/views/managements/_departments_part_list.html.erb @@ -25,7 +25,7 @@ <%= schools.province %> - <%= schools.province == nil ? "--" :schools.province%><%= schools.city == nil ? "" :schools.city %><%= schools.address == nil ? "" :schools.address %> + <%= ApplyAddSchools.where(:school_id => schools.id,:status => 1).map(&:address).join("-") %> <%= UserExtensions.where(:school_id => schools.id).count %> <%= schools.departments.count %> <%= format_time schools.created_at %> diff --git a/app/views/managements/_user_list.html.erb b/app/views/managements/_user_list.html.erb index 464973fa0..e7144f7b6 100644 --- a/app/views/managements/_user_list.html.erb +++ b/app/views/managements/_user_list.html.erb @@ -15,7 +15,9 @@ <% @users.each do |user| %> <%= user.login %> - <%= user.try(:show_real_name) %> + + <%= link_to user.try(:show_real_name),user_path(user) %> + "><%= user.mail.blank? ? "--" : user.mail %> "><%= user.phone.blank? ? "--" : user.phone %> diff --git a/app/views/managements/_users_authorization_list.html.erb b/app/views/managements/_users_authorization_list.html.erb index 4f62413f7..f4ba918d8 100644 --- a/app/views/managements/_users_authorization_list.html.erb +++ b/app/views/managements/_users_authorization_list.html.erb @@ -4,6 +4,7 @@   ID 真实姓名 + 昵称 职业 学号 实名 @@ -26,6 +27,7 @@ <%= link_to user.try(:show_real_name), user_path(user), :class => "edu-txt-w100 task-hide2" %> + <%= user.nickname == ""? "--" : user.nickname %> <%= user.identity %> <%= user.try(:user_extensions).try(:student_id).blank? ? "--" : user.try(:user_extensions).try(:student_id) %> <%= user.authentication ? "已认证" : "未认证" %> diff --git a/app/views/managements/classroom.html.erb b/app/views/managements/classroom.html.erb index 708ed6726..da83c96fc 100644 --- a/app/views/managements/classroom.html.erb +++ b/app/views/managements/classroom.html.erb @@ -1,16 +1,16 @@ <%= form_tag(url_for(classroom_managements_path),:id=>"classroom",:method => "post",:remote=>true) do %>
- <%= select_tag :major_level,options_for_select(major_level_option, 0), {:id=>"major_level", :class=>"fl task-form-15 task-height-30", :style => "margin:0px 10px 0px 25px;"} %> - <%= select_tag :discipline_category_id,options_for_select(discipline_category_option, nil), {:id=>"discipline_category_id", :class=>"fl task-form-15 task-height-30", :style => "margin:0px 30px 0px 50px;"} %> - <%= select_tag :first_level_discipline_id,options_for_select(first_level_discipline_option, nil), {:id=>"first_level_discipline_id", :class=>"fl task-form-20 task-height-30", :style => "margin:0px 30px 0px 25px;"} %> - <%= select_tag :major_id,options_for_select(syllabus_major_option, nil), {:id=>"major_id", :class=>"fl task-form-20 task-height-30", :style => "margin:0px 30px 0px 25px;"} %> -
  • - - -
    -
  • - + <%#= select_tag :major_level,options_for_select(major_level_option, 0), {:id=>"major_level", :class=>"fl task-form-15 task-height-30", :style => "margin:0px 10px 0px 25px;"} %> + <%#= select_tag :discipline_category_id,options_for_select(discipline_category_option, nil), {:id=>"discipline_category_id", :class=>"fl task-form-15 task-height-30", :style => "margin:0px 30px 0px 50px;"} %> + <%#= select_tag :first_level_discipline_id,options_for_select(first_level_discipline_option, nil), {:id=>"first_level_discipline_id", :class=>"fl task-form-20 task-height-30", :style => "margin:0px 30px 0px 25px;"} %> + <%#= select_tag :major_id,options_for_select(syllabus_major_option, nil), {:id=>"major_id", :class=>"fl task-form-20 task-height-30", :style => "margin:0px 30px 0px 25px;"} %> + + + + + + + - + 搜索 diff --git a/app/views/managements/departments.html.erb b/app/views/managements/departments.html.erb index 52d67560e..cfdc9db60 100644 --- a/app/views/managements/departments.html.erb +++ b/app/views/managements/departments.html.erb @@ -1,6 +1,6 @@ <%= form_tag(url_for(departments_managements_path),:id=>"department_search",:method => "post",:remote=>true) do %>
    - + 搜索 清除 <%= link_to '创建',{:controller => 'managements', :action => 'create_departments'}, :remote => true, :class => "task-btn task-btn-green fr mt6 mr30" %> diff --git a/app/views/managements/users.html.erb b/app/views/managements/users.html.erb index 506df5b60..7da7b7f54 100644 --- a/app/views/managements/users.html.erb +++ b/app/views/managements/users.html.erb @@ -20,13 +20,78 @@
    - - 搜索 - 清除 +
    - +
  • + + +
    +
  • + + + 搜索 + 清除 + + + <% end %>
    <%= render :partial => "managements/user_list" %> -
    \ No newline at end of file + + \ No newline at end of file diff --git a/app/views/managements/users_trial.html.erb b/app/views/managements/users_trial.html.erb index 176f1ed04..e3932c533 100644 --- a/app/views/managements/users_trial.html.erb +++ b/app/views/managements/users_trial.html.erb @@ -26,6 +26,7 @@
  • 真实姓名搜索
  • 邮箱地址搜索
  • 手机号码搜索
  • +
  • 用户昵称搜索
  • diff --git a/app/views/syllabuses/_join_syllabuses.html.erb b/app/views/syllabuses/_join_syllabuses.html.erb index 99c74ac56..253ce22ff 100644 --- a/app/views/syllabuses/_join_syllabuses.html.erb +++ b/app/views/syllabuses/_join_syllabuses.html.erb @@ -4,16 +4,16 @@ <% if !(@status == 2 && course_count == 0) %>
    - <%= syllabus.title.strip() %> - <%= format_time syllabus.updated_at %> 更新 + <%= syllabus.title.strip() %> +
    -
    - -
      -
    • <%= link_to "新建班级", new_course_path(:syllabus_id => syllabus.id), :target => '_blank', :title => "新建班级"%>
    • -
    • <%= link_to '查看课程', syllabus_path(syllabus.id), :target =>'_blank', :title => '查看课程' %>
    • -
    • - <% if User.current == syllabus.user || User.current.admin? %> - <%= link_to '删除课程', delete_syllabus_syllabus_path(syllabus), :remote => 'true' %> - <% end %> -
    • -
    -
    + + + + + + + + + + + +