From bb9fb39396dda6a8a7fc03222a4f6eaa8f692f00 Mon Sep 17 00:00:00 2001 From: XuCheng642 <287102909@qq.com> Date: Fri, 1 Sep 2017 19:37:09 +0800 Subject: [PATCH 01/21] =?UTF-8?q?=E7=BC=BA=E9=99=B7=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/department_controller.rb | 22 ++++ app/controllers/managements_controller.rb | 124 ++++++++++++++---- app/controllers/school_controller.rb | 21 ++- app/models/apply_add_department.rb | 15 ++- app/views/challenges/_skill_form.html.erb | 2 +- app/views/courses/new.html.erb | 2 +- app/views/department/destroy.js.erb | 6 + app/views/layouts/base_management.html.erb | 4 +- .../managements/_all_department.html.erb | 2 +- app/views/managements/_all_schools.html.erb | 2 +- .../_classroom_classment_list.html.erb | 6 +- .../managements/_create_department.html.erb | 99 ++++++++++++++ .../managements/_departments_list.html.erb | 33 +++-- .../_departments_part_list.html.erb | 2 +- .../managements/_update_department.html.erb | 52 ++++++++ .../_update_department_form.html.erb | 2 +- .../_update_department_school.html.erb | 24 ++++ .../managements/_update_school_form.html.erb | 2 +- app/views/managements/add_department.js.erb | 1 + app/views/managements/all_department.js.erb | 2 +- app/views/managements/all_schools.js.erb | 2 +- .../managements/create_departments.js.erb | 2 + app/views/managements/departments.html.erb | 2 +- .../managements/trial_authorization.html.erb | 2 +- .../managements/update_department.js.erb | 6 + app/views/school/destroy.js.erb | 5 + .../users/_user_experience_content.html.erb | 74 +++++------ app/views/users/growth_record.html.erb | 2 +- app/views/users/show.html.erb | 6 +- config/routes.rb | 4 + 30 files changed, 426 insertions(+), 102 deletions(-) create mode 100644 app/views/department/destroy.js.erb create mode 100644 app/views/managements/_create_department.html.erb create mode 100644 app/views/managements/_update_department.html.erb create mode 100644 app/views/managements/_update_department_school.html.erb create mode 100644 app/views/managements/add_department.js.erb create mode 100644 app/views/managements/create_departments.js.erb create mode 100644 app/views/managements/update_department.js.erb create mode 100644 app/views/school/destroy.js.erb diff --git a/app/controllers/department_controller.rb b/app/controllers/department_controller.rb index 7e9438843..eeb4a82ba 100644 --- a/app/controllers/department_controller.rb +++ b/app/controllers/department_controller.rb @@ -1,5 +1,7 @@ class DepartmentController < ApplicationController + before_filter :find_department, :only => [:destroy] + #根据部门名字或者拼音来查询 def on_search school = School.find params[:school_id] @@ -95,4 +97,24 @@ class DepartmentController < ApplicationController render :json =>status end + + def destroy + if @department + if UserExtensions.where(:department_id => @department.id).count == 0 + ApplyAddDepartment.where(:department_id=>@department.id).update_all(:status => 2) + @apply_dep = ApplyAddDepartment.where(:department_id=>@department.id).first + @department.destroy + end + respond_to do |format| + format.js + end + end + end + + private + def find_department + @department = Department.find params[:id] + rescue ActiveRecord::RecordNotFound + render_404 + end end diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 5afefc51c..ca759ce77 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_level=> 1) + @major = @major.where(:support_shixuns => params[:support_shixuns].to_i,:major_level=>2) end @major = @major.order("created_at #{@sx_order}") @@ -219,7 +219,7 @@ end @menu_type = 6 @sub_type = 2 @sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order] - @department =Department.where("0=0") + @department = ApplyAddDepartment.where(:status => 1) search=params[:search] if search.blank? @department = @department @@ -239,6 +239,72 @@ end end end + # 新增 + def create_departments + respond_to do |format| + format.js + end + end + + def add_department + department = Department.where(:school_id => params[:school], :name => params[:department]).first + if department.nil? + department = Department.create(:school_id => params[:school],:name => params[:department]) + ApplyAddDepartment.create(:school_id => params[:school], + :status => 1, + :name => params[:department], + :department_id => department.id, + :user_id => User.current.id); + end + respond_to do |format| + format.js + end + #redirect_to departments_managements_path + end + + # 修改单位部门列表 + def update_department + dep = Department.find params[:department_id] + apply_schools = ApplyAddDepartment.where(:status => 1, :school_id => dep.school_id) + apply_school_ids = apply_schools.empty? ? "(-1)" : "(" + apply_schools.map{|sc| sc.department_id}.join(',') + ")" + @edit_id = params[:department_id] + @search = params[:search] + if !params[:search].nil? + search = "%#{params[:search].to_s.strip.downcase}%" + @departments = Department.where("id in #{apply_school_ids} and #{Department.table_name}.name like :p", :p => search) + #@schools = School.all + else + @departments = Department.where("id in #{apply_school_ids}") + end + respond_to do |format| + format.js + end + end + + def edit_departments_school + begin + dep = Department.find(params[:department_id]); + alter_dep = Department.find(params[:alter_dep_id]); + apply_dep = ApplyAddDepartment.where(:department_id => params[:alter_dep_id]) + if dep && alter_dep + # users = UserExtensions.where("department_id = #{dep.id}") + # users.update_all(:department_id => params[:alter_dep_id]) + # dep.destroy + # apply_dep.update_all(:status => 2) + # ApplyAddDepartment.where(:department_id =>params[:departments]).update_all(:department_id=>department_id) + # users = UserExtensions.where("department_id = #{alt_dep.department_id}") + # users.update_all(:department_id => department.id) + apply_dep.destroy_all; + users = UserExtensions.where(:department_id => params[:alter_dep_id]) + users.update_all(:department_id => dep.id) + alter_dep.destroy + end + rescue Exception => e + puts e + end + redirect_to departments_managements_path + end + # 单位列表 def departments_part @menu_type = 6 @@ -324,23 +390,24 @@ end # 部门修改 def all_department - apply_department = ApplyAddDepartment.where("status = 0") + @edit_id = params[:department_id] + @search = params[:search] + apply_department = ApplyAddDepartment.where(:status => 1) apply_department_ids = apply_department.empty? ? "(-1)" : "(" + apply_department.map{|sc| sc.department_id}.join(',') + ")" if !params[:search].nil? search = "%#{params[:search].to_s.strip.downcase}%" - @department = Department.where("id not in #{apply_department_ids} and #{Department.table_name}.name like :p", :p => search) + @department = Department.where("id in #{apply_department_ids} and #{Department.table_name}.name like :p", :p => search) #@schools = School.all else #@course = @user.courses.where("is_delete = 0 and #{Course.table_name}.id != #{homework.course_id}").select { |course| @user.allowed_to?(:as_teacher,course)} - @department = Department.where("id not in #{apply_department_ids}") + @department = Department.where("id in #{apply_department_ids}") end - @edit_id = params[:department_id] - @search = params[:search] respond_to do |format| format.js end # redirect_to unit_managements_path end + # 修改 def edit_applied_department aas =ApplyAddDepartment.find(params[:applied_id]) @@ -349,19 +416,19 @@ end department =Department.find params[:department_id] begin #更新消息表的status - applied_message_id = aas.department_id - applied_message = AppliedMessage.where(:applied_id => applied_message_id, :applied_type => "ApplyAddDepartment") - applied_message.update_all(:status => 4) - aas.update_attribute(:status, 2) - AppliedMessage.create(:user_id => aas.user_id, :status => 2, :viewed => 0, :applied_id => aas.id, :applied_type => "ApplyAddDepartment", :name =>department[0].name ) - users = UserExtensions.where("department_id = #{aas.department_id}") - users.update_all(:department_id => department.id) if aas.department_id != department.id.to_i + applied_message_id = aas.department_id + applied_message = AppliedMessage.where(:applied_id => applied_message_id, :applied_type => "ApplyAddDepartment") + applied_message.update_all(:status => 4) + aas.update_attribute(:status, 2) + AppliedMessage.create(:user_id => aas.user_id, :status => 2, :viewed => 0, :applied_id => aas.id, :applied_type => "ApplyAddDepartment", :name =>department.name ) + users = UserExtensions.where("department_id = #{aas.department_id}") + users.update_all(:department_id => department.id) aas.department.destroy + ApplyAddDepartment.where(:department_id => aas.department_id).update_all(:department_id => department.id) + Department.where(:department_id => aas.department_id).destroy_all + aas.destroy_all end - ApplyAddDepartment.where(:department_id => aas.department_id).update_all(:department_id => department.id) - Department.where(:department_id => aas.department_id).update_all(:department_id => department.id) - aas.update_attribute(:department_id, department.id) rescue Exception => e puts e end @@ -463,19 +530,20 @@ end school = School.find params[:school_id] begin #更新消息表的status - applied_message_id = aas.school_id - applied_message = AppliedMessage.where(:applied_id => applied_message_id, :applied_type => "ApplyAddSchools") - applied_message.update_all(:status => 4) - aas.update_attribute(:status, 2) - AppliedMessage.create(:user_id => aas.user_id, :status => 2, :viewed => 0, :applied_id => aas.id, :applied_type => "ApplyAddSchools", :name => school[0].name ) - users = UserExtensions.where("school_id = #{aas.school_id}") - users.update_all(:school_id => school.id) if aas.school_id != school.id.to_i + applied_message_id = aas.school_id + applied_message = AppliedMessage.where(:applied_id => applied_message_id, :applied_type => "ApplyAddSchools") + applied_message.update_all(:status => 4) + aas.update_attribute(:status, 2) + AppliedMessage.create(:user_id => aas.user_id, :status => 2, :viewed => 0, :applied_id => aas.id, :applied_type => "ApplyAddSchools", :name => school.name ) + users = UserExtensions.where("school_id = #{aas.school_id}") + users.update_all(:school_id => school.id) + + ApplyAddDepartment.where(:school_id => aas.school_id).update_all(:school_id => school.id) + Department.where(:school_id => aas.school_id).update_all(:school_id => school.id) aas.school.destroy + aas.update_attribute(:school_id, school.id) end - ApplyAddDepartment.where(:school_id => aas.school_id).update_all(:school_id => school.id) - Department.where(:school_id => aas.school_id).update_all(:school_id => school.id) - aas.update_attribute(:school_id, school.id) rescue Exception => e puts e end @@ -539,7 +607,7 @@ end end end - # 班级列表 + # 课堂列表 def classroom_classment @menu_type = 2 @sub_type = 2 diff --git a/app/controllers/school_controller.rb b/app/controllers/school_controller.rb index ef053bb16..334c880e2 100644 --- a/app/controllers/school_controller.rb +++ b/app/controllers/school_controller.rb @@ -1,7 +1,7 @@ class SchoolController < ApplicationController layout 'course_base' before_filter :require_admin, :only => :upload_logo - + before_filter :find_school, :only => [:destroy] def upload uploaded_io = params[:logo] school_id ||= params[:id] @@ -283,4 +283,23 @@ class SchoolController < ApplicationController render :json=>{:status=>status,:id=>params[:id],:province=>province,:city=>city} end + + def destroy + if @school + if UserExtensions.where(:school_id => @school.id).count == 0 + School.where(:id=>@school.id).destroy_all + @school.destroy + end + respond_to do |format| + format.js + end + end + end + + private + def find_school + @school = School.find params[:id] + rescue ActiveRecord::RecordNotFound + render_404 + end end diff --git a/app/models/apply_add_department.rb b/app/models/apply_add_department.rb index 4b6a984d0..5ea5c00ec 100644 --- a/app/models/apply_add_department.rb +++ b/app/models/apply_add_department.rb @@ -1,7 +1,8 @@ -class ApplyAddDepartment < ActiveRecord::Base - belongs_to :school - belongs_to :user - attr_accessible :name, :remarks, :status, :school_id, :user_id - has_many :applied_messages, :class_name =>'AppliedMessage', :as => :applied - belongs_to :department -end +class ApplyAddDepartment < ActiveRecord::Base + belongs_to :school + belongs_to :user + attr_accessible :name, :remarks, :status, :school_id, :user_id, :department_id + has_many :applied_messages, :class_name =>'AppliedMessage', :as => :applied + belongs_to :department + # status: 0表示未批准; status:1表示已批准; status: 2表示已更改; status: 3表示已拒绝; status: 4表示已更改后废除的部门 +end diff --git a/app/views/challenges/_skill_form.html.erb b/app/views/challenges/_skill_form.html.erb index 8540374d9..11c0977f4 100644 --- a/app/views/challenges/_skill_form.html.erb +++ b/app/views/challenges/_skill_form.html.erb @@ -11,7 +11,7 @@ <% end %> <% end %> -
" id="add_shixun_skill"> +
" id="add_shixun_skill">
diff --git a/app/views/courses/new.html.erb b/app/views/courses/new.html.erb index 0c743e1c8..bafa08391 100644 --- a/app/views/courses/new.html.erb +++ b/app/views/courses/new.html.erb @@ -58,7 +58,7 @@
-

结束日期过后,课堂进入归档状态,只能在历史课堂中查看

+

结束日期过后,课堂进入<%= link_to '归档状态', courses_path(:select => "end", :is_end => 1),:target => '_blank', :class => 'color-orange05' %>,只能在历史课堂中查看

diff --git a/app/views/department/destroy.js.erb b/app/views/department/destroy.js.erb new file mode 100644 index 000000000..4c853a4b0 --- /dev/null +++ b/app/views/department/destroy.js.erb @@ -0,0 +1,6 @@ +console.log(111); +for(var i=0; i<$("#apply_add_department_<%= @apply_dep.id %>").nextAll().length; i++){ + var index = parseInt($($("#apply_add_department_<%= @apply_dep.id %>").nextAll()[i]).children(":first").html()); + $($("#apply_add_department_<%= @apply_dep.id %>").nextAll()[i]).children(":first").html(index - 1); +} +$("#apply_add_department_<%= @apply_dep.id %>").remove(); \ No newline at end of file diff --git a/app/views/layouts/base_management.html.erb b/app/views/layouts/base_management.html.erb index bf1f662a5..da4b7ed0d 100644 --- a/app/views/layouts/base_management.html.erb +++ b/app/views/layouts/base_management.html.erb @@ -26,7 +26,7 @@ <% case @menu_type %> <% when 2 %> - <%= @sub_type == 1 ? "课程列表" : "班级列表" %> + <%= @sub_type == 1 ? "课程列表" : "课堂列表" %> <% when 3 %> <%= @sub_type == 1 ? "实训列表" :(@sub_type == 2 ? "已发布的实训": (@sub_type == 3 ? "已关闭的实训": "镜像管理")) %> <% when 4 %> @@ -55,7 +55,7 @@
  • 课堂+
  • 全部实训+ diff --git a/app/views/managements/_all_department.html.erb b/app/views/managements/_all_department.html.erb index f3fcab5ed..1f7b5c91e 100644 --- a/app/views/managements/_all_department.html.erb +++ b/app/views/managements/_all_department.html.erb @@ -27,7 +27,7 @@ throttle(search_courses, window, e); }); function department_submit() { - var checkboxs = $("input[name='department_id[]']:checked"); + var checkboxs = $("input[name='department_id']:checked"); if(checkboxs.length == 0) { $("#choose_courses_notice").text("请选择单位"); } else{ diff --git a/app/views/managements/_all_schools.html.erb b/app/views/managements/_all_schools.html.erb index d7a8d4c3f..f6e6fa458 100644 --- a/app/views/managements/_all_schools.html.erb +++ b/app/views/managements/_all_schools.html.erb @@ -27,7 +27,7 @@ throttle(search_courses, window, e); }); function school_submit() { - var checkboxs = $("input[name='school_id[]']:checked"); + var checkboxs = $("input[name='school_id']:checked"); if(checkboxs.length == 0) { $("#choose_courses_notice").text("请选择单位"); } else{ diff --git a/app/views/managements/_classroom_classment_list.html.erb b/app/views/managements/_classroom_classment_list.html.erb index f98b5648b..61255f9ce 100644 --- a/app/views/managements/_classroom_classment_list.html.erb +++ b/app/views/managements/_classroom_classment_list.html.erb @@ -2,13 +2,12 @@ ID - 班级名称 + 课堂名称 成员 资源 作业 试卷 私有 - 模版 状态 创建者单位 创建者 @@ -26,14 +25,13 @@ <%= course.homework_commons.count%> <%= course.exercises.count %> <%= course.is_public.to_i == 1 ? '--' : '√' %> - <%= course.is_end ? "已结束" : "正在进行" %> <%= course.teacher.try(:user_extensions).try(:school).try(:name).blank? ? "--" : course.teacher.try(:user_extensions).try(:school) %> <%= 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/_create_department.html.erb b/app/views/managements/_create_department.html.erb new file mode 100644 index 000000000..7381de9f1 --- /dev/null +++ b/app/views/managements/_create_department.html.erb @@ -0,0 +1,99 @@ +
    +
    +

    添加子单位名称

    + +
    +
    + 单位全称: + +
    + 请选择单位 +
    + +
    + 子单位名称: +
    + 请输入子单位名称 +
    +
    +
    +
    + +
    + 取消 + 确定 +
    +
    +
    + + \ No newline at end of file diff --git a/app/views/managements/_departments_list.html.erb b/app/views/managements/_departments_list.html.erb index 8bb9f6f0b..b3214c42c 100644 --- a/app/views/managements/_departments_list.html.erb +++ b/app/views/managements/_departments_list.html.erb @@ -2,22 +2,31 @@ 序号 - 部门名称 - 用户数 - 已认证职业 + 部门名称 + 单位名称 + 用户数 + 已认证职业 创建于 color-light-green ml5" title=""> - <% @department.each do |department| %> - - <%=department.id %> + <% @department.each_with_index do |department,index| %> + + <%= index + 1 %> <%= department.name %> - <%= UserExtensions.where(:department_id => department.id).count %> - 3 + <%= School.where(:id => department.school_id).first %> + <%= UserExtensions.where(:department_id => department.id,:school_id => department.school_id ).count %> + <%= ApplyUserAuthentication.where(:auth_type => 2,:user_id =>UserExtensions.where(:department_id => department.id,:school_id => department.school_id).map(&:user_id)).count%> <%= format_time department.created_at %> - 修改 + + <% if UserExtensions.where(:department_id => department.id,:school_id => department.school_id ).count == 0 %> + 删除  + <% else %> + -- + <% end %> + <%= link_to '更改', update_department_managements_path(:school_id=> department.school_id,:department_id => department.department_id), :remote => true, :class => "application-default-link" %> + <% end %> @@ -50,4 +59,10 @@ dateType: "script" }); }); + + + function alert_update_departments(){ + /* var html = <%#= j (render :partial => '', :department => department) %>*/ + + } diff --git a/app/views/managements/_departments_part_list.html.erb b/app/views/managements/_departments_part_list.html.erb index 52497055e..c233826d9 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.address == nil ? "--" :schools.address %> + <%= schools.province == nil ? "--" :schools.province%><%= schools.city == nil ? "" :schools.city %><%= schools.address == nil ? "" :schools.address %> <%= UserExtensions.where(:school_id => schools.id).count %> <%= schools.departments.count %> <%= format_time schools.created_at %> diff --git a/app/views/managements/_update_department.html.erb b/app/views/managements/_update_department.html.erb new file mode 100644 index 000000000..24e77a48d --- /dev/null +++ b/app/views/managements/_update_department.html.erb @@ -0,0 +1,52 @@ +
    +
    +

    更改为

    + +
    +
    + +
    +
    +
    + <%= render :partial => "managements/update_department_school", :locals => {:departments => departments, :edit_id => edit_id} %> +
    + +
    + 取消 + 确定 +
    +
    +
    + + \ No newline at end of file diff --git a/app/views/managements/_update_department_form.html.erb b/app/views/managements/_update_department_form.html.erb index bbc01fd87..f33b01f02 100644 --- a/app/views/managements/_update_department_form.html.erb +++ b/app/views/managements/_update_department_form.html.erb @@ -5,7 +5,7 @@ <% department.each do |department| %> diff --git a/app/views/managements/_update_department_school.html.erb b/app/views/managements/_update_department_school.html.erb new file mode 100644 index 000000000..a7f9049b6 --- /dev/null +++ b/app/views/managements/_update_department_school.html.erb @@ -0,0 +1,24 @@ +<%= form_tag edit_departments_school_managements_path(:alter_dep_id => edit_id), :id => 'schools_list_form' %> +
    +
    + <% if !departments.empty? && !@search.nil? %> + <% departments.each do |department| %> +
      +
    • + + +
    • +
    + <% end %> + <% end %> +
    +
    +
    + \ No newline at end of file diff --git a/app/views/managements/_update_school_form.html.erb b/app/views/managements/_update_school_form.html.erb index d02780f5d..b436c35c1 100644 --- a/app/views/managements/_update_school_form.html.erb +++ b/app/views/managements/_update_school_form.html.erb @@ -6,7 +6,7 @@ <% schools.each do |school| %> diff --git a/app/views/managements/add_department.js.erb b/app/views/managements/add_department.js.erb new file mode 100644 index 000000000..6af417a9c --- /dev/null +++ b/app/views/managements/add_department.js.erb @@ -0,0 +1 @@ +$("#managements_departments_list").html("<%= j( render :partial => "managements/departments_list" ) %>") diff --git a/app/views/managements/all_department.js.erb b/app/views/managements/all_department.js.erb index fff017436..004d98ed9 100644 --- a/app/views/managements/all_department.js.erb +++ b/app/views/managements/all_department.js.erb @@ -1,4 +1,4 @@ -<% if params[:search].nil? %> +<% if params[:is_observe].nil? %> var htmlvalue = " <%= escape_javascript( render :partial => 'managements/all_department', :locals => {:department => @department, :edit_id => @edit_id}) %>"; pop_box_new(htmlvalue, 400, 260); <% else %> diff --git a/app/views/managements/all_schools.js.erb b/app/views/managements/all_schools.js.erb index 73baff676..c82bb0f31 100644 --- a/app/views/managements/all_schools.js.erb +++ b/app/views/managements/all_schools.js.erb @@ -1,4 +1,4 @@ -<% if params[:search].nil? %> +<% if params[:is_observe].nil? %> var htmlvalue = " <%= escape_javascript( render :partial => 'managements/all_schools', :locals => {:schools => @schools, :edit_id => @edit_id}) %>"; pop_box_new(htmlvalue, 400, 260); <% else %> diff --git a/app/views/managements/create_departments.js.erb b/app/views/managements/create_departments.js.erb new file mode 100644 index 000000000..7e29bd162 --- /dev/null +++ b/app/views/managements/create_departments.js.erb @@ -0,0 +1,2 @@ +var htmlvalue = "<%= escape_javascript( render :partial => 'managements/create_department') %>"; +pop_box_new(htmlvalue, 400, 260); \ No newline at end of file diff --git a/app/views/managements/departments.html.erb b/app/views/managements/departments.html.erb index 3bcdde0f1..52d67560e 100644 --- a/app/views/managements/departments.html.erb +++ b/app/views/managements/departments.html.erb @@ -3,7 +3,7 @@ 搜索 清除 - 创建 + <%= link_to '创建',{:controller => 'managements', :action => 'create_departments'}, :remote => true, :class => "task-btn task-btn-green fr mt6 mr30" %> <% end %> diff --git a/app/views/managements/trial_authorization.html.erb b/app/views/managements/trial_authorization.html.erb index f2d9602a5..86bcc6c59 100644 --- a/app/views/managements/trial_authorization.html.erb +++ b/app/views/managements/trial_authorization.html.erb @@ -126,7 +126,7 @@ }else{ type = 2; } - alert(type); +// alert(type); $.ajax({ url: "<%= trial_authorization_managements_path %>" +".js", data: { search: iName, status: type} diff --git a/app/views/managements/update_department.js.erb b/app/views/managements/update_department.js.erb new file mode 100644 index 000000000..868427040 --- /dev/null +++ b/app/views/managements/update_department.js.erb @@ -0,0 +1,6 @@ +<% if params[:is_observe].nil? %> +var htmlvalue = " <%= escape_javascript( render :partial => 'managements/update_department', :locals => {:departments => @departments, :edit_id => @edit_id }) %>"; +pop_box_new(htmlvalue, 400, 260); +<% else %> +$("#schools_list").html("<%= escape_javascript(render :partial => 'managements/update_department_school', :locals => {:departments => @departments, :edit_id => @edit_id }) %>"); +<% end %> \ No newline at end of file diff --git a/app/views/school/destroy.js.erb b/app/views/school/destroy.js.erb new file mode 100644 index 000000000..99dcaec0a --- /dev/null +++ b/app/views/school/destroy.js.erb @@ -0,0 +1,5 @@ +for(var i=0; i<$("#subject_shixun_<%= @school.id %>").nextAll().length; i++){ + var index = parseInt($($("#subject_shixun_<%= @school.id %>").nextAll()[i]).children(":first").html()); + $($("#subject_shixun_<%= @school.id %>").nextAll()[i]).children(":first").html(index - 1); +} +$("#subject_shixun_<%= @school.id %>").remove(); \ No newline at end of file diff --git a/app/views/users/_user_experience_content.html.erb b/app/views/users/_user_experience_content.html.erb index b9fcc4ff8..4f5dad13d 100644 --- a/app/views/users/_user_experience_content.html.erb +++ b/app/views/users/_user_experience_content.html.erb @@ -1,39 +1,39 @@
    - <% if @user_experiences.blank? %> -
    - -

    您还没有获得过经验值哦~

    + <% if @user_experiences.blank? %> +
    + +

    您还没有获得过经验值哦~

    +
    + <% else %> + + + + + + + + + + + <% @user_experiences.each do |exp| %> + + + + <% game = Game.where(:id => exp.container_id).first %> + + + + <% end %> + +
    操作变更详情操作时间
    闯关+ <%= exp.score %><%= game ? "通过实训“#{game.challenge.shixun.name}”的第#{game.challenge.position}关获得的奖励" : "--" %><%= format_time exp.created_at %>
    +
    +
    +
    +
    +
      + <%= pagination_links_full @experiences_pages, @experiences_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %> +
    +
    - <% else %> - - - - - - - - - - - <% @user_experiences.each do |exp| %> - - - - <% game = Game.where(:id => exp.container_id).first %> - - - - <% end %> - -
    操作变更详情操作时间
    闯关+ <%= exp.score %><%= game ? "通过实训“#{game.challenge.shixun.name}”的第#{game.challenge.position}关获得的奖励" : "--" %><%= format_time exp.created_at %>
    -
    -
    -
    -
    -
      - <%= pagination_links_full @experiences_pages, @experiences_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %> -
    -
    -
    -
    -<% end %> \ No newline at end of file +
    + <% end %> \ No newline at end of file diff --git a/app/views/users/growth_record.html.erb b/app/views/users/growth_record.html.erb index 09062b9ff..e977e5fc9 100644 --- a/app/views/users/growth_record.html.erb +++ b/app/views/users/growth_record.html.erb @@ -20,7 +20,7 @@
  • - <%= render :partial => "users/user_experience" %> + <%#= render :partial => "users/user_experience" %>
    diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 16769deff..9dc4e0f21 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -103,7 +103,7 @@ -

    +

    <% update_visiti_count @user %> <%= @user.visits.to_i %> 次访问 @@ -139,12 +139,14 @@ <% else %>

    -

    +

    <%= @user.visits.to_i %> 次访问

    + 经验值<%= link_to @user.experience %> + 金币<%= link_to @user.grade %> 给TA留言 <% if(@user.watched_by?(User.current)) %> <%= link_to "已关注", diff --git a/config/routes.rb b/config/routes.rb index b2ef63a14..8fea46036 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -222,6 +222,10 @@ RedmineApp::Application.routes.draw do delete 'delete_applied_schools' match 'new_major', :via => [:get, :post] post 'insert_major' + match 'update_department',:via => [:get, :post] + post 'edit_departments_school' + get 'create_departments' + post 'add_department' end end # Enable Grack support From 57315b6a4b8f6d17337c929fd13c98a7ae710f4e Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 1 Sep 2017 19:50:16 +0800 Subject: [PATCH 02/21] =?UTF-8?q?=E8=BE=B9=E8=B7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_bank/_new_shixun_homework_list.html.erb | 2 +- app/views/homework_common/_new_shixun_homework_list.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/homework_bank/_new_shixun_homework_list.html.erb b/app/views/homework_bank/_new_shixun_homework_list.html.erb index 327b58b7d..8b542540d 100644 --- a/app/views/homework_bank/_new_shixun_homework_list.html.erb +++ b/app/views/homework_bank/_new_shixun_homework_list.html.erb @@ -10,7 +10,7 @@ <% @shixuns.each do |shixun| %> - + <%= link_to shixun.name, shixun_path(shixun), :class => "edu-info-dark task-hide mt3 ml20",:style=> "text-align:left", :target => "_blank" %> diff --git a/app/views/homework_common/_new_shixun_homework_list.html.erb b/app/views/homework_common/_new_shixun_homework_list.html.erb index d33862edb..41dae717d 100644 --- a/app/views/homework_common/_new_shixun_homework_list.html.erb +++ b/app/views/homework_common/_new_shixun_homework_list.html.erb @@ -11,7 +11,7 @@ <% @shixuns.each do |shixun| %> - + <%= link_to shixun.name, shixun_path(shixun), :class => "edu-info-dark task-hide mt3 ml20",:style=> "text-align:left", :target => "_blank" %> From ec9e28a4add1af3ea8666ba00a7dafe63f392dbe Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 1 Sep 2017 19:55:11 +0800 Subject: [PATCH 03/21] =?UTF-8?q?=E4=B8=8A=E7=BA=BF=E7=BC=BA=E9=99=B7?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/my_controller.rb | 2 +- app/views/layouts/base_edu_account.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index 3db2dfb64..236c695f1 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -151,7 +151,7 @@ class MyController < ApplicationController ue = @user.user_extensions @trail_authentication = ApplyAction.where(:user_id => User.current.id, :container_type => "TrialAuthorization").order("created_at desc").first @authentication = @user.authentication - if @user.nickname.nil? || @user.lastname.nil? || ue.identity.nil? || ue.location.nil? || ue.school_id.nil? + if @user.nickname.nil? || @user.lastname.nil? || ue.try(:identity).nil? || ue.try(:location).nil? || ue.try(:location).nil? @require_auth = true else if User.current.certification != 1 && (@trail_authentication.blank? || (@trail_authentication.status == 2 && (@trail_authentication.updated_at.to_i + 24*60*60) < Time.now.to_i)) diff --git a/app/views/layouts/base_edu_account.html.erb b/app/views/layouts/base_edu_account.html.erb index 6891cb314..34b1a6a08 100644 --- a/app/views/layouts/base_edu_account.html.erb +++ b/app/views/layouts/base_edu_account.html.erb @@ -42,7 +42,7 @@

    试用申请已提交,我们将在一个工作日内完成审核
    - <% elsif @trail_authentication.status == 2 && (@trail_authentication.updated_at.to_i + 24*60*60) > Time.now.to_i %> + <% elsif User.current.certification == 2 || (@trail_authentication.status == 2 && (@trail_authentication.updated_at.to_i + 24*60*60) > Time.now.to_i) %>
    您的试用申请已被拒绝,原因:<%= @trail_authentication.reason %>,请于24小时后重新申请
    From 588009eba0933685c7c8119a974bd4a428f16776 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 1 Sep 2017 20:06:05 +0800 Subject: [PATCH 04/21] =?UTF-8?q?issuse=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_edu_user_watch_fan_list.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_edu_user_watch_fan_list.html.erb b/app/views/users/_edu_user_watch_fan_list.html.erb index 327419eff..a02f91809 100644 --- a/app/views/users/_edu_user_watch_fan_list.html.erb +++ b/app/views/users/_edu_user_watch_fan_list.html.erb @@ -9,7 +9,7 @@ -
    +
    <% if @user_watchlist_count > 12 %> 查看全部 <% end %> From 87d27c8cf4a34cce642cae508f4509e4f638b393 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 1 Sep 2017 20:07:21 +0800 Subject: [PATCH 05/21] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/challenges/_skill_form.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/challenges/_skill_form.html.erb b/app/views/challenges/_skill_form.html.erb index 61690edc5..2a506ed7d 100644 --- a/app/views/challenges/_skill_form.html.erb +++ b/app/views/challenges/_skill_form.html.erb @@ -41,7 +41,6 @@ function add_tag(){ var num = $(".task-bd-grey").children('div').length; var val = $(".task-tag-input").val().trim(); - var nSkill = $(".knowledge_frame"); if (val != ""){ testLength = $(".task-tag-input").val().trim().length; $("#add_shixun_skill").before("
    " + @@ -52,6 +51,8 @@ } $("#shixun_skill_input").val(""); $("#add_shixun_skill").hide(); + var nSkill = $(".knowledge_frame"); + console.log(nSkill.length); if (nSkill.length > 0){ $("#challenge_skill_update").submit(); //当增加或者保存技能标签以后执行保存操作 }else{ From fc5893f955b10877152a5b7247fc9a894bb1483d Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 1 Sep 2017 20:29:27 +0800 Subject: [PATCH 06/21] =?UTF-8?q?=E9=98=B4=E5=BD=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 1222b05d0..5665ee4d6 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -214,7 +214,7 @@ -
    +
    "all") %>" data-remote="true" class="user_course_filtrate fl mt20 mr30">全部<%= @shixuns_count %> "create") %>" class="user_course_filtrate fl mt20 mr30" data-remote="true"><%= str %>创建的<%= @create_num %> From 2947dc8f980465dae1b8f7fb0e5a098e3aeef8cb Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 1 Sep 2017 20:35:48 +0800 Subject: [PATCH 07/21] =?UTF-8?q?=E4=B8=8A=E7=BA=BF=E7=BC=BA=E9=99=B7?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_edu_user.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/base_edu_user.html.erb b/app/views/layouts/base_edu_user.html.erb index 48d23a4e9..5aa31cd03 100644 --- a/app/views/layouts/base_edu_user.html.erb +++ b/app/views/layouts/base_edu_user.html.erb @@ -24,7 +24,7 @@ }); - +
    <% if User.current.logged? %> From b6ae252fb802c9268d6e1571d61dd860ba13460e Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 1 Sep 2017 20:51:07 +0800 Subject: [PATCH 08/21] tip --- app/views/users/search_shixuns_or_courses.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/users/search_shixuns_or_courses.html.erb b/app/views/users/search_shixuns_or_courses.html.erb index da0327d65..425d72421 100644 --- a/app/views/users/search_shixuns_or_courses.html.erb +++ b/app/views/users/search_shixuns_or_courses.html.erb @@ -90,10 +90,10 @@
    • - <%= shixun.challenges.count %> + <%= shixun.challenges.count %>
    • - <%= shixun.myshixuns.count %> + <%= shixun.myshixuns.count %>
    • <%= shixun.shixun_score %> From 535216d572c902320f3f3b44a8e071e2a4261ebe Mon Sep 17 00:00:00 2001 From: XuCheng642 <287102909@qq.com> Date: Fri, 1 Sep 2017 20:56:57 +0800 Subject: [PATCH 09/21] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/show.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 1222b05d0..c54c406d9 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -146,9 +146,7 @@

      - 给TA留言 - 经验值<%= link_to @user.experience %> - 金币<%= link_to @user.grade %> + 给TA留言 <% if(@user.watched_by?(User.current)) %> <%= link_to "已关注", watch_path(:object_type => 'user', :object_id => @user.id, :target_id => @user.id), @@ -165,6 +163,8 @@ :remote => "true", :title => "添加关注" %> <% end %> + 经验值 <%= @user.experience %> + 金币<%= @user.grade %>

      From 4c8c56e3cebd7538da74991c98910c07d3d2306b Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 1 Sep 2017 21:07:09 +0800 Subject: [PATCH 10/21] =?UTF-8?q?=E9=98=B4=E5=BD=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_edu_user_watch_fan_list.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_edu_user_watch_fan_list.html.erb b/app/views/users/_edu_user_watch_fan_list.html.erb index a02f91809..236878007 100644 --- a/app/views/users/_edu_user_watch_fan_list.html.erb +++ b/app/views/users/_edu_user_watch_fan_list.html.erb @@ -33,7 +33,7 @@
    <% end %>
    -
    +
    <% if @user_fanlist_count > 12 %> 查看全部 <% end %> From 083d1a2e167741034120e3dd2d05994bac62b64b Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 1 Sep 2017 21:37:36 +0800 Subject: [PATCH 11/21] =?UTF-8?q?=E5=BC=80=E5=90=AF=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=EF=BC=8C=E5=85=88=E7=BB=91=E5=AE=9A=E9=82=AE=E7=AE=B1=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E7=A1=AE=E5=AE=9A=E4=BA=86=E3=80=82=E8=B7=B3=E5=85=A5?= =?UTF-8?q?=E9=82=AE=E7=AE=B1=E7=BB=91=E5=AE=9A=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixuns/operation.js.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/shixuns/operation.js.erb b/app/views/shixuns/operation.js.erb index f3555f784..f3b1834a9 100644 --- a/app/views/shixuns/operation.js.erb +++ b/app/views/shixuns/operation.js.erb @@ -1,5 +1,5 @@ -<% if @mail %> - sure_box_redirect('#{security_settings_path}', '开启实训,请先绑定邮箱'); +<% if true %> + sure_box_redirect('<%= security_settings_path %>', '开启实训,请先绑定邮箱'); <% else %> <% if @is_modify.blank? %> //为了防止浏览器阻挡,在实训路径中需要弹出新的页面,而实训首页又不需要弹出新的页面 From b514208dc54a9c58011b53415b07e694f908e75b Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 1 Sep 2017 21:41:19 +0800 Subject: [PATCH 12/21] =?UTF-8?q?icon=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/index.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 08dd78fd8..b224a0929 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -49,8 +49,8 @@ <% end %> <% if @is_teacher %> -
    - +
    +
      <% if @homework.homework_type != 4 %>
    • From b1f054e8e0b638dcb4d92b1647af3b5a301a98e8 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 1 Sep 2017 21:51:26 +0800 Subject: [PATCH 13/21] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=E7=A1=AE=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/account/change_or_bind.html.erb | 4 ++-- app/views/shixuns/operation.js.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/account/change_or_bind.html.erb b/app/views/account/change_or_bind.html.erb index c102daf20..4050c8a1b 100644 --- a/app/views/account/change_or_bind.html.erb +++ b/app/views/account/change_or_bind.html.erb @@ -34,7 +34,7 @@
    • -
    • 保存
    • +
    • 确定
    @@ -70,7 +70,7 @@

    -
  • 保存
  • +
  • 确定
  • diff --git a/app/views/shixuns/operation.js.erb b/app/views/shixuns/operation.js.erb index f3b1834a9..75c4020d8 100644 --- a/app/views/shixuns/operation.js.erb +++ b/app/views/shixuns/operation.js.erb @@ -1,4 +1,4 @@ -<% if true %> +<% if @mail %> sure_box_redirect('<%= security_settings_path %>', '开启实训,请先绑定邮箱'); <% else %> <% if @is_modify.blank? %> From ce440ce6ec01a5bd946a3016744cf8eb8fafafd1 Mon Sep 17 00:00:00 2001 From: XuCheng642 <287102909@qq.com> Date: Sun, 3 Sep 2017 14:08:44 +0800 Subject: [PATCH 14/21] =?UTF-8?q?=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 | 14 ++++++-------- app/views/managements/_create_department.html.erb | 1 + 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index bcaff8d53..dc33b059d 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -305,10 +305,7 @@ end :department_id => department.id, :user_id => User.current.id); end - respond_to do |format| - format.js - end - #redirect_to departments_managements_path + redirect_to departments_managements_path end # 修改单位部门列表 @@ -332,10 +329,10 @@ end def edit_departments_school begin - dep = Department.find(params[:department_id]); - alter_dep = Department.find(params[:alter_dep_id]); + dep = Department.find(params[:department_id]) + alter_dep = Department.find(params[:alter_dep_id]) apply_dep = ApplyAddDepartment.where(:department_id => params[:alter_dep_id]) - if dep && alter_dep + if dep && alter_dep && dep != alter_dep # users = UserExtensions.where("department_id = #{dep.id}") # users.update_all(:department_id => params[:alter_dep_id]) # dep.destroy @@ -441,7 +438,8 @@ end def all_department @edit_id = params[:department_id] @search = params[:search] - apply_department = ApplyAddDepartment.where(:status => 1) + dep = ApplyAddDepartment.where(:id => @edit_id).first + apply_department = ApplyAddDepartment.where(:status => 1, :school_id => dep.school_id) apply_department_ids = apply_department.empty? ? "(-1)" : "(" + apply_department.map{|sc| sc.department_id}.join(',') + ")" if !params[:search].nil? search = "%#{params[:search].to_s.strip.downcase}%" diff --git a/app/views/managements/_create_department.html.erb b/app/views/managements/_create_department.html.erb index 7381de9f1..8a20a2692 100644 --- a/app/views/managements/_create_department.html.erb +++ b/app/views/managements/_create_department.html.erb @@ -94,6 +94,7 @@ dataType: 'script', data:{school:school,department:department} }); + hideModal(); } } \ No newline at end of file From e5ce4c502a7a9b563be47efd43f0b3b16d8f8c38 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Sun, 3 Sep 2017 16:18:27 +0800 Subject: [PATCH 15/21] =?UTF-8?q?=E5=91=A8=E6=9C=AB=E6=8F=90=E5=87=BA?= =?UTF-8?q?=E7=9A=84=E6=A0=B7=E5=BC=8F=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/new.html.erb | 30 ++++++++++------ app/views/homework_common/index.html.erb | 4 +-- app/views/subjects/show.html.erb | 2 +- app/views/users/_course_attachment.html.erb | 11 +++--- app/views/users/_course_create.html.erb | 11 +++--- app/views/users/_course_homework.html.erb | 38 +++++++++++---------- app/views/users/_course_message.html.erb | 25 +++++++------- public/stylesheets/css/edu-class.css | 2 +- public/stylesheets/css/edu-public.css | 1 + 9 files changed, 70 insertions(+), 54 deletions(-) diff --git a/app/views/courses/new.html.erb b/app/views/courses/new.html.erb index db6d570e8..2d6805fa2 100644 --- a/app/views/courses/new.html.erb +++ b/app/views/courses/new.html.erb @@ -21,49 +21,59 @@
    请先输入课程 -
  • +
  • 课堂名称不能为空且至少有两个字符
    -
  • 正确示例:软件工程计算机系2016秋季A班
  • -
  • 错误示例:计算机系2016秋季A班
  • + +
    +
    + + +

    注意:1、课堂名称 = 课程名称 + 学期信息

    +

    正确示例:数据结构2016秋季A班

    +

    错误示例:数据结构A班

    +

    2、本学期包含多个班级的课程,只需创建一个课堂

    +

    创建课堂后,可以在课堂内部建立不同的分班

    +
    +
  • - +
    请输入正整数
  • - +
    请输入正整数或保留一位小数的浮点数
  • - +
    -
    +
    -

    结束日期过后,课堂进入<%= link_to '归档状态', courses_path(:is_over => 1),:target => '_blank', :class => 'color-orange05' %>,只能在历史课堂中查看

    +

    结束日期过后,课堂进入归档状态<%#= link_to '归档状态', courses_path(:is_over => 1),:target => '_blank', :class => 'color-orange05' %>,只能在历史课堂中查看

    结束日期必须晚于当前日期
  • -
  • +
  • - 保存 + 保存 <%= link_to '取消', courses_path, :class => 'task-btn fl' %>
  • diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb index bc2465e67..bc12b2f7c 100644 --- a/app/views/homework_common/index.html.erb +++ b/app/views/homework_common/index.html.erb @@ -5,10 +5,10 @@ <% if @is_teacher %> <% if @homework_type != 4 %> <%= link_to '新建', new_homework_common_path(:course => @course.id, :homework_type =>@homework_type), :class => "task-btn task-btn-blue fr mr20", :title => "新建作业" %> + <%= link_to("题库选用", user_import_homeworks_user_path(User.current.id, :select_course => @course.id, :homework_type =>@homework_type), :class => "edu-btn fr mr10",:remote => true,:title=>"导入自己发布过的作业,或者共享题库中的作业") %> <% else %> - <%= link_to '新建', shixuns_homework_common_index_path(:course => @course.id), :remote => true, :class => "task-btn task-btn-blue fr mr20", :title => "新建作业" %> + <%= link_to '选用实训', shixuns_homework_common_index_path(:course => @course.id), :remote => true, :class => "task-btn task-btn-blue fr mr20", :title => "新建作业" %> <% end %> - <%= link_to("题库选用", user_import_homeworks_user_path(User.current.id, :select_course => @course.id, :homework_type =>@homework_type), :class => "edu-btn fr mr10",:remote => true,:title=>"导入自己发布过的作业,或者共享题库中的作业") %> <% end %>
    diff --git a/app/views/subjects/show.html.erb b/app/views/subjects/show.html.erb index fc9bd6436..7c5ca4b2c 100644 --- a/app/views/subjects/show.html.erb +++ b/app/views/subjects/show.html.erb @@ -154,7 +154,7 @@

    <%= image_tag(url_to_avatar(user), :width =>"80", :height => "80", :class => "bor-radius-all", :alt=>"头像") %>

    <%= user.try(:show_name) %>

    -

    <%= user.school_name + user.identity %>

    +

    <%= user.school_name %>

    diff --git a/app/views/users/_course_attachment.html.erb b/app/views/users/_course_attachment.html.erb index cff7f5b1e..1dafaea8a 100644 --- a/app/views/users/_course_attachment.html.erb +++ b/app/views/users/_course_attachment.html.erb @@ -5,7 +5,10 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
    -
    +
    + <%= link_to activity.filename, course_files_path(activity.course), :class => "color-dark" %> +
    +
    <% if activity.try(:author).show_real_name == ' ' %> <%= link_to activity.try(:author).show_real_name, user_path(activity.author_id), :class => "newsBlue mr15" %> <% else %> @@ -14,10 +17,8 @@ TO <%= link_to "班级资源", course_files_path(activity.course), :class => "newsBlue ml15" %>
    -
    - <%= link_to activity.filename, course_files_path(activity.course), :class => "postGrey" %> -
    -
    + +
    文件大小: <%= number_to_human_size activity.filesize%> diff --git a/app/views/users/_course_create.html.erb b/app/views/users/_course_create.html.erb index ec34a01d6..6a47ba949 100644 --- a/app/views/users/_course_create.html.erb +++ b/app/views/users/_course_create.html.erb @@ -5,7 +5,10 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.teacher} %>
    -
    +
    + <%= link_to activity.name, course_path(activity.id,:host=>Setting.host_course), :class => "color-dark" %> +
    +
    <% if activity.try(:teacher).show_real_name == ' ' %> <%= link_to activity.try(:teacher), user_path(activity.teacher), :class => "newsBlue mr15" %> <% else %> @@ -15,10 +18,8 @@ <% str = defined?(is_course) && is_course == 1 ? "班级" : "#{activity.name.to_s} | 班级" %> <%= link_to str, course_path(activity.id,:host=>Setting.host_course), :class => "newsBlue ml15" %>
    -
    - <%= link_to activity.name, course_path(activity.id,:host=>Setting.host_course), :class => "postGrey" %> -
    -
    + +
    创建时间:<%= format_time(activity.created_at) %>
    +
    + <% if hw_status == 3 || hw_status == 5 %> + <% index = get_hw_index(activity, is_teacher) %> + <%= link_to "作业#{index+1}:".html_safe+activity.name,student_work_index_path(:homework => activity.id),:class => "color-black edu-txt-850"%> + <% else %> + <%= link_to activity.name.to_s, student_work_index_path(:homework => activity.id,:host=> Setting.host_course), :class => "color-black edu-txt-850"%> + <% end %> +
    + <% homework_curr_status = homework_curr_time(activity) %> + <% if homework_curr_status[:status] != "" %> + <%= homework_curr_status[:status] %> + <% end %> + <% if activity.homework_detail_manual.try(:comment_status) != 0 && activity.homework_detail_manual.try(:comment_status) != 6 %> + <% allow_late = activity.allow_late ? '已开启补交' : '未开启补交' %> + <%= allow_late %> + <% end %> + +
    +
    <%= link_to activity.user.show_real_name, user_path(activity.user,:host=>Setting.host_user), :class => "newsBlue mr15" %> TO @@ -15,24 +34,7 @@ <%= link_to activity.course.name.to_s+" | #{activity.homework_type_ch}作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course, :homework_type => activity.homework_type), :class => "newsBlue ml15"%> <% end %>
    -
    - <% if hw_status == 3 || hw_status == 5 %> - <% index = get_hw_index(activity, is_teacher) %> - <%= link_to "作业#{index+1}:".html_safe+activity.name,student_work_index_path(:homework => activity.id),:class => "postGrey edu-txt-850"%> - <% else %> - <%= link_to activity.name.to_s, student_work_index_path(:homework => activity.id,:host=> Setting.host_course), :class => "postGrey edu-txt-850"%> - <% end %> -
    - <% homework_curr_status = homework_curr_time(activity) %> - <% if homework_curr_status[:status] != "" %> - <%= homework_curr_status[:status] %> - <% end %> - <% if activity.homework_detail_manual.try(:comment_status) != 0 && activity.homework_detail_manual.try(:comment_status) != 6 %> - <% allow_late = activity.allow_late ? '已开启补交' : '未开启补交' %> - <%= allow_late %> - <% end %> -
    <% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1%> 系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name, :course_id => activity.course_id),:target => "_blank",:class=>"linkBlue",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合! <% elsif activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 0%> @@ -41,7 +43,7 @@
    <%= render :partial => 'users/homework_opr', :locals => {:activity => activity, :is_teacher => is_teacher, :hw_status => hw_status, :user_activity_id => user_activity_id} %> <% if !activity.end_time.nil? %> -
    提交截止时间:<%= format_time activity.end_time %>
    +
    提交截止时间:<%= format_time activity.end_time %>
    <% end %> <% if activity.homework_detail_manual.comment_status == 0 && !activity.publish_time.nil? %>
    diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index f9d16e80f..46a4f5eed 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -5,17 +5,11 @@ <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
    -
    - <%= link_to activity.author.show_real_name, user_path(activity.author, :host=>Setting.host_user), :class => "newsBlue mr15" %> - TO - <% str = is_course == 1 ? "#{activity.board.parent.nil? ? '班级讨论区' : activity.board.name}" : activity.course.name.to_s+" | #{activity.board.parent.nil? ? '班级讨论区' : activity.board.name}" %> - <%= link_to str, course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15"%> -
    -
    +
    <% if activity.parent_id.nil? %> - <%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "postGrey edu-txt-850" %> + <%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "color-black edu-txt-850" %> <% else %> - <%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "postGrey edu-txt-850 " %> + <%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "color-black edu-txt-850 " %> <% end %>
    <% if activity.sticky == 1 %> @@ -25,10 +19,17 @@        <% end %>
    -
    - 发帖时间:<%= format_time(activity.created_on) %> +
    + <%= link_to activity.author.show_real_name, user_path(activity.author, :host=>Setting.host_user), :class => "newsBlue mr15" %> + TO + <% str = is_course == 1 ? "#{activity.board.parent.nil? ? '班级讨论区' : activity.board.name}" : activity.course.name.to_s+" | #{activity.board.parent.nil? ? '班级讨论区' : activity.board.name}" %> + <%= link_to str, course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15"%> +
    -
    + +
    更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
    diff --git a/public/stylesheets/css/edu-class.css b/public/stylesheets/css/edu-class.css index 1fde4366b..ac7d9d50f 100644 --- a/public/stylesheets/css/edu-class.css +++ b/public/stylesheets/css/edu-class.css @@ -135,7 +135,7 @@ a:hover.edu-class-right-add{ background-color: rgba(0, 0, 0, 0.4);} .stud-class-container .con-content ul li{position:relative;} .stud-class-container .con-content ul li .tig{position:absolute;top:20px;left:110%;width:200px;height:40px;line-height:40px;} .stud-class-container .con-content ul li .tusi{position:absolute;top:20px;left:120%;width:450px;} -.stud-class-container .con-content ul li .tusi .entry {background-color: #FFFEF4;height: 40px;line-height: 40px;border: 1px solid #F3DDB3;width:400px;margin:0 auto;position:relative; +.stud-class-container .con-content ul li .tusi .entry {background-color: #FFFEF4;line-height: 40px;border: 1px solid #F3DDB3;width:400px;margin:0 auto;position:relative; text-indent:10px;} .stud-class-container .con-content ul li .tusi .entry em,.after{display: block;border-width: 9px; position: absolute;top: 10px;left: -18px;border-style: dashed solid dashed dashed;border-color: transparent #F3DDB3 transparent transparent;font-size: 0;line-height: 0;} diff --git a/public/stylesheets/css/edu-public.css b/public/stylesheets/css/edu-public.css index 96bb18439..a1328af84 100644 --- a/public/stylesheets/css/edu-public.css +++ b/public/stylesheets/css/edu-public.css @@ -367,3 +367,4 @@ input::-ms-input-placeholder,textarea::-ms-input-placeholder {color:#cccccc;} .down-select{display:none;position: absolute;z-index: 10;left: 0px;width: 100%;overflow-y: auto;background: #fff;max-height: 200px;} .down-select p{height: 35px;line-height: 35px;padding-left: 5px;} .down-select p:hover{background: #f3f4f6} + From d58c7765145130b4114579ddd34cce0ee0343900 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sun, 3 Sep 2017 16:40:32 +0800 Subject: [PATCH 16/21] =?UTF-8?q?TPI=E9=A2=84=E8=AE=A1=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E4=B8=8E=E5=AE=9E=E9=99=85=E8=BE=93=E5=87=BA=E7=A9=BA=E6=A0=BC?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/edu/edu_tpi.js | 4 ++-- public/stylesheets/css/taskstyle.css | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/javascripts/edu/edu_tpi.js b/public/javascripts/edu/edu_tpi.js index 79944c251..7be27b59c 100644 --- a/public/javascripts/edu/edu_tpi.js +++ b/public/javascripts/edu/edu_tpi.js @@ -431,13 +431,13 @@ function code_evaluation(test_sets, "
  • " + "
    " + " 预期输出:" + - "

    " + ( test_sets[i].output == null ? "空" : test_sets[i].output.replace(/\r\n/g, "
    ") ) + "

    " + + "

    " + ( test_sets[i].output == null ? "空" : test_sets[i].output.replace(/\r\n/g, "
    ").replace(/\s+/g, "") ) + "

    " + "
    " + "
  • " + "
  • " + "
    " + "实际输出:" + - "

    " + (test_sets[i].actual_output == null ? "空" : test_sets[i].actual_output.replace(/\r\n/g, "
    ")) + "

    " + + "

    " + (test_sets[i].actual_output == null ? "空" : ((had_passed_testsests_error_count != "0") ? test_sets[i].actual_output.replace(/\r\n/g, "
    ") : test_sets[i].output.replace(/\r\n/g, "
    ").replace(/\s+/g, "")) ) + "

    " + "
    " + "
  • " + "" + diff --git a/public/stylesheets/css/taskstyle.css b/public/stylesheets/css/taskstyle.css index 955c1168f..788cbc3d7 100644 --- a/public/stylesheets/css/taskstyle.css +++ b/public/stylesheets/css/taskstyle.css @@ -412,4 +412,4 @@ html>body #ajax-indicator-base { position: fixed; } .save-tip{display:none;position: fixed;top:0px;left: 0px;width: 100%;height: 100%;} .save-tip-content{position: absolute;top:50%;left: 50%;margin-left: -36px;margin-top:-19px;background: rgba(0,0,0,0.7);color:#fff;padding:5px 15px;border-radius: 4px} - +.empty{font-family: Consolas;background: #494A4C;display: inline; margin: 0 2px; padding: 0 3px;} From 6f2f48c82d788874e885f49982a00a0a73388bb3 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Sun, 3 Sep 2017 17:17:57 +0800 Subject: [PATCH 17/21] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E8=AF=BE=E5=A0=82?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/new.html.erb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/courses/new.html.erb b/app/views/courses/new.html.erb index 2d6805fa2..536df1b3b 100644 --- a/app/views/courses/new.html.erb +++ b/app/views/courses/new.html.erb @@ -14,7 +14,7 @@
  • - +
    @@ -23,7 +23,7 @@
  • - +
    课堂名称不能为空且至少有两个字符
    @@ -32,11 +32,11 @@
    -

    注意:1、课堂名称 = 课程名称 + 学期信息

    -

    正确示例:数据结构2016秋季A班

    -

    错误示例:数据结构A班

    -

    2、本学期包含多个班级的课程,只需创建一个课堂

    -

    创建课堂后,可以在课堂内部建立不同的分班

    +

    注意:1、课堂名称 = 课程名称 + 学期信息 + 其它

    +

    正确示例:数据结构2016秋季班级

    +

    错误示例:数据结构班级

    +

    2、如果本学期包含多个班级,只需创建一个课堂

    +

    然后在课堂内部建立不同的分班

  • From 871f02a40f4d1ee45f51fc55a0cb62f9b415b084 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sun, 3 Sep 2017 17:37:29 +0800 Subject: [PATCH 18/21] =?UTF-8?q?=E4=B8=8A=E7=BA=BF=E7=BC=BA=E9=99=B7?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/challenges_controller.rb | 6 +++++- app/views/challenges/edit.html.erb | 7 ++++--- public/javascripts/edu/edu_tpi.js | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/controllers/challenges_controller.rb b/app/controllers/challenges_controller.rb index 3b660b434..5ad869462 100644 --- a/app/controllers/challenges_controller.rb +++ b/app/controllers/challenges_controller.rb @@ -151,7 +151,11 @@ class ChallengesController < ApplicationController end end end - redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => params[:tab]), notice: 'Succeed' + if params[:tab].to_i == 5 + redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => params[:tab]), notice: 'Succeed' + else + redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => params[:tab]) + end rescue Exception => e flash[:error] = "#{e.message}" redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => params[:tab]) diff --git a/app/views/challenges/edit.html.erb b/app/views/challenges/edit.html.erb index 412ff24f0..a25a7d058 100644 --- a/app/views/challenges/edit.html.erb +++ b/app/views/challenges/edit.html.erb @@ -89,13 +89,14 @@
    \ No newline at end of file diff --git a/public/javascripts/edu/edu_tpi.js b/public/javascripts/edu/edu_tpi.js index 7be27b59c..7b961a183 100644 --- a/public/javascripts/edu/edu_tpi.js +++ b/public/javascripts/edu/edu_tpi.js @@ -437,7 +437,7 @@ function code_evaluation(test_sets, "
  • " + "
    " + "实际输出:" + - "

    " + (test_sets[i].actual_output == null ? "空" : ((had_passed_testsests_error_count != "0") ? test_sets[i].actual_output.replace(/\r\n/g, "
    ") : test_sets[i].output.replace(/\r\n/g, "
    ").replace(/\s+/g, "")) ) + "

    " + + "

    " + (test_sets[i].actual_output == null ? "空" : test_sets[i].output.replace(/\r\n/g, "
    ").replace(/\s+/g, "")) + "

    " + "
    " + "
  • " + "" + From 78419de90284e15da2472f1d8c05846a3af3107a Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sun, 3 Sep 2017 17:50:41 +0800 Subject: [PATCH 19/21] =?UTF-8?q?=E4=B8=8A=E7=BA=BF=E7=BC=BA=E9=99=B7?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/games/_repository.html.erb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/games/_repository.html.erb b/app/views/games/_repository.html.erb index 49a506214..2cd042b77 100644 --- a/app/views/games/_repository.html.erb +++ b/app/views/games/_repository.html.erb @@ -122,8 +122,9 @@ if(data.error){ return; }else{ - var h = $("#games_repository_contents").height() - 50; - var rows = parseInt(h / 18); + var h = $("#games_repository_contents").height() - 50; + var line_h = (navigator.userAgent.indexOf('Firefox') >= 0 ? 19 : 18) + var rows = parseInt(h / line_h); // 测试版 var html = "
    "; // 本地版 From 92c091d2e23905aacc1ed93bb8646ad7d1f40bcc Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sun, 3 Sep 2017 17:59:48 +0800 Subject: [PATCH 20/21] =?UTF-8?q?TPI=E6=B5=8B=E8=AF=95=E9=9B=86=E7=A9=BA?= =?UTF-8?q?=E6=A0=BC=E6=A0=B7=E5=BC=8F=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/edu/edu_tpi.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/javascripts/edu/edu_tpi.js b/public/javascripts/edu/edu_tpi.js index 7b961a183..c475c9029 100644 --- a/public/javascripts/edu/edu_tpi.js +++ b/public/javascripts/edu/edu_tpi.js @@ -431,13 +431,13 @@ function code_evaluation(test_sets, "
  • " + "
    " + " 预期输出:" + - "

    " + ( test_sets[i].output == null ? "空" : test_sets[i].output.replace(/\r\n/g, "
    ").replace(/\s+/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].output.replace(/\r\n/g, "
    ").replace(/\s+/g, "")) + "

    " + + "

    " + (test_sets[i].actual_output == null ? "空" : test_sets[i].output.replace(/\r\n/g, "
    ").replace(/ /g, "")) + "

    " + "
    " + "
  • " + "" + From b1354af65662510a2c12b9250dc34c58e1da5c78 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sun, 3 Sep 2017 18:09:42 +0800 Subject: [PATCH 21/21] =?UTF-8?q?=E7=A9=BA=E6=A0=BC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/games/_repository.html.erb | 2 +- public/javascripts/edu/edu_tpi.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/games/_repository.html.erb b/app/views/games/_repository.html.erb index 2cd042b77..b25984718 100644 --- a/app/views/games/_repository.html.erb +++ b/app/views/games/_repository.html.erb @@ -123,7 +123,7 @@ return; }else{ var h = $("#games_repository_contents").height() - 50; - var line_h = (navigator.userAgent.indexOf('Firefox') >= 0 ? 19 : 18) + var line_h = (navigator.userAgent.indexOf('Firefox') >= 0 ? 19 : 18); var rows = parseInt(h / line_h); // 测试版 var html = "
    "; diff --git a/public/javascripts/edu/edu_tpi.js b/public/javascripts/edu/edu_tpi.js index c475c9029..d31ae9a57 100644 --- a/public/javascripts/edu/edu_tpi.js +++ b/public/javascripts/edu/edu_tpi.js @@ -437,7 +437,7 @@ function code_evaluation(test_sets, "
  • " + "
    " + "实际输出:" + - "

    " + (test_sets[i].actual_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, "")) + "

    " + "
    " + "
  • " + "" +