Merge branch 'develop' of https://bdgit.trustie.net/hushasha/bigdata into develop
Conflicts: app/views/shixuns/_form.html.erb
This commit is contained in:
commit
57722df834
|
|
@ -632,7 +632,7 @@ class AccountController < ApplicationController
|
|||
def change_or_bind
|
||||
@user = User.current
|
||||
@type = params[:type]
|
||||
@setting_type = 4
|
||||
@setting_type = 5
|
||||
render :layout => 'base_edu_account'
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -6,9 +6,119 @@ class ManagementsController < ApplicationController
|
|||
include SortHelper
|
||||
include UsersHelper
|
||||
include ApplicationHelper
|
||||
|
||||
# 镜像管理
|
||||
def mirror_repository
|
||||
@menu_type = 3
|
||||
@sub_type = 4
|
||||
@mirror_types = MirrorType.where("0=0")
|
||||
mirror_rep = Redmine::Configuration['mirror_rep']
|
||||
uri = "#{mirror_rep}/images/json"
|
||||
uri = URI.parse(URI.encode(uri.strip))
|
||||
begin
|
||||
res = Net::HTTP.get(uri)
|
||||
res = JSON.parse(res)
|
||||
res.each do |mirror|
|
||||
mirrorID = mirror['Id'][7, 12]
|
||||
if MirrorRepository.where(:mirrorID => mirrorID).count == 0
|
||||
MirrorRepository.create(:mirrorID => mirrorID, :status => 0, :created_at => Time.at(mirror['Created']), :updated_at => Time.at(mirror['Created']))
|
||||
end
|
||||
end
|
||||
rescue
|
||||
end
|
||||
@mirrors = MirrorRepository.where("0=0").reorder("updated_at desc")
|
||||
end
|
||||
|
||||
def add_mirror_type
|
||||
data = {result: 0}
|
||||
if params[:name]
|
||||
if MirrorType.where(:name => params[:name]).count == 0
|
||||
new_type = MirrorType.new(:user_id => User.current.id, :name => params[:name])
|
||||
if new_type.save
|
||||
data[:result] = 1
|
||||
end
|
||||
else
|
||||
data[:result] = 2
|
||||
end
|
||||
end
|
||||
render :json => data
|
||||
end
|
||||
|
||||
def modify_mirror
|
||||
@mirror = MirrorRepository.find params[:mirror_id]
|
||||
@mirror_types = MirrorType.where("0=0")
|
||||
end
|
||||
|
||||
def search_mirror_type
|
||||
data = {mirror_types: []}
|
||||
search = params[:search]
|
||||
MirrorType.where("name like '%#{search}%'").each do |mirror_type|
|
||||
option = []
|
||||
option << mirror_type.name.to_s
|
||||
option << mirror_type.id
|
||||
data[:mirror_types] << option
|
||||
end
|
||||
render :json => data
|
||||
end
|
||||
|
||||
def update_mirror
|
||||
data = {result: 0, ID:""}
|
||||
begin
|
||||
mirror = MirrorRepository.find params[:mirror_id]
|
||||
if mirror
|
||||
last_index = params[:main_type].strip().rindex(";");
|
||||
params[:main_type] = last_index.nil? ? "" : params[:main_type].strip()[0 ... last_index]
|
||||
if params[:main_type] != ""
|
||||
if MirrorRepository.where("id != #{mirror.id} and main_type = #{params[:main_type]} and tag = #{params[:tag].strip()}").count > 0
|
||||
data[:result] = 1
|
||||
data[:ID] = MirrorRepository.where("id != #{mirror.id} and main_type = #{params[:main_type]} and tag = #{params[:tag].strip()}").first.mirrorID
|
||||
else
|
||||
main_types = params[:main_type].split(";")
|
||||
mirror.mirror_repository_types.destroy_all
|
||||
main_types.each do |type|
|
||||
mirror_tp = MirrorType.where(:name => type).first
|
||||
if mirror_tp
|
||||
MirrorRepositoryType.create(:mirror_type_id => mirror_tp.id, :mirror_repository_id => mirror.id)
|
||||
end
|
||||
end
|
||||
mirror.update_attributes(:main_type => params[:main_type], :tag => params[:tag], :description => params[:description], :status => params[:status])
|
||||
end
|
||||
else
|
||||
data[:result] = 2
|
||||
end
|
||||
else
|
||||
data[:result] = 3
|
||||
end
|
||||
rescue Exception => e
|
||||
puts e
|
||||
end
|
||||
render :json => data
|
||||
end
|
||||
|
||||
def delete_mirror
|
||||
mirror = MirrorRepository.find params[:mirror_id]
|
||||
mirror_rep = Redmine::Configuration['mirror_rep']
|
||||
uri = "#{mirror_rep}/images/" + mirror.mirrorID.to_s
|
||||
uri = URI.parse(URI.encode(uri.strip))
|
||||
data = {name:mirror.mirrorID.to_s}
|
||||
http = Net::HTTP.new uri.host, uri.port
|
||||
begin
|
||||
req = Net::HTTP::Delete.new(uri.request_uri)
|
||||
req.form_data = data
|
||||
res= http.start { |http| http.request req }
|
||||
if res.code == '200'
|
||||
@status = 1
|
||||
mirror.destroy
|
||||
else
|
||||
@status = 0
|
||||
end
|
||||
rescue =>err
|
||||
end
|
||||
end
|
||||
|
||||
# 专业列表
|
||||
def profession
|
||||
@syllabus=Syllabus.where("0=0")
|
||||
@major=Major.where("0=0")
|
||||
@menu_type = 12
|
||||
@sub_type = 1
|
||||
@sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order]
|
||||
|
|
@ -16,27 +126,53 @@ class ManagementsController < ApplicationController
|
|||
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]
|
||||
if major_level_option && major_level_option != '0'
|
||||
@syllabus = @syllabus.where(:major_level=>major_level_option)
|
||||
@major = @major.where(:major_level=>major_level_option)
|
||||
end
|
||||
if discipline_category_option && discipline_category_option != '0'
|
||||
@syllabus=@syllabus.where(:discipline_category_id=>discipline_category_option)
|
||||
@major=@major.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)
|
||||
@major=@major.where(:first_level_discipline_id=>first_level_discipline_option)
|
||||
end
|
||||
@syllabus = @syllabus.order("created_at #{@sx_order}")
|
||||
@syllabus_count = @syllabus.count
|
||||
|
||||
if params[:support_shixuns]
|
||||
@major = @major.where(:support_shixuns => params[:support_shixuns].to_i)
|
||||
end
|
||||
|
||||
@major = @major.order("created_at #{@sx_order}")
|
||||
@major_count = @major.count
|
||||
limit = 20
|
||||
@is_remote = true
|
||||
@syllabus_pages = Paginator.new @syllabus_count, limit, params['page'] || 1
|
||||
@offset ||= @syllabus_pages.offset
|
||||
@syllabus = paginateHelper @syllabus, limit
|
||||
@major_pages = Paginator.new @major_count, limit, params['page'] || 1
|
||||
@offset ||= @major_pages.offset
|
||||
@major = paginateHelper @major, limit
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
# 新增专业页面
|
||||
def new_major
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
# 新增专业
|
||||
def insert_major
|
||||
major_list = Major.create(:name=>params[:major],:first_level_discipline_id=>params[:first_level_discipline_id],:major_level=>params[:major_level],:discipline_category_id=>params[:discipline_category_id],:major_code=>params[:major_code])
|
||||
redirect_to profession_managements_path
|
||||
end
|
||||
|
||||
# 支撑实训
|
||||
def support_shixun
|
||||
if params[:syllabus_id]
|
||||
major = Major.find params[:syllabus_id]
|
||||
major.update_attributes(:support_shixuns => !major.support_shixuns)
|
||||
end
|
||||
end
|
||||
|
||||
# 实训适用课程
|
||||
def applicable_course
|
||||
@menu_type = 12
|
||||
|
|
|
|||
|
|
@ -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 ue.identity.nil?
|
||||
if @user.nickname.nil? || @user.lastname.nil? || ue.identity.nil? || ue.location.nil? || ue.school_id.nil?
|
||||
@require_auth = true
|
||||
else
|
||||
if @trail_authentication.blank? || (@trail_authentication.status == 2 && (@trail_authentication.updated_at.to_i + 24*60*60) < Time.now.to_i)
|
||||
|
|
|
|||
|
|
@ -449,6 +449,7 @@ class ShixunsController < ApplicationController
|
|||
|
||||
def new
|
||||
@shixun = Shixun.new
|
||||
@support = Major.where(:support_shixuns=> 1)
|
||||
respond_to do |format|
|
||||
format.html{render :layout => 'base_edu'}
|
||||
format.json
|
||||
|
|
@ -710,4 +711,5 @@ class ShixunsController < ApplicationController
|
|||
render_403 if User.current.mail.blank?
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -377,14 +377,14 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
|
||||
#开放作品 || 老师 || 超级管理员 || 禁用匿评&&作业截止&&已提交作品 显示所有列表
|
||||
if (@homework.is_open == 1 && @course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.homework_detail_manual.comment_status == 6)
|
||||
if (@homework.is_open == 1 && User.current.member_of_course?(@course) && @homework.homework_detail_manual.comment_status == 6) || @is_teacher || User.current.admin?
|
||||
@stundet_works = @homework.student_works.select("student_works.*,student_works.work_score as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}")
|
||||
@show_all = true
|
||||
elsif User.current.member_of_course?(@course)
|
||||
if @homework.homework_detail_manual.comment_status == 1 || @homework.homework_detail_manual.comment_status == 2 #学生 && 未开启匿评 只看到自己的
|
||||
if @homework.homework_type == 3
|
||||
my_work = @homework.student_works.where(:user_id => User.current.id).first
|
||||
@stundet_works = my_work ? @homework.student_works.select("student_works.*,student_works.work_score as score").where(:group_id => my_work.group_id) : []
|
||||
my_work = @homework.student_works.where(:user_id => User.current.id)
|
||||
@stundet_works = !my_work.balnk? ? (my_work.first.group_id != 0 ? @homework.student_works.select("student_works.*,student_works.work_score as score").where(:group_id => my_work.first.group_id) : my_work) : []
|
||||
else
|
||||
@stundet_works = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:user_id => User.current.id)
|
||||
end
|
||||
|
|
@ -408,14 +408,14 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
|
||||
else
|
||||
if (@homework.is_open == 1 && @course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.homework_detail_manual.comment_status == 6)
|
||||
if (@homework.is_open == 1 && User.current.member_of_course?(@course) && @homework.homework_detail_manual.comment_status == 6) || @is_teacher || User.current.admin?
|
||||
@stundet_works = @homework.student_works.select("student_works.*,student_works.work_score as score").includes(:user => {:user_extensions => []}, :project => {}, :student_works_scores => {}).order("#{@order} #{@b_sort}")
|
||||
@show_all = true
|
||||
elsif User.current.member_of_course?(@course)
|
||||
if @homework.homework_detail_manual.comment_status == 1 || @homework.homework_detail_manual.comment_status == 2 #学生 && 未开启匿评 只看到自己的
|
||||
if @homework.homework_type == 3
|
||||
my_work = @homework.student_works.where(:user_id => User.current.id).first
|
||||
@stundet_works = my_work ? @homework.student_works.select("student_works.*,student_works.work_score as score").where(:group_id => my_work.group_id) : []
|
||||
my_work = @homework.student_works.where(:user_id => User.current.id)
|
||||
@stundet_works = !my_work.blank? ? (my_work.first.group_id != 0 ? @homework.student_works.select("student_works.*,student_works.work_score as score").where(:group_id => my_work.first.group_id) : my_work) : []
|
||||
else
|
||||
@stundet_works = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:user_id => User.current.id)
|
||||
end
|
||||
|
|
@ -606,7 +606,7 @@ class StudentWorkController < ApplicationController
|
|||
render_403
|
||||
else
|
||||
if @homework.homework_type == 3
|
||||
@commit_users = User.where(:id => @work.student_work_projects.map(&:user_id))
|
||||
@commit_users = User.where(:id => @homework.student_works.where("group_id = #{@work.group_id} and user_id != #{@work.user_id}").map(&:user_id))
|
||||
end
|
||||
respond_to do |format|
|
||||
format.html{ render :layout => "base_edu"}
|
||||
|
|
@ -624,9 +624,9 @@ class StudentWorkController < ApplicationController
|
|||
send_message_to_teacher(@work)
|
||||
if @homework.homework_type == 3
|
||||
@student_work_project = @homework.student_work_projects.where("user_id=?",User.current.id).first
|
||||
student_work_projects = @homework.student_work_projects.where("student_work_id=? and is_leader =?",@work.id,0)
|
||||
user_ids = student_work_projects.empty? ? "(-1)" : "(" + student_work_projects.map{|stu|stu.user_id}.join(",") + ")"
|
||||
student_works = @homework.student_works.where("user_id in #{user_ids}")
|
||||
student_work_projects = @homework.student_work_projects.where("student_work_id=? and user_id !=?",@student_work_project.student_work_id,User.current.id)
|
||||
#user_ids = student_work_projects.empty? ? "(-1)" : "(" + student_work_projects.map{|stu|stu.user_id}.join(",") + ")"
|
||||
student_works = @homework.student_works.where("group_id = #{@work.group_id} and user_id != #{@work.user_id}")
|
||||
student_works.each do |sw|
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, sw.user_id)
|
||||
if @work.work_status == 2
|
||||
|
|
@ -635,8 +635,9 @@ class StudentWorkController < ApplicationController
|
|||
course_statistics.update_attribute('committed_work_num', (course_statistics.committed_work_num - 1) < 0 ? 0 : (course_statistics.committed_work_num - 1)) if course_statistics
|
||||
course_statistics.update_attribute('un_commit_work_num', course_statistics.un_commit_work_num + 1) if course_statistics
|
||||
end
|
||||
student_works.update_all(:work_status => 0, :description => nil, :project_id => 0, :late_penalty => 0,:work_status => 0, :commit_time => nil)
|
||||
student_works.update_all(:work_status => 0, :description => nil, :project_id => 0, :late_penalty => 0,:work_status => 0, :commit_time => nil, :group_id => 0)
|
||||
student_work_projects.delete_all
|
||||
@student_work_project.update_attributes(:is_leader => 1)
|
||||
members = params[:user_id]
|
||||
for i in 1 .. members.count-1
|
||||
stu_work = @homework.student_works.where(:user_id=> members[i].to_i).empty? ? StudentWork.new : @homework.student_works.where(:user_id=> members[i].to_i).first
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class SubjectsController < ApplicationController
|
|||
|
||||
def create
|
||||
if params[:subject]
|
||||
subject = Subject.create(:name => params[:subject][:name], :description => params[:subject][:description], :user_id => User.current.id, :visits => 0, :status => 0)
|
||||
subject = Subject.create(:name => params[:subject][:name], :learning_notes => params[:subject][:learning_notes], :description => params[:subject][:description], :user_id => User.current.id, :visits => 0, :status => 0)
|
||||
end
|
||||
redirect_to subject_path(subject)
|
||||
end
|
||||
|
|
@ -48,7 +48,7 @@ class SubjectsController < ApplicationController
|
|||
|
||||
def update
|
||||
if params[:subject]
|
||||
subject = @subject.update_attributes(:name => params[:subject][:name], :description => params[:subject][:description])
|
||||
subject = @subject.update_attributes(:name => params[:subject][:name], :learning_notes => params[:subject][:learning_notes], :description => params[:subject][:description])
|
||||
end
|
||||
redirect_to subject_path(@subject)
|
||||
end
|
||||
|
|
@ -103,15 +103,15 @@ class SubjectsController < ApplicationController
|
|||
if apply && apply.status == 0
|
||||
@status = 0
|
||||
else
|
||||
if Shixun.where(:id => @subject.stage_shixuns.map(&:shixun_id), :status => [0, 1]).count > 0
|
||||
@status = 2
|
||||
else
|
||||
#if Shixun.where(:id => @subject.stage_shixuns.map(&:shixun_id), :status => [0, 1]).count > 0
|
||||
# @status = 2
|
||||
#else
|
||||
@subject.update_attributes(:status => 1)
|
||||
ApplyAction.create(:container_type => "ApplySubject", :container_id => @subject.id, :user_id => User.current.id, :status => 0)
|
||||
notes = User.current.show_name.to_s + " 申请发布课程实训:<a href='#{subject_path(@subject)}'>#{@subject.name}</a>"
|
||||
JournalsForMessage.create(:jour_id => 1, :jour_type => 'Principal', :user_id => User.current.id, :notes => notes, :private => 1, :reply_id => 0)
|
||||
@status = 1
|
||||
end
|
||||
# end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1974,9 +1974,9 @@ module ApplicationHelper
|
|||
elsif params[:controller] == "shixuns" && params[:action] == "index"
|
||||
title << ("全部实训")
|
||||
elsif @subject
|
||||
title << (@subject.name.nil? ? "实训套件" : @subject.name)
|
||||
title << (@subject.name.nil? ? "实训课程" : @subject.name)
|
||||
elsif params[:controller] == "subjects" && params[:action] == "index"
|
||||
title << ("实训套件")
|
||||
title << ("实训课程")
|
||||
elsif @organization
|
||||
title << (@organization.name.nil? ? "创新源于实践" : @organization.name)
|
||||
elsif @forum || params[:controller] == "forums"
|
||||
|
|
@ -3856,17 +3856,9 @@ module ApplicationHelper
|
|||
end
|
||||
end
|
||||
elsif work
|
||||
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3 && StudentWorksEvaluationDistribution.where("student_work_id = #{work.id}").count > 0 #匿评作业,且作业状态不是在开启匿评之前
|
||||
if homework.homework_type != 3
|
||||
link_to "作品匿评", student_work_index_url_in_org(homework.id, 2), :class => 'c_blue homepagePostSubmit', :title => "开启匿评后不可修改作品"
|
||||
else
|
||||
work_ids = "(" + homework.student_works.has_committed.map(&:id).join(",") + ")"
|
||||
if User.current.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count > 0
|
||||
link_to "作品匿评", student_work_index_url_in_org(homework.id, 2), :class => 'c_blue homepagePostSubmit', :title => "开启匿评后不可修改作品"
|
||||
else
|
||||
link_to "查看作品(#{count})",student_work_index_url_in_org(homework.id, 2), :class => 'c_blue homepagePostSubmit', :title => "匿评开启后提交的作品不参与匿评"
|
||||
end
|
||||
end
|
||||
work_ids = "(" + homework.student_works.has_committed.map(&:id).join(",") + ")"
|
||||
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3 && User.current.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count > 0 #匿评作业,且作业状态不是在开启匿评之前
|
||||
link_to "作品匿评", student_work_index_url_in_org(homework.id, 2), :class => 'c_blue homepagePostSubmit', :title => "开启匿评后不可修改作品"
|
||||
elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status > 3
|
||||
link_to "查看作品(#{count})",student_work_index_url_in_org(homework.id, 2), :class => 'c_blue homepagePostSubmit', :title => "匿评已结束"
|
||||
elsif homework.end_time >= Time.now && work.user_id == User.current.id
|
||||
|
|
@ -3991,14 +3983,14 @@ module ApplicationHelper
|
|||
#获取当前用户在指定作业下提交的作业的集合
|
||||
def cur_user_works_for_homework homework
|
||||
work = homework.student_works.where("user_id = ? && work_status != 0",User.current).first
|
||||
if homework.homework_type == 3
|
||||
pro = homework.student_work_projects.where("user_id = #{User.current.id}").first
|
||||
if pro.nil? || pro.student_work_id == "" || pro.student_work_id.nil?
|
||||
work = nil
|
||||
else
|
||||
work = StudentWork.find pro.student_work_id
|
||||
end
|
||||
end
|
||||
# if homework.homework_type == 3
|
||||
# pro = homework.student_work_projects.where("user_id = #{User.current.id}").first
|
||||
# if pro.nil? || pro.student_work_id == "" || pro.student_work_id.nil?
|
||||
# work = nil
|
||||
# else
|
||||
# work = StudentWork.find pro.student_work_id
|
||||
# end
|
||||
# end
|
||||
work
|
||||
end
|
||||
#获取当前用户在指定作业下关联的项目的集合
|
||||
|
|
|
|||
|
|
@ -116,17 +116,9 @@ module StudentWorkHelper
|
|||
myshixun = Myshixun.find work.myshixun_id
|
||||
link_to "继续实战", myshixun_game_path(myshixun.current_task, :myshixun_id => myshixun), :class => "task-btn task-btn-blue fr mr10",:target => "_blank" if myshixun
|
||||
else
|
||||
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3 && StudentWorksEvaluationDistribution.where("student_work_id = #{work.id}").count > 0 #匿评作业,且作业状态不是在开启匿评之前
|
||||
if homework.homework_type != 3
|
||||
link_to "匿评作品", student_work_index_url_in_org(homework.id, 2), :class => 'task-btn task-btn-blue fr', :title => "开启匿评后不可修改作品"
|
||||
else
|
||||
work_ids = "(" + homework.student_works.has_committed.map(&:id).join(",") + ")"
|
||||
if User.current.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count > 0
|
||||
link_to "匿评作品", student_work_index_url_in_org(homework.id, 2), :class => 'task-btn task-btn-blue fr', :title => "开启匿评后不可修改作品"
|
||||
else
|
||||
link_to "查看作品", student_work_path(work), :class => 'task-btn task-btn-blue fr', :title => "匿评开启后提交的作品不参与匿评"
|
||||
end
|
||||
end
|
||||
work_ids = "(" + homework.student_works.has_committed.map(&:id).join(",") + ")"
|
||||
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3 && User.current.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count > 0 #匿评作业,且作业状态不是在开启匿评之前
|
||||
link_to "匿评作品", student_work_index_url_in_org(homework.id, 2), :class => 'task-btn task-btn-blue fr', :title => "开启匿评后不可修改作品"
|
||||
elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status > 3
|
||||
link_to "查看作品", student_work_path(work), :class => 'task-btn task-btn-blue fr', :title => "匿评已结束"
|
||||
elsif homework.end_time >= Time.now && work.user_id == User.current.id
|
||||
|
|
|
|||
|
|
@ -1,8 +1,33 @@
|
|||
class Major < ActiveRecord::Base
|
||||
belongs_to :first_level_discipline
|
||||
belongs_to :discipline_category
|
||||
has_many :major_courses
|
||||
has_many :shixun_major_courses
|
||||
has_many :subjects
|
||||
attr_accessible :major_code, :major_level, :name, :first_level_discipline_id, :discipline_category_id
|
||||
end
|
||||
# encoding: utf-8
|
||||
class Major < ActiveRecord::Base
|
||||
belongs_to :first_level_discipline
|
||||
belongs_to :discipline_category
|
||||
has_many :major_courses
|
||||
has_many :shixun_major_courses
|
||||
has_many :subjects
|
||||
attr_accessible :major_code, :major_level, :name, :first_level_discipline_id, :discipline_category_id,:support_shixuns,:created_at,:updated_at
|
||||
# 课程的学科门类
|
||||
def major_discipline_category
|
||||
self.discipline_category ? self.discipline_category.name : ''
|
||||
end
|
||||
|
||||
# 课程的一级学科
|
||||
def major_first_level_discipline
|
||||
self.first_level_discipline ? self.first_level_discipline.name : ''
|
||||
end
|
||||
|
||||
# 课程层级
|
||||
def major_major_level
|
||||
type = ""
|
||||
case self.major_level
|
||||
when 1
|
||||
type = "研究生"
|
||||
when 2
|
||||
type = "本科"
|
||||
when 3
|
||||
type = "专科"
|
||||
end
|
||||
type
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
class MirrorRepository < ActiveRecord::Base
|
||||
has_many :mirror_update_records, :dependent => :destroy
|
||||
has_many :mirror_repository_types, :dependent => :destroy
|
||||
# status: 0 未发布 1 已发布
|
||||
attr_accessible :description, :mirrorID, :name, :status, :tag, :main_type, :created_at, :updated_at
|
||||
end
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
class MirrorRepositoryType < ActiveRecord::Base
|
||||
belongs_to :mirror_type
|
||||
belongs_to :mirror_repository
|
||||
attr_accessible :mirror_type_id, :mirror_repository_id
|
||||
end
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
class MirrorType < ActiveRecord::Base
|
||||
belongs_to :user
|
||||
has_many :mirror_repository_types, :dependent => :destroy
|
||||
attr_accessible :name, :user_id
|
||||
end
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
class MirrorUpdateRecord < ActiveRecord::Base
|
||||
belongs_to :user
|
||||
belongs_to :mirror_repository
|
||||
attr_accessible :newDescription, :newName, :newStatus, :newTag, :newType, :oldDescription, :oldName, :oldStatus, :oldTag, :oldType, :user_id, :mirror_repository_id
|
||||
end
|
||||
|
|
@ -3,11 +3,29 @@ class Subject < ActiveRecord::Base
|
|||
belongs_to :user
|
||||
belongs_to :course_list
|
||||
belongs_to :major
|
||||
attr_accessible :description, :name, :status, :visits, :user_id, :course_list_id, :major_id
|
||||
attr_accessible :description, :name, :status, :visits, :user_id, :course_list_id, :major_id, :learning_notes, :introduction
|
||||
|
||||
has_many :stages, :dependent => :destroy, :order => "stages.id ASC"
|
||||
has_many :stage_shixuns, :dependent => :destroy
|
||||
|
||||
def subject_choices
|
||||
count = 0
|
||||
self.stage_shixuns.each do |stage_shixun|
|
||||
shixun = stage_shixun.shixun
|
||||
count += shixun.challenges.where(:st => [1, 2]).count
|
||||
end
|
||||
count
|
||||
end
|
||||
|
||||
def subject_shixuns
|
||||
count = 0
|
||||
self.stage_shixuns.each do |stage_shixun|
|
||||
shixun = stage_shixun.shixun
|
||||
count += shixun.challenges.where(:st => 0).count
|
||||
end
|
||||
count
|
||||
end
|
||||
|
||||
def subject_challenges
|
||||
count = 0
|
||||
self.stage_shixuns.each do |stage_shixun|
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class Syllabus < ActiveRecord::Base
|
|||
belongs_to :discipline_category
|
||||
belongs_to :first_level_discipline
|
||||
belongs_to :major
|
||||
attr_accessible :description, :user_id, :title, :eng_name, :syllabus_type, :credit, :hours, :theory_hours, :practice_hours, :applicable_major, :pre_course, :major_level, :discipline_category_id, :first_level_discipline_id, :major_id
|
||||
attr_accessible :description, :user_id, :title, :eng_name, :syllabus_type, :credit, :hours, :theory_hours, :practice_hours, :applicable_major, :pre_course, :major_level, :discipline_category_id, :first_level_discipline_id, :major_id,:support_shixuns
|
||||
safe_attributes 'title','user', 'description', 'eng_name', 'syllabus_type', 'credit', 'hours', 'theory_hours', 'practice_hours', 'credit', 'applicable_major', 'pre_course', 'major_level', 'discipline_category_id', "first_level_discipline_id"
|
||||
|
||||
validates :title, :user_id, presence: true
|
||||
|
|
|
|||
|
|
@ -34,12 +34,12 @@
|
|||
<% syMembers = sy.members.count %>
|
||||
<% syResource = visable_attachemnts_incourse(sy) %>
|
||||
<% syHome = visable_course_homework(sy) %>
|
||||
<span class="" style="margin: 0 10px"><i class="fa fa-users color-light-green pr10" aria-hidden="true" title="成员"></i><em><%= syMembers %></em></span>
|
||||
<span class="" style="margin: 0 10px"><i class="fa fa-users color-light-green pr10" aria-hidden="true" data-tip-down="成员"></i><em><%= syMembers %></em></span>
|
||||
<% if syResource.count > 0 %>
|
||||
<span class="" style="margin: 0 10px"><i class="fa fa-cubes color-light-green pr10" aria-hidden="true" title="资源"></i><em><%= syResource.count %></em></span>
|
||||
<span class="" style="margin: 0 10px"><i class="fa fa-cubes color-light-green pr10" aria-hidden="true" data-tip-down="资源"></i><em><%= syResource.count %></em></span>
|
||||
<% end %>
|
||||
<% if syHome > 0 %>
|
||||
<span class="" style="margin: 0 10px"><i class="fa fa-map color-light-green pr10" aria-hidden="true" title="题库"></i><em><%= syHome %></em></span>
|
||||
<span class="" style="margin: 0 10px"><i class="fa fa-map color-light-green pr10" aria-hidden="true" data-tip-down="题库"></i><em><%= syHome %></em></span>
|
||||
<% end %>
|
||||
<!-- <span class="fr collect" onclick="add_cancel_to_favorites(this);">
|
||||
<i class="fa fa-heart-o grey" aria-hidden="true"title="收藏课程"></i>
|
||||
|
|
@ -58,7 +58,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="edu-tab-con-box edu-tab-con-box">
|
||||
<div class="edu-tab-con-box edu-tab-con-box user_bg_shadow">
|
||||
<img src="../images/bigdata/edu-class/edu-nodata.png" class="edu-nodata-img">
|
||||
<p class="edu-nodata-p mb30">没有数据可以显示!</p>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -64,10 +64,10 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="-layout-h -padding-h-16 -horizontal -footer-left">
|
||||
<ul class="-task-ml80" style="height:40px;">
|
||||
<ul class="-task-ml80 -layout" style="overflow:hidden;align-items:flex-end;flex-wrap:wrap;">
|
||||
<%= render :partial => "games/shixun_comment_block" %>
|
||||
<li class="fl mt10 ml20"><a href="javascript:void(0);" onclick="send_dis_to_shixun()" class="course-bth-blue color_white">发送</a></li>
|
||||
<li class="fl ml20 mt15">
|
||||
<li class="fl mt10 ml20 " style="width:54px;margin-bottom:10px;"><a href="javascript:void(0);" onclick="send_dis_to_shixun()" class="course-bth-blue color_white">发送</a></li>
|
||||
<li class="fl ml20 mt15" style="width:85px;margin-bottom:10px;">
|
||||
<span title="<%= @praise.nil? ? "点赞" : "取消点赞" %>" onclick="game_praise('<%= @game_challenge.id %>', '<%= @game_challenge.class %>')" id="game_praise_tread" class="pt5 color-grey mr20">
|
||||
<i class="fa fa-thumbs-up font-20 mr3 <%= @praise.nil? ? "" : "color-light-green" %>" alt="赞" ></i><span class="font-12 font-bd" id="game_praise_count"><%= @praise_count %></span>
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -30,9 +30,9 @@
|
|||
<% elsif game.try(:status) == 2 %>
|
||||
<% final_score = (game.answer_open? || @myshixun.shixun.status <= 1) ? 0 : game.final_score.to_i %>
|
||||
<% gold_score = @myshixun.shixun.status <= 1 ? 0 : (game.answer_open? ? -challenge.score.to_i : game.final_score.to_i) %>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_exp_<%=challenge.id %>">经验值<span class="color-light-green mr5">+<%= final_score %></span></span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_grade_<%=challenge.id %>">金币<span class="<%= gold_score < 0 ? "u-color-light-red" : "color-light-green" %> mr5"><%= gold_score < 0 ? gold_score : "+"+gold_score.to_s %></span></span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_tag_<%=challenge.id %>">技能标签<span class="color-light-green mr5">+<%= (game.answer_open? || @myshixun.shixun.status <= 1) ? 0 : challenge.challenge_tags.count %></span></span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_exp_<%=challenge.id %>">经验值<span class="color-light-green ml5">+<%= final_score %></span></span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_grade_<%=challenge.id %>">金币<span class="<%= gold_score < 0 ? "u-color-light-red" : "color-light-green" %> ml5"><%= gold_score < 0 ? gold_score : "+"+gold_score.to_s %></span></span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_tag_<%=challenge.id %>">技能标签<span class="color-light-green ml5">+<%= (game.answer_open? || @myshixun.shixun.status <= 1) ? 0 : challenge.challenge_tags.count %></span></span>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
<div class="edu-class-innner-conbox">
|
||||
<div class="edu-position task-form-20 mt15 ml15 mb10">
|
||||
<input class="task-form-100 panel-box-sizing" placeholder="输入题目关键词进行搜索" id="homework_bank_search" value="<%= @search %>" type="text">
|
||||
<a href="javascript:void(0);" remote="true" onclick="submit_homework_bank_search('<%= homework_bank_index_path(:type => @type, :order => @order, :sort => @r_sort, :property=>@property) %>')" class="edu-btn-search font-16 color-grey mt8"><i class="fa fa-search"></i></a>
|
||||
<div class="user_bg_shadow pl15 pt15 pb15">
|
||||
<div class="edu-position task-form-20">
|
||||
<input class="task-form-100 panel-box-sizing" placeholder="输入题目关键词进行搜索" id="homework_bank_search" value="<%= @search %>" type="text">
|
||||
<a href="javascript:void(0);" remote="true" onclick="submit_homework_bank_search('<%= homework_bank_index_path(:type => @type, :order => @order, :sort => @r_sort, :property=>@property) %>')" class="edu-btn-search font-16 color-grey mt8"><i class="fa fa-search"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-bg-grey clearfix color-grey font-12">
|
||||
<p class="fl ml15">共 <span class="color-orange"><%= @hw_count %></span>个搜索结果</p>
|
||||
|
|
@ -9,6 +11,7 @@
|
|||
<span class="mr5 ml5 fr">|</span>
|
||||
<%= link_to '更新时间排序', homework_bank_index_path(:type => @type, :order => "updated_at", :search => @search, :sort => @r_sort, :property=>@property), :class => "fr #{@order == 'updated_at' ? 'color-blue' : ''}", :remote => true %>
|
||||
</div>
|
||||
<div class="user_bg_shadow">
|
||||
<div class="edu-con-top clearfix">
|
||||
<p class="fl task-form-50 ml15">
|
||||
<%= link_to '全部', homework_bank_index_path(:type => @type), :class => 'edu-filter-cir-grey mr5 active font-12 fl', :id => 'homework_bank_pro_0', :remote => true %>
|
||||
|
|
@ -70,7 +73,7 @@
|
|||
<%= render :partial => 'welcome/no_data' %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<ul class="sy_classlist clearfix" style="border: none">
|
||||
<input class="magic-checkbox" type="checkbox" name="layout" id="homework_bank_all_select" class="fl">
|
||||
<label for="homework_bank_all_select" class="fl mr15">全选</label>
|
||||
|
|
|
|||
|
|
@ -63,13 +63,13 @@
|
|||
</li>
|
||||
<li><%= link_to "导出成绩", student_work_index_path(:homework => homework_common, :format => 'xls'), :id => "export_student_work" %></li>
|
||||
<% if homework_common.homework_type == 1 || homework_common.homework_type == 3 %>
|
||||
<li>
|
||||
<% if homework_common.student_works.has_committed.empty?%>
|
||||
<a href="javascript:void(0)" onclick="notice_box('没有学生提交作业,暂无附件可下载');">导出作品附件</a>
|
||||
<% else%>
|
||||
<%= link_to "导出作品附件", zipdown_assort_path(obj_class: homework_common.class,obj_id: homework_common, format: :json), remote: true, :class => "download_homework_attachments" %>
|
||||
<% end%>
|
||||
</li>
|
||||
<li>
|
||||
<% if homework_common.student_works.has_committed.empty?%>
|
||||
<a href="javascript:void(0)" onclick="notice_box('没有学生提交作业,暂无附件可下载');">导出作品附件</a>
|
||||
<% else%>
|
||||
<%= link_to "导出作品附件", zipdown_assort_path(obj_class: homework_common.class,obj_id: homework_common, format: :json), remote: true, :class => "download_homework_attachments" %>
|
||||
<% end%>
|
||||
</li>
|
||||
<% end %>
|
||||
<% unless homework_common.is_public %>
|
||||
<li id="set_homework_public_<%= homework_common.id %>">
|
||||
|
|
@ -99,16 +99,18 @@
|
|||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div style="text-align:center;">
|
||||
<div class="pages" style="width:auto; display:inline-block;">
|
||||
<ul id="homework_pository_ref_pages">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => true, :flag => true, :is_new => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% if @obj_count > 20 %>
|
||||
<div style="text-align:center;">
|
||||
<div class="pages" style="width:auto; display:inline-block;">
|
||||
<ul id="homework_pository_ref_pages">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => true, :flag => true, :is_new => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div style="background-color: #fff;padding-bottom: 10px;">
|
||||
<%= render :partial => "welcome/no_data" %>
|
||||
<%= render :partial => "welcome/no_data" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
</div>
|
||||
<ul class="fl innner-nav">
|
||||
<li><%= link_to "全部实训", shixuns_path, :class => "new-nav-a font-16" %></li>
|
||||
<li><%= link_to "实训套件", subjects_path, :class => "new-nav-a font-16" %></li>
|
||||
<li><%= link_to "实训课程", subjects_path, :class => "new-nav-a font-16" %></li>
|
||||
<li><%= link_to "在线课堂", courses_path, :class => "new-nav-a font-16" %></li>
|
||||
|
||||
<!-- <li><%#= link_to "论坛", forums_path, :class =>"new-nav-a", :target => "_blank" %></li>-->
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
<li><%#= link_to "帮助中心", "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class => "new-nav-a", :target=>"_blank" %></li>-->
|
||||
<li><%= link_to "全部实训", shixuns_path, :class => "new-nav-a font-16" %></li>
|
||||
<!--<li><%#= link_to "课程实训", subjects_path, :class => "new-nav-a font-16", :target => "_blank" %></li>-->
|
||||
<li><%= link_to "实训套件", subjects_path, :class => "new-nav-a font-16" %></li>
|
||||
<li><%= link_to "实训课程", subjects_path, :class => "new-nav-a font-16" %></li>
|
||||
<li><%= link_to "在线课堂", courses_path, :class => "new-nav-a font-16" %></li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<%= favicon %>
|
||||
<%= javascript_heads %>
|
||||
<%= heads_for_theme %>
|
||||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'css/edu-common', 'css/edu-public', 'css/font-awesome', 'css/edu-popup', 'css/magic-check', "css/edu-admin" %>
|
||||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'css/edu-common', 'css/edu-public', 'css/font-awesome', 'css/edu-popup', 'css/magic-check', "css/edu-admin", "css/moduel", "css/taskstyle" %>
|
||||
<%= javascript_include_tag "edu/application",'edu/base_edu', 'baiduTemplate', 'jquery.datetimepicker.js', "edu/management" %>
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<%= yield :header_tags -%>
|
||||
|
|
@ -28,9 +28,9 @@
|
|||
<% when 2 %>
|
||||
<%= @sub_type == 1 ? "课程列表" : "班级列表" %>
|
||||
<% when 3 %>
|
||||
<%= @sub_type == 1 ? "实训列表" :(@sub_type == 2? "已发布的实训":"已关闭的实训") %>
|
||||
<%= @sub_type == 1 ? "实训列表" :(@sub_type == 2 ? "已发布的实训": (@sub_type == 3 ? "已关闭的实训": "镜像管理")) %>
|
||||
<% when 4 %>
|
||||
<%= @sub_type == 1 ? "实训套件" : "已发布实训套件" %>
|
||||
<%= @sub_type == 1 ? "实训课程" : "已发布实训套件" %>
|
||||
<% when 5 %>
|
||||
竞赛
|
||||
<% when 6 %>
|
||||
|
|
@ -63,9 +63,10 @@
|
|||
<li><%= link_to "实训列表", shixuns_managements_path %></li>
|
||||
<li><%= link_to "已发布的实训", publish_shixuns_managements_path %></li>
|
||||
<li><%= link_to "已关闭的实训", close_shixuns_managements_path %></li>
|
||||
<!--<li><%#= link_to "镜像管理", mirror_repository_managements_path %></li>-->
|
||||
</ul>
|
||||
</li>
|
||||
<li class="fl edu-admin-nav-li edu-position <%= 'active' if @menu_type == 4 %>" style="width: 100px"><a href="javascript:void(0);" class="edu-admin-nav-a" >实训套件+</a>
|
||||
<li class="fl edu-admin-nav-li edu-position <%= 'active' if @menu_type == 4 %>" style="width: 100px"><a href="javascript:void(0);" class="edu-admin-nav-a" >实训课程+</a>
|
||||
<ul class="edu-admin-nav-inner edu-absolute">
|
||||
<li style="width: 100px"><%= link_to "实训套件列表", class_shixuns_managements_path %></li>
|
||||
<li style="width: 100px"><%= link_to "已发布实训套件", class_publish_shixuns_managements_path %></li>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,143 @@
|
|||
<div style="width: 500px" class="bor-grey-e white_bg task-popup open_box">
|
||||
<div class="task-popup-title clearfix task-popup-bggrey">
|
||||
<h3 class="fl">镜像修改</h3>
|
||||
<a href="javascript:void(0)" onclick="hideModal();"><i class="fa fa-times-circle font-18 link-color-grey fr mt5"></i></a>
|
||||
</div>
|
||||
<div class="task-popup-content">
|
||||
<form id="update_mirror_form">
|
||||
<div class="clearfix mb15">
|
||||
<label class="panel-form-label fl"><span class="mr10">镜像ID:</span></label>
|
||||
<label class="fl mt8"><%= @mirror.mirrorID %></label>
|
||||
<input type="hidden" value="<%= @mirror.id%>" name="mirror_id">
|
||||
</div>
|
||||
<div class="clearfix mb15">
|
||||
<label class="panel-form-label fl"><span class="mr10">主类别:</span></label>
|
||||
<div class="pr fl with80 status_con">
|
||||
<input type="text" name="main_type" value="<%= @mirror.main_type %>" class="panel-box-sizing task-form-100 task-height-40" placeholder="输入关键字搜索并选择"/>
|
||||
<ul class="lesson_checkbox">
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<span id="main_type_notice" class="color-orange undis"><label class="panel-form-label"> </label>请至少选择一个主类别</span>
|
||||
</div>
|
||||
<div class="clearfix mb15">
|
||||
<label class="panel-form-label fl"><span class="mr10">小类别:</span></label>
|
||||
<div class="pr fl with80 status_con">
|
||||
<input type="text" name="tag" value="<%= @mirror.tag %>" class="panel-box-sizing task-form-100 task-height-40" placeholder="请输入该镜像的小类别"/>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<span id="tag_notice" class="color-orange undis"><label class="panel-form-label"> </label>小类别不能为空</span>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
<label class="panel-form-label fl"><span class="mr10">描述:</span></label>
|
||||
<textarea type="text" name="description" class="panel-box-sizing task-form-80 task-height-100" placeholder="请输入该镜像的描述"><%= @mirror.description %></textarea>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
<label class="panel-form-label fl"><span class="mr10">状态:</span></label>
|
||||
<span class="fl mr20 mt3">
|
||||
<input type="radio" <%= @mirror.status == 0 ? "checked" : "" %> name="status" value="0" id="status_0" class="ml-3 mr5 magic-radio">
|
||||
<label for="status_0">未发布</label>
|
||||
</span>
|
||||
<span class="fl mr20 mt3">
|
||||
<input type="radio" <%= @mirror.status == 1 ? "checked" : "" %> name="status" value="1" id="status_1" class="ml-3 mr5 magic-radio">
|
||||
<label for="status_1">已发布</label>
|
||||
</span>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<span id="check_notice" class="color-orange undis"></span>
|
||||
</form>
|
||||
</div>
|
||||
<div class="clearfix mb20 mr15">
|
||||
<a href="javascript:void(0);" id="update_mirror_form_submit" class="task-btn task-btn-blue fr">确定</a>
|
||||
<a href="javascript:void(0);" onclick="hideModal();" class="task-btn fr mr10">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$("#update_mirror_form_submit").on("click", function(){
|
||||
var check = true;
|
||||
if($("input[name='main_type']").val().trim() == "" || $("input[name='main_type']").val().trim().lastIndexOf(";") == -1){
|
||||
$("#main_type_notice").show();
|
||||
check = false;
|
||||
} else{
|
||||
$("#main_type_notice").hide();
|
||||
}
|
||||
if($("input[name='tag']").val().trim() == ""){
|
||||
$("#tag_notice").show();
|
||||
check = false;
|
||||
} else{
|
||||
$("#tag_notice").hide();
|
||||
}
|
||||
if(check){
|
||||
$.ajax({
|
||||
url: '/managements/update_mirror',
|
||||
type: 'post',
|
||||
data:$("#update_mirror_form").serialize(),
|
||||
success:function(data){
|
||||
if(data.result == 1){
|
||||
$("#check_notice").html("镜像主类别和镜像小类别的设置与已有镜像(ID: "+data.ID+")重复了").show();
|
||||
} else if(data.result == 0){
|
||||
hideModal();
|
||||
window.location.href = "<%= mirror_repository_managements_path %>";
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
$("input[name='main_type']").on('input', function(e){
|
||||
throttle(search_mirror_type, window, e);
|
||||
});
|
||||
$(".open_box").click(function(event){
|
||||
$(".lesson_checkbox").hide();
|
||||
event.stopPropagation();
|
||||
});
|
||||
$(".lesson_checkbox").on("click",function(event){
|
||||
event.stopPropagation();
|
||||
});
|
||||
$(".lesson_checkbox").on('click', 'input',function(event) {
|
||||
if($(this).is(':checked')){
|
||||
var index = $("input[name='main_type']").val().trim().lastIndexOf(";");
|
||||
var str = $("input[name='main_type']").val().trim().substring(0, index+1);
|
||||
str == "" ? $("input[name='main_type']").val($(this).attr("data-val")+";") : $("input[name='main_type']").val(str+$(this).attr("data-val")+";");
|
||||
} else{
|
||||
var arr = $("input[name='main_type']").val().trim();
|
||||
$("input[name='main_type']").val(arr.replace($(this).attr("data-val")+";",""));
|
||||
}
|
||||
event.stopPropagation();
|
||||
});
|
||||
});
|
||||
var d_lastSearchCondition = '';
|
||||
function search_mirror_type(e){
|
||||
var str = $(e.target).val().trim();
|
||||
var index = str.lastIndexOf(";");
|
||||
str = str.substring(index + 1, str.length);
|
||||
if (str == d_lastSearchCondition && str != '') {//如果输入框没有改变或者输入框为空就返回
|
||||
return;
|
||||
}
|
||||
d_lastSearchCondition = str;
|
||||
$(".lesson_checkbox").empty();
|
||||
$.ajax({
|
||||
url: '/managements/search_mirror_type',
|
||||
data: {search: str},
|
||||
type: 'post',
|
||||
success: function (data) {
|
||||
if(data.mirror_types.length > 0){
|
||||
$(".lesson_checkbox").empty();
|
||||
var index = $("input[name='main_type']").val().trim().lastIndexOf(";");
|
||||
var str = $("input[name='main_type']").val().trim().substring(0, index);
|
||||
var types = str.split(";");
|
||||
console.log(types);
|
||||
for(var i=0; i<data.mirror_types.length; i++){
|
||||
var checked = $.inArray(data.mirror_types[i][0],types) == -1 ? "" : "checked";
|
||||
$(".lesson_checkbox").append("<li><input name='mirror_type[]' "+checked+" data-val='"+data.mirror_types[i][0]+"' value='' id='mirror_type_"+data.mirror_types[i][1]+"' class='ml-3 mr5 magic-checkbox' type='checkbox'>" +
|
||||
"<label for='mirror_type_"+data.mirror_types[i][1]+"'>"+data.mirror_types[i][0]+"</label></li>");
|
||||
}
|
||||
$(".lesson_checkbox").show();
|
||||
} else{
|
||||
$(".lesson_checkbox").hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,143 @@
|
|||
<%= form_tag(url_for(insert_major_managements_path),:id=>"insert_major",:method => "post") do %>
|
||||
<div style="width:450px" class="task-popup">
|
||||
<div class="task-popup-title clearfix ">
|
||||
<h3 class="fl color-grey mt10 ml5">新增专业</h3>
|
||||
<a href="javascript:void(0);" class="pop_close"><i class="fa fa-times-circle font-18 link-color-grey fr mt5"></i></a>
|
||||
</div>
|
||||
<div class="edu-con-bg01">
|
||||
<ul class="ml50 mt10">
|
||||
<li class="clearfix mb20">
|
||||
<label class="panel-form-label label-w20 fl" ><span class="color-orange mr5">*</span>专业层级 </label>
|
||||
<div class="with60 fl pr" select-for>
|
||||
<input type="hidden" name="major_level" id="major_level" value="0">
|
||||
<input class="task-height-40 task-form-90 panel-box-sizing pr20 color-grey3" readonly placeholder="选择课程所属专业层级"/>
|
||||
<div class="down-select bor-grey-e user_bg_shadow" id="major_level_option">
|
||||
<p data-major="3">专科</p>
|
||||
<p data-major="2">本科</p>
|
||||
<p data-major="1">研究生</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<span class="color-orange fl none" id="major_level_notice" style="margin-left:20%;"><i class="fa fa-exclamation-circle mr5" ></i>请选择课程所属专业层级</span>
|
||||
</li>
|
||||
<li class="clearfix mb20">
|
||||
<label class="panel-form-label label-w20 fl" ><span class="color-orange mr5">*</span>学科门类 </label>
|
||||
<div class="with60 fl pr" select-for>
|
||||
<input type="hidden" name="discipline_category_id" id="discipline_category_id" value="0">
|
||||
<input class="task-height-40 task-form-90 panel-box-sizing pr20 color-grey3" readonly placeholder="选择课程所属学科门类"/>
|
||||
<div class="down-select bor-grey-e user_bg_shadow" id="discipline_category_option">
|
||||
<% DisciplineCategory.where(:major_level => 3).each do |dis| %>
|
||||
<p data-discipline-category-id="<%= dis.id %>"><%= dis.name %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<span class="color-orange fl none" id="discipline_category_id_notice" style="margin-left:20%;"><i class="fa fa-exclamation-circle mr5" ></i>请选择课程所属学科门类</span>
|
||||
</li>
|
||||
<li class="clearfix mb20">
|
||||
<label class="panel-form-label label-w20 fl" ><span class="color-orange mr5">*</span>一级学科 </label>
|
||||
<div class="with60 fl pr" select-for>
|
||||
<input type="hidden" name="first_level_discipline_id" id="first_level_discipline_id" value="0">
|
||||
<input class="task-height-40 task-form-90 panel-box-sizing pr20 color-grey3" readonly placeholder="选择课程所属一级学科"/>
|
||||
<div class="down-select bor-grey-e user_bg_shadow" id="first_level_discipline_option">
|
||||
<% FirstLevelDiscipline.where(:discipline_category_id => 27).each do |fir_dis| %>
|
||||
<p data-first-level-discipline-id="<%= fir_dis.id %>"><%= fir_dis.name %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<%#= select_tag :first_level_discipline_id,options_for_select(first_level_discipline_option,@syllabus.first_level_discipline_id), {:id=>"first_level_discipline_id", :class=>"fl task-height-40 task-form-80"} %>
|
||||
<div class="cl"></div>
|
||||
<span class="color-orange fl none" id="first_level_discipline_id_notice" style="margin-left:20%;"><i class="fa fa-exclamation-circle mr5" ></i>请选择课程所属一级学科</span>
|
||||
</li>
|
||||
<li class="clearfix mb20">
|
||||
<label class="panel-form-label label-w20 fl" ><span class="color-orange mr5">*</span>专业代码 </label>
|
||||
<div class="with60 fl pr">
|
||||
<input class="task-height-40 task-form-100 panel-box-sizing pr20 color-grey3" name="major_code" id="major_code" placeholder="输入所要添加的专业代码"/>
|
||||
<div class="cl"></div>
|
||||
<span class="color-orange fl none" id="major_code_notice" style="margin-left:20%;"><i class="fa fa-exclamation-circle mr5" ></i>专业代码不能为空</span>
|
||||
</div>
|
||||
</li>
|
||||
<li class="clearfix mb20">
|
||||
<label class="panel-form-label label-w20 fl" ><span class="color-orange mr5">*</span>专业名称 </label>
|
||||
<div class="with60 fl pr">
|
||||
<input class="task-height-40 task-form-100 panel-box-sizing pr20 color-grey3" id="major" name="major" placeholder="输入所要添加的专业"/>
|
||||
<div class="cl"></div>
|
||||
<span class="color-orange fl none" id="major_notice" style="margin-left:20%;"><i class="fa fa-exclamation-circle mr5" ></i>专业名称不能为空且至少有两个字符</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="task-popup-submit clearfix ml25">
|
||||
<a href="javascript:void(0);" onclick="hideModal();" class="task-btn fl pop_close mr10">取消</a>
|
||||
<a href="javascript:void(0);" onfocus='this.blur();' onclick="new_major_submit();" class="task-btn task-btn-blue fr" >确定</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<!--<script src="../../../public/javascripts/application.js" type="text/javascript" charset="utf-8"></script>-->
|
||||
<script>
|
||||
$("[select-for]").append("<i class='fa fa-sort-desc lesson_img'></i>");
|
||||
$("[select-for]").hover(function(){
|
||||
$(this).find(".down-select").show();
|
||||
},function(){
|
||||
$(this).find(".down-select").hide();
|
||||
})
|
||||
$("[select-for] .down-select p").bind("click",function(){
|
||||
$(this).parents().prev("input").val($(this).html().trim());
|
||||
$(this).parents(".down-select").hide();
|
||||
})
|
||||
|
||||
function regex_major_name() {
|
||||
var name = $.trim($("#major").val());
|
||||
if(name.length < 2)
|
||||
{
|
||||
$("#major_notice").show();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#major_notice").hide();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
function new_major_submit()
|
||||
{
|
||||
var major=$("#major").val();
|
||||
var major_level=$("#major_level").val();
|
||||
var discipline_category_id=$("#discipline_category_id").val();
|
||||
var first_level_discipline_id=$("#first_level_discipline_id").val();
|
||||
var major_code=$("#major_code").val();
|
||||
if($("#major_level").val() == "0"){
|
||||
$("#major_level_notice").show();
|
||||
} else if($("#discipline_category_id").val() == "0"){
|
||||
$("#discipline_category_id_notice").show();
|
||||
} else if($("#first_level_discipline_id").val() == "0"){
|
||||
$("#first_level_discipline_id_notice").show();
|
||||
} else if($("#major_code").val() ==''){
|
||||
$("#major_code_notice").show();
|
||||
} else {
|
||||
if(regex_major_name()) {
|
||||
// $.ajax({
|
||||
// url: '/managements/insert_major',
|
||||
// type: 'post',
|
||||
// data:{major:major,major_level:major_level,discipline_category_id:discipline_category_id,first_level_discipline_id:first_level_discipline_id,major_code:major_code},
|
||||
// success: function(data) {
|
||||
// if (data.result == 0) {
|
||||
// $("#major_repeat_notice").show();
|
||||
// $("#major_notice").hide();
|
||||
// }
|
||||
// else {
|
||||
// $("#major").val($.trim($("#major").val()));
|
||||
// $("#new_major").submit();
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// });
|
||||
$("#major").val($.trim($("#major").val()));
|
||||
$("#insert_major").submit();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -11,18 +11,18 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @syllabus.each do |syllabus| %>
|
||||
<% @major.each do |major| %>
|
||||
<tr>
|
||||
<td><%= syllabus.id %></td>
|
||||
<td><%= syllabus.syllabus_major_level == '' ? "--" : syllabus.syllabus_major_level %></td>
|
||||
<td class="edu-txt-left"><%= syllabus.syllabus_discipline_category == '' ? "--" : syllabus.syllabus_discipline_category %></td>
|
||||
<td class="edu-txt-left"><%= syllabus.syllabus_first_level_discipline == "" ? "--" : syllabus.syllabus_first_level_discipline %></td>
|
||||
<td class="edu-txt-left"><%= syllabus.syllabus_major == "" ? "--" : syllabus.syllabus_major %></td>
|
||||
<td> <%= format_time syllabus.created_at %></td>
|
||||
<td class="operate edu-txt-left"><span class="fr shixun_webssh">
|
||||
<input type="checkbox" value="0" class="magic-checkbox" id="join_course_role_<%= syllabus.id%>">
|
||||
<label style="top:-3px;padding-left: 25px;" for="join_course_role_<%= syllabus.id %>">支撑实训</label>
|
||||
</span></td>
|
||||
<td><%= major.id %></td>
|
||||
<td><%= major.major_major_level %></td>
|
||||
<td class="edu-txt-left"><%= major.major_discipline_category %></td>
|
||||
<td class="edu-txt-left"><%= major.major_first_level_discipline %></td>
|
||||
<td class="edu-txt-left"><%= major.name %></td>
|
||||
<td> <%= format_time major.created_at %></td>
|
||||
<td>
|
||||
<input type="checkbox" name="support_shixuns" value="<%= major.id %>" <%= major.support_shixuns ? "checked" : "" %> class="mr5 magic-checkbox" id="join_course_role_<%= major.id%>">
|
||||
<label style="top:-3px;float: right" class="mr25" for="join_course_role_<%= major.id %>">支撑实训</label>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
<div style="text-align:center;" class="new_expand">
|
||||
<div class="pages_user_show" style="width:auto; display:inline-block;margin: 18px 0;">
|
||||
<ul id="homework_pository_ref_pages">
|
||||
<%= pagination_links_full @syllabus_pages, @syllabus_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
|
||||
<%= pagination_links_full @major_pages, @major_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
|
@ -46,5 +46,14 @@
|
|||
data: $("#profession").serialize(),
|
||||
dateType: "script"
|
||||
});
|
||||
});
|
||||
$("input[name='support_shixuns']").click(function(){
|
||||
var support_shixun_val = $(this).val();
|
||||
$.ajax({
|
||||
url:"<%= support_shixun_managements_path %>",
|
||||
data: {syllabus_id: support_shixun_val},
|
||||
type: 'post',
|
||||
dateType: "script"
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<input class="fl task-form-20 task-height-30 ml35 " name="search" maxlength="" placeholder="输入关键字进行搜索" type="text" style="height: 21px;" id="Look_name">
|
||||
<a href="javascript:void(0);" class="fl task-btn task-btn-blue ml5 " onclick="$('#classroom').submit();">搜索</a>
|
||||
<a href="javascript:clearSearchCondition()" class="fl task-btn ml5 " id="clear_contents">清除</a>
|
||||
<a href="javascript:void(0)" class="task-btn task-btn-green fr mr30" onclick="alert_new_major_type('<%= %>')">新增实训适用课程</a>
|
||||
<a href="javascript:void(0)" class="task-btn task-btn-green fr mr30" onclick="alert_new_major_type('<%= %>')">新增课程</a>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="edu-con-bg01 mt15" id="classroom_list">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
<% if @status == 1 %>
|
||||
$("#mirror_rep_<%= params[:mirror_id] %>").nextAll().each(function(){
|
||||
$(this).children(":first").html(parseInt($(this).children(":first").html()) - 1);
|
||||
});
|
||||
$("#mirror_rep_<%= params[:mirror_id] %>").remove();
|
||||
notice_box("删除成功");
|
||||
<% else %>
|
||||
notice_box("删除失败");
|
||||
<% end %>
|
||||
|
|
@ -12,6 +12,6 @@
|
|||
<script>
|
||||
function clearSearchCondition(){
|
||||
$("#shixun_Look_name").val("");
|
||||
$.get('<%=depart_managements_path() %>')
|
||||
$.get('<%= depart_managements_path() %>')
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,109 @@
|
|||
<div class="edu-class-container">
|
||||
<div class="edu-con-top clearfix mb20 df">
|
||||
<label class="fl mt5 mb5 ml15">镜像主类别:</label>
|
||||
<div class="fl" style="flex:1">
|
||||
<% @mirror_types.each do |type| %>
|
||||
<span class="fl mt5 mr20"><%= type.name %></span>
|
||||
<% end %>
|
||||
<div class="task-tag tag-grey mr10 fl mt5 mb5" id="add_mirror_sort" style="display: none;">
|
||||
<button data-dismiss="alert" class="close fr mt3 ml5" type="button" onclick="$('#add_mirror_sort').slideToggle();">×</button>
|
||||
<input type="text" class="task-tag-input" id="mirror_sort_input" placeholder="请输入镜像主类别">
|
||||
</div>
|
||||
<a href="javascript:void(0);" class="fl color-light-green mt5 mb5" onclick="$('#add_mirror_sort').slideToggle(); $('#mirror_sort_input').focus();" id="add_knowledge">+添加</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ex_container white_bg" id="management_mirror_list">
|
||||
<table class="edu-pop-table" cellspacing="0" cellpadding="0">
|
||||
<thead>
|
||||
<th width="4%">序号</th>
|
||||
<th width="8%" style="text-align: left;">镜像ID</th>
|
||||
<th width="11%" style="text-align: left;">镜像名称</th>
|
||||
<th width="17%" style="text-align: left;">镜像主类别</th>
|
||||
<th width="17%" style="text-align: left;">镜像小类别</th>
|
||||
<th width="16%" style="text-align: left;">镜像描述</th>
|
||||
<th width="7%">状态</th>
|
||||
<th width="12%">修改时间</th>
|
||||
<th width="7%">操作</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% if @mirrors.count > 0 %>
|
||||
<% @mirrors.each_with_index do |mirror, index| %>
|
||||
<tr id="mirror_rep_<%= mirror.id %>">
|
||||
<td class="edu-txt-center"><%= index + 1 %></td>
|
||||
<td><%= mirror.mirrorID %></td>
|
||||
<td class="break_word"><%= mirror.name %></td>
|
||||
<td class="pl5 pr5">
|
||||
<p class="break_word"><%= mirror.main_type %></p>
|
||||
</td>
|
||||
<td class="break_word">
|
||||
<p class="break_word pl5 pr5"><%= mirror.tag %></p>
|
||||
</td>
|
||||
<td class="pl5 pr5"><%= mirror.description %></td>
|
||||
<td class="edu-txt-center"><%= mirror.status == 0 ? "未发布" : "已发布" %></td>
|
||||
<td class="edu-txt-center"><%= format_time mirror.updated_at %></td>
|
||||
<td class="edu-txt-center">
|
||||
<% if mirror.status == 0 %>
|
||||
<a href="javascript:void(0)" onclick="delete_confirm_box_2('<%= delete_mirror_managements_path(:mirror_id => mirror.id) %>', '确定要删除该镜像吗')" class="color-blue">删除</a>
|
||||
<% end %>
|
||||
<%= link_to '修改', modify_mirror_managements_path(:mirror_id => mirror.id), :class => "color-blue update_table_date", :remote => true %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= render :partial => "welcome/no_data" %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function add_tag(){
|
||||
var num = $(".task-bd-grey").children('div').length;
|
||||
var val = $(".task-tag-input").val().trim();
|
||||
if (val != ""){
|
||||
$.ajax({
|
||||
url: "/managements/add_mirror_type",
|
||||
type: 'post',
|
||||
data: {name: val},
|
||||
success: function(data){
|
||||
console.log(data.result);
|
||||
if(data.result == 0){
|
||||
$("#add_mirror_sort").hide();
|
||||
$(".task-tag-input").attr("value","");
|
||||
} else if(data.result == 1){
|
||||
$("<span class='fl mt5 mr20'>"+val+"</span>").insertBefore($("#add_mirror_sort"));
|
||||
$(".task-tag-input").attr("value","");
|
||||
$("#add_mirror_sort").hide();
|
||||
} else if(data.result == 2){
|
||||
$("#add_mirror_sort").hide();
|
||||
$(".task-tag-input").attr("value","");
|
||||
notice_box("该镜像主类别已存在,不能重复添加");
|
||||
}
|
||||
}
|
||||
});
|
||||
} else{
|
||||
$("#mirror_sort_input").val("");
|
||||
$("#add_mirror_sort").hide();
|
||||
}
|
||||
}
|
||||
|
||||
function close_tag(thisObj){
|
||||
// 获取父节点的id
|
||||
var obj = thisObj.parentNode.id;
|
||||
$("#"+obj).remove();
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$("#mirror_sort_input").on("blur", function(e){
|
||||
add_tag();
|
||||
});
|
||||
$("#mirror_sort_input").on("keypress",function(e){
|
||||
if (e.keyCode == '13') {
|
||||
$("#mirror_sort_input").off("blur");
|
||||
add_tag();
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
var html_value = "<%= escape_javascript(render :partial => 'managements/modify_mirror_modal') %>";
|
||||
pop_box_new(html_value, 500, 430);
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
var htmlvalue = " <%= escape_javascript( render :partial => 'managements/new_major') %>";
|
||||
pop_box_new(htmlvalue, 450, 420);
|
||||
|
|
@ -1,27 +1,47 @@
|
|||
<%= form_tag(url_for(profession_managements_path),:id=>"profession",:method => "post",:remote=>true) do %>
|
||||
<div class="edu-con-top clearfix xmt10">
|
||||
<%= 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_level,options_for_select(major_level_option, 0), {:id=>"major_level_p", :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_p", :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_p", :class=>"fl task-form-20 task-height-30", :style => "margin:0px 30px 0px 25px;"} %>
|
||||
<a href="javascript:void(0);" class="fl task-btn task-btn-blue ml5 " onclick="$('#profession').submit();">搜索</a>
|
||||
<a href="javascript:clearSearchCondition()" class="fl task-btn ml5 mt2 " id="clear_contents">清除</a>
|
||||
<a href="#" class="task-btn task-btn-green fr mr30" >新增</a>
|
||||
<%= link_to '新增',{ :controller => 'managements', :action => 'new_major', }, :remote => true, :class => "task-btn task-btn-green fr mr30" %>
|
||||
<input type="hidden" name="sx_order"/>
|
||||
<span class="fr shixun_webssh">
|
||||
<input type="checkbox" name="support_shixuns" class="mr5 magic-checkbox" id="join_course_role_0" value="1">
|
||||
<label style="top:2px;padding-left:23px;" for="join_course_role_0"><span class="only_view" >只看支撑实训</span></label>
|
||||
</span>
|
||||
</div>
|
||||
<span class="shixun_webssh">
|
||||
<input type="checkbox" class="mr5 magic-checkbox" id="join_course_role_0">
|
||||
<label style="margin-left:35px;" for="join_course_role_0"><span class="only_view">只看支撑实训</span></label>
|
||||
</span>
|
||||
|
||||
<% end %>
|
||||
<div class="edu-con-bg01 mt15" id="classroom_list">
|
||||
<%= render :partial => "managements/profession_list" %>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function clearSearchCondition(){
|
||||
$("#major_level").val("");
|
||||
$("#discipline_category_id").val("");
|
||||
$("#first_level_discipline_id").val("");
|
||||
$("#major_level_p").val("");
|
||||
$("#discipline_category_id_p").val("");
|
||||
$("#first_level_discipline_id_p").val("");
|
||||
$.get('<%= profession_managements_path() %>');
|
||||
}
|
||||
};
|
||||
|
||||
$("#join_course_role_0").on('click', function(){
|
||||
$("#profession").submit();
|
||||
});
|
||||
// $("#major_level_p").change(function(e){
|
||||
// $("#major_level_p").val($(this).children('option:selected').val());
|
||||
// $.ajax({
|
||||
// url: '/syllabuses/get_discipline_categories',
|
||||
// type: 'get',
|
||||
// data: {major_level:$(this).children('option:selected').val()},
|
||||
// success: function(data){
|
||||
// if (data.result == 1){
|
||||
// $("#discipline_category_id_p").html("");
|
||||
// for(var i=0; i<data.options.length; i++){
|
||||
// $("discipline_category_id_p").append("<option data-discipline-category-id='" + data.options[i][1] + "'>" + data.options[i][0] + "</option>");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// })
|
||||
</script>
|
||||
|
|
@ -1,4 +1,11 @@
|
|||
<div class="wrap-big mt20" style="min-height: 600px">
|
||||
<div class="wrap-big mt20 pr" style="min-height: 600px">
|
||||
<div class="popup_tip_box fontGrey2" style="right:-222px; top:68px;position: absolute">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p class="font-12">
|
||||
提交代码时,账号请用绑定的邮箱<br/>密码请用平台登录密码
|
||||
</p>
|
||||
</div>
|
||||
<div class="repository_con" style="line-height:1.9;">
|
||||
<ul class="clearfix pro-top-info mb10">
|
||||
<li style="width: 459px;"><i class="icon-time mr5 c_grey02 f16 fb"></i>
|
||||
|
|
|
|||
|
|
@ -26,4 +26,9 @@
|
|||
<span class="color-orange fl none" id="add_teacher_notice"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$("#search_not_collaborators").on('input', function (e) {
|
||||
throttle(search_not_teacher_f, window, e);
|
||||
});
|
||||
</script>
|
||||
|
|
@ -39,9 +39,15 @@
|
|||
</li>
|
||||
<li class="clearfix mb15">
|
||||
<label class="panel-form-label fl"><span class="color-orange mr5">*</span>适用专业 </label>
|
||||
<%= select_tag :major_id, options_for_select(shixun_major_option, 0), :id => 'shixun_major', :class => "fl task-form-30 task-height-40"%>
|
||||
<%#= select_tag :major_id, options_for_select(shixun_major_option, 0), :id => 'shixun_major', :class => "fl task-form-30 task-height-40"%>
|
||||
<select class="fl task-form-30 task-height-40" id="shixun_major" name="major_id">
|
||||
<option value="0" selected="selected">选择实训适用专业</option>
|
||||
<% @support.each do |support| %>
|
||||
<option value="<%= support.id %>"><%= support.name %></option>
|
||||
<% end %>
|
||||
</select>
|
||||
<div class="cl"></div>
|
||||
<p class="-text-danger ml115" id="shixun_major_notice" style="display: none;">请选择适用专业</p>
|
||||
<p class="text-danger ml115" id="shixun_major_notice" style="display: none;">请选择适用专业</p>
|
||||
</li>
|
||||
<li class="clearfix mb15 pr">
|
||||
<label class="panel-form-label fl"><span class="color-orange mr5">*</span>适用课程 </label>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<% if @mail %>
|
||||
notice_box_redirect('#{security_settings_path}', '开启实训,请先绑定邮箱');
|
||||
sure_box_redirect('#{security_settings_path}', '开启实训,请先绑定邮箱');
|
||||
<% else %>
|
||||
<% if @is_modify.blank? %>
|
||||
//为了防止浏览器阻挡
|
||||
|
|
|
|||
|
|
@ -95,8 +95,14 @@
|
|||
<div class="mt5" style="max-height: 481px; overflow: auto;">
|
||||
<table class="edu-pop-table" cellspacing="0" cellpadding="0">
|
||||
<tbody id="group_member_choose_list">
|
||||
<tr class="" id="group_member_choose_li_<%= @work.user.id %>">
|
||||
<td><span class="edu-txt-w140 task-hide pl10"><%= @work.user.show_real_name %></span></td>
|
||||
<td><span class="edu-txt-w140 task-hide"><%= @work.user.user_extensions.try(:student_id) %></span></td>
|
||||
<td><%= @course.members.where(:user_id => @work.user.id).first.course_group.try(:name) %></td>
|
||||
<input type="hidden" name="user_id[]" value="<%= @work.user.id %>">
|
||||
</tr>
|
||||
<% @commit_users.each do |user| %>
|
||||
<tr class="<%= user == User.current ? '' : 'choose_group_member_li' %>" id="group_member_choose_li_<%= user.id %>">
|
||||
<tr class="choose_group_member_li" id="group_member_choose_li_<%= user.id %>">
|
||||
<td><span class="edu-txt-w140 task-hide pl10"><%= user.show_real_name %></span></td>
|
||||
<td><span class="edu-txt-w140 task-hide"><%= user.user_extensions.try(:student_id) %></span></td>
|
||||
<td><%= @course.members.where(:user_id => user.id).first.course_group.try(:name) %></td>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
<div class="active-class">
|
||||
<p style="line-height: 42px;">
|
||||
<i class="fa fa-map-marker mr5 color-grey"></i>
|
||||
<a href="/users/kosasa">kosasa</a> > <a href="/courses">实训套件</a>
|
||||
<a href="/users/kosasa">kosasa</a> > <a href="/courses">实训课程</a>
|
||||
><span>新建</span>
|
||||
</p>
|
||||
<div class="edu-con-top ">
|
||||
|
|
|
|||
|
|
@ -14,98 +14,59 @@
|
|||
</div>
|
||||
<% else %>
|
||||
<% @subjects.each do |subject| %>
|
||||
<div class="sub-con fl pr" style="cursor: default;">
|
||||
<% if subject.status < 2 && !User.current.manager_of_subject?(subject) %>
|
||||
<div class="black-half">
|
||||
<div class="black-half-lock"><i class="fa fa-lock" style="font-size: 50px"></i></div>
|
||||
<div class="black-half-info font-16">非试用内容,需要授权</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="course-list-index-name" onclick="subject_link(<%= subject.id %>)" style="cursor: pointer;">
|
||||
<p class="font-14 course-list-index-title two_lines_show task-text-center">
|
||||
<a href="javascript:void(0);"><%= subject.name %></a>
|
||||
</p>
|
||||
<div class="clearfix task-index-list-user" style="margin-bottom: 5px">
|
||||
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(subject.user), :width =>"60", :height => "60", :class => "panel-warp-img mr10 fl", :alt=>"头像") %></a>
|
||||
<span class="task-index-name task-hide fl"><%= subject.user.try(:show_name) %></span>
|
||||
</div>
|
||||
<p class="color-grey college task-text-center">
|
||||
<%# if !subject.user.user_extensions.school_id.blank? && subject.user.user_extensions.school %>
|
||||
<%#= subject.user.user_extensions.school.name %>
|
||||
<%# end %>
|
||||
</p>
|
||||
<p class="color-grey pl15 pr15 clearfix" style="text-align: center;">
|
||||
<span class="" style="margin: 0 10px"><i class="fa fa-gamepad color-light-green pr10" aria-hidden="true" title="实训"></i><em><%= subject.stage_shixuns.count %></em></span>
|
||||
<span class="" style="margin: 0 10px"><i class="fa fa-tasks color-light-green pr10" aria-hidden="true" title="实训阶段"></i><em><%= subject.subject_challenges %></em></span>
|
||||
<span class="" style="margin: 0 10px"><i class="fa fa-viacoin color-light-green pr10" aria-hidden="true" title="实训总积分"></i><em><%= subject.subject_score %></em></span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="half-bot clearfix">
|
||||
<div class="half-bot-content">
|
||||
<ul class="fr bot_li">
|
||||
<% if subject.stage_shixuns.count <= 6 %>
|
||||
<% for i in 1 .. subject.stage_shixuns.count do %>
|
||||
<li><span><%= i %></span></li>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<li><span>1</span></li>
|
||||
<li><span>2</span></li>
|
||||
<li><span>3</span></li>
|
||||
<li><span>4</span></li>
|
||||
<li><span>...</span></li>
|
||||
<li><span><%= subject.stage_shixuns.count %></span></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<!--实训套件改版-->
|
||||
<!--<div class="pre_sub-con fl pr">
|
||||
<div class="pre_sub-con fl pr">
|
||||
<div class="box_bg_shandow with100 white_bg" style="z-index: 3;cursor: default;position:absolute;">
|
||||
<%# if subject.status < 2 && !User.current.manager_of_subject?(subject) %>
|
||||
<% if subject.status < 2 && !User.current.manager_of_subject?(subject) %>
|
||||
<div class="black-half">
|
||||
<div class="black-half-lock"><i class="fa fa-lock" style="font-size: 50px"></i></div>
|
||||
<div class="black-half-info font-16">非试用内容,需要授权</div>
|
||||
</div>
|
||||
<%# end %>
|
||||
<div class="subject-box" onclick="subject_link(<%#= subject.id %>)" style="cursor: pointer;padding-bottom: 5px">
|
||||
<% end %>
|
||||
<div class="subject-box" onclick="subject_link(<%= subject.id %>)" style="cursor: pointer;padding-bottom: 5px">
|
||||
<p class="font-14 course-list-index-title two_lines_show task-text-center mb5 mt5" style="height: 44px">
|
||||
<a href="javascript:void(0);" style="height: 44px;display: block;line-height: 22px;"><%#= subject.name %></a>
|
||||
<a href="javascript:void(0);" style="height: 44px;display: block;line-height: 22px;"><%= subject.name %></a>
|
||||
</p>
|
||||
<p class="font-14 three_lines_show task-text-center mb20" style="text-align: left;">
|
||||
计算思维导论计算思维导论计算思维导论计算思维导论计算思维导论计算思维导论计算思维导论计算思维导论计算思维导论计算思维导论计算思维导论计算思维导论计算思维导论计算思维导论
|
||||
<p class="font-14 three_lines_show task-text-center mb20 color-dark-grey" style="text-align: left;">
|
||||
<%= subject.description.blank? ? "轻松学习#{subject.name}~" : subject.description %>
|
||||
</p>
|
||||
<p class="color-grey bor-bottom-greyE mb15 clearfix" style="text-align: center;">
|
||||
<span class="pl10 pr10"><i class="fa fa-pause-circle color-light-green transform90" aria-hidden="true" data-tip-down="章节"></i><em class="ml10"><%#= subject.stage_shixuns.count %></em></span>
|
||||
<span class="pl10 pr10"><i class="fa fa-gamepad color-light-green pr10" aria-hidden="true" data-tip-down="实训"></i><em><%#= subject.stage_shixuns.count %></em></span>
|
||||
<span class="pl10 pr10"><i class="fa fa-tasks color-light-green pr10" aria-hidden="true" data-tip-down="实训阶段"></i><em><%#= subject.subject_challenges %></em></span>
|
||||
<span class="pl10 pr10"><i class="fa fa-viacoin color-light-green pr10" aria-hidden="true" data-tip-down="总经验值"></i><em><%#= subject.subject_score %></em></span>
|
||||
<p class="color-grey bor-bottom-greyE mb5 clearfix" style="text-align: center;">
|
||||
<span class="pl10 pr5"><i class="fa fa-pause-circle color-light-green transform90" aria-hidden="true" data-tip-down="章节"></i><em class="ml10"><%= subject.stages.count %></em></span>
|
||||
<span class="pl10 pr5"><i class="fa fa-gamepad color-light-green pr10" aria-hidden="true" data-tip-down="实训"></i><em><%= subject.stage_shixuns.count %></em></span>
|
||||
<span class="pl10 pr5"><i class="fa fa-viacoin color-light-green pr10" aria-hidden="true" data-tip-down="总经验值"></i><em><%= subject.subject_score %></em></span>
|
||||
<span class="pl10 pr5"><i class="fa fa-users color-light-green pr10" aria-hidden="true" data-tip-down="学习人数"></i><em><%= subject.subject_challenges %></em></span>
|
||||
</p>
|
||||
<div class="clearfix mb5 df">
|
||||
<a href="javascript:void(0);"><%#= image_tag(url_to_avatar(subject.user), :width =>"40", :height => "40", :class => "bor-radius-all mr10 fl", :alt=>"头像") %></a>
|
||||
<div class="clearfix mb10 df">
|
||||
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(subject.user), :width =>"40", :height => "40", :class => "bor-radius-all mr10 fl mt8", :alt=>"头像") %></a>
|
||||
<div class="fl" style="flex: 1;text-align: left">
|
||||
<p style="line-height: 20px"><%#= subject.user.try(:show_name) %></p>
|
||||
<p class="font-12 unit-name">国防科学技术大学讲师</p>
|
||||
<p class="color-dark-grey"><%= subject.user.try(:show_name) %></p>
|
||||
<p class="font-12 unit-name color-dark-grey"><%= subject.user.school_name + subject.user.identity %></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box_bg_shandow white_bg pre-book" style="z-index: 2;width: 98%;left: 1%;bottom: -5px;"></div>
|
||||
<div class="box_bg_shandow white_bg pre-book" style="z-index: 1;width: 96%;left: 2%;bottom: -10px;"></div>
|
||||
</div>-->
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if @subjects_count > 16 %>
|
||||
<div style="text-align:center;" class="new_expand">
|
||||
<div class="pages_user_show" style="width:auto; display:inline-block;margin: 18px 0;">
|
||||
<div class="pages_user_show" style="width:auto; display:inline-block;">
|
||||
<ul id="homework_pository_ref_pages">
|
||||
<%= pagination_links_full @subject_pages, @subjects_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!--<div style="text-align:center;">-->
|
||||
<!--<div class="pages_user_show" style="width:auto; display:inline-block;">-->
|
||||
<!--<ul id="homework_pository_ref_pages">-->
|
||||
<!--<%#= pagination_links_full @syllabuses_pages, @syllabus_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>-->
|
||||
<!--</ul>-->
|
||||
<!--<div class="cl"></div>-->
|
||||
<!--</div>-->
|
||||
<!--</div>-->
|
||||
<% end %>
|
||||
|
||||
<script>
|
||||
|
|
|
|||
|
|
@ -1,23 +1,35 @@
|
|||
<div class="subhead">
|
||||
<div class="subhead_content">
|
||||
<p class="color_white font-16">
|
||||
<p class="font-24 color_white subject-main-name"><%= @subject.name %>
|
||||
<% if User.current.manager_of_subject?(@subject) %>
|
||||
<a href="<%= edit_subject_path(@subject) %>"><i class="fa fa-pencil mt15 ml10 color-grey-c edit_subject_name font-18" data-tip-down="编辑"></i></a>
|
||||
<% end %>
|
||||
</p>
|
||||
<p class="color-light-grey-E font-16 mb30">
|
||||
<% if !@subject.user.user_extensions.school_id.blank? && @subject.user.user_extensions.school %>
|
||||
<%= @subject.user.user_extensions.school.name %>
|
||||
<% end %>
|
||||
<%= @subject.user.show_name %>
|
||||
</p>
|
||||
<div class="clearfix">
|
||||
<p class="fl font-24 color_white subject-main-name"><%= @subject.name %></p>
|
||||
<%# if User.current.manager_of_subject?(@subject) && @subject.status == 0 %>
|
||||
<!--<i class="fa fa-pencil mt15 ml10 color_white edit_subject_name fl font-18"></i>-->
|
||||
<%# end %>
|
||||
<% if !User.current.manager_of_subject?(@subject) || @subject.status > 1 %>
|
||||
<ul class="last-all-count fr">
|
||||
<li class="fl mr30"><i class="fa fa-gamepad color_white" title="实训"></i><span class="ml5 color_white"><%= @subject.stage_shixuns.count %></span></li>
|
||||
<li class="fl mr30"><i class="fa fa-tasks color_white" title="实训阶段"></i><span class="ml5 color_white"><%= @subject.subject_challenges %></span></li>
|
||||
<li class="fl mr30"><i class="fa fa-viacoin color_white" title="实训总积分"></i><span class="ml5 color_white"><%= @subject.subject_score %></span></li>
|
||||
<%# if !User.current.manager_of_subject?(@subject) || @subject.status > 1 %>
|
||||
<ul class="fl mt5 color-light-grey-E">
|
||||
<li class="fl mr30"><i class="fa fa-pause-circle transform90" aria-hidden="true" data-tip-down="章节"></i><span class="ml5"><%= @subject.stages.count %> 章节</span></li>
|
||||
<li class="fl mr30"><i class="fa fa-gamepad fl mt5" title="实训"></i><span class="ml5"><%= @subject.stage_shixuns.count %> 实训</span></li>
|
||||
<li class="fl mr30">
|
||||
<i class="fa fa-th-list" title="选择题任务"></i>
|
||||
<span class="ml5"><%= @subject.subject_choices %> 选择题任务</span>
|
||||
</li>
|
||||
<li class="fl mr30">
|
||||
<i class="fa fa-code" style="font-weight: bold;" title="实践任务"></i>
|
||||
<span class="ml5"><%= @subject.subject_shixuns %> 实践任务</span>
|
||||
</li>
|
||||
<li class="fl mr30"><i class="fa fa-viacoin" title="经验值"></i><span class="ml5"><%= @subject.subject_score %> 经验值</span></li>
|
||||
</ul>
|
||||
<% elsif @subject.status == 0 && @subject.stages.count > 0 && User.current.manager_of_subject?(@subject) %>
|
||||
<% if @subject.status == 0 && @subject.stages.count > 0 && User.current.manager_of_subject?(@subject) %>
|
||||
<%= link_to '申请发布', publish_subject_path(@subject), :class => "course-btn fr", :remote => true %>
|
||||
<% elsif @subject.status == 1 && User.current.manager_of_subject?(@subject) %>
|
||||
<%= link_to '撤销申请', cancel_publish_subject_path(@subject), :class => "course-btn fr" %>
|
||||
|
|
@ -25,41 +37,3 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// //编辑套件名称
|
||||
// $(".edit_subject_name").on("click",function(){
|
||||
// $(".subject-main-name").attr("contenteditable","true");
|
||||
// $(".subject-main-name").focus();
|
||||
// getC($(".subject-main-name"));
|
||||
// });
|
||||
// $(".subject-main-name").on("keydown",function(ev){
|
||||
// if(ev.keyCode==13 || ev.keyCode==108){
|
||||
// $(".subject-main-name").attr("contenteditable","false");
|
||||
// }
|
||||
// });
|
||||
// $(".subject-main-name").on("blur",function(){
|
||||
// $(".subject-main-name").attr("contenteditable","false");
|
||||
// if($(".subject-main-name").html().trim() == ""){
|
||||
// $(".subject-main-name").html("<%= @subject.name %>");
|
||||
// } else{
|
||||
// $.post(
|
||||
// '<%= update_attr_subject_path(@subject) %>',
|
||||
// { name: $(".subject-main-name").html().trim() },
|
||||
// function (data) {
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// function getC(that){
|
||||
// if(document.all){
|
||||
// that.range=document.selection.createRange();
|
||||
// that.range.select();
|
||||
// that.range.moveStart("character",-1);
|
||||
// }else{
|
||||
// that.range=window.getSelection().getRangeAt(0);
|
||||
// that.range.setStart(that.range.startContainer,that.html().length);
|
||||
// }
|
||||
// }
|
||||
</script>
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<div class="active-class ">
|
||||
<p style="line-height: 42px;">
|
||||
<i class="fa fa-map-marker mr5 color-grey"></i>
|
||||
<%= 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() %>
|
||||
> <span>编辑</span>
|
||||
</p>
|
||||
<div class="edu-con-top user_bg_shadow">
|
||||
|
|
@ -15,9 +15,23 @@
|
|||
<div class="cl"></div>
|
||||
<span class="color-orange ml20 fl none" style="margin-left: 12%;" id="new_subject_name_notice"><i class="fa fa-exclamation-circle mr5" ></i>请输入名称</span>
|
||||
</li>
|
||||
<!--<li class="clearfix pt20">-->
|
||||
<!--<label class="panel-form-label label fl"><span class="color-orange">*</span> 描述</label>-->
|
||||
<!--<input type="text" name="subject[introduction]" value="<%#= @subject.introduction %>" id="new_subject_intro" class="task task-height-40 panel-box-sizing task-form-80 fl color-grey ml20" maxlength="50" placeholder="一句话描述一下,吸引更多人学习吧(不超过50个字符)">-->
|
||||
<!--<div class="cl"></div>-->
|
||||
<!--<span class="color-orange ml20 fl none" style="margin-left: 12%;" id="new_subject_intro_notice"><i class="fa fa-exclamation-circle mr5" ></i>请输入描述</span>-->
|
||||
<!--</li>-->
|
||||
<li class="clearfix pt20">
|
||||
<label class="panel-form-label label fl">简介</label>
|
||||
<textarea name="subject[description]" class="task task-height-220 panel-box-sizing task-form-70 fl color-grey ml20"><%= @subject.description %></textarea>
|
||||
<label class="panel-form-label label fl"><span class="color-orange">*</span> 简介</label>
|
||||
<textarea name="subject[description]" id="new_subject_description" class="task task-height-220 panel-box-sizing task-form-70 fl color-grey ml20"><%= @subject.description %></textarea>
|
||||
<div class="cl"></div>
|
||||
<span class="color-orange ml20 fl none" style="margin-left: 12%;" id="new_subject_description_notice"><i class="fa fa-exclamation-circle mr5" ></i>请输入简介</span>
|
||||
</li>
|
||||
<li class="clearfix pt20">
|
||||
<label class="panel-form-label label fl"><span class="color-orange">*</span> 学习须知</label>
|
||||
<textarea type="text" name="subject[learning_notes]" id="new_learning_notes" class="task task-height-220 panel-box-sizing task-form-70 fl color-grey ml20" placeholder=""><%= @subject.learning_notes %></textarea>
|
||||
<div class="cl"></div>
|
||||
<span class="color-orange ml20 fl none" style="margin-left: 12%;" id="new_learning_notes_notice"><i class="fa fa-exclamation-circle mr5" ></i>请输入学习须知</span>
|
||||
</li>
|
||||
<li class="clearfix pt20 pb20">
|
||||
<label class="panel-form-label label fl"> </label>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<div class="active-class ">
|
||||
<p style="line-height: 42px;">
|
||||
<i class="fa fa-map-marker mr5 color-grey"></i>
|
||||
<%= 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() %>
|
||||
> <span>新建</span>
|
||||
</p>
|
||||
<div class="edu-con-top user_bg_shadow">
|
||||
|
|
@ -11,17 +11,27 @@
|
|||
<%= labelled_form_for @subject do |f| %>
|
||||
<li class="clearfix pt20">
|
||||
<label class="panel-form-label label fl"><span class="color-orange">*</span> 名称</label>
|
||||
<input type="text" name="subject[name]" id="new_subject_name" class="task task-height-40 panel-box-sizing task-form-80 fl color-grey ml20" maxlength="100" placeholder="例如:Python程序设计-从入门到精通">
|
||||
<input type="text" name="subject[name]" id="new_subject_name" class="task task-height-40 panel-box-sizing task-form-80 fl color-grey ml20" maxlength="50" placeholder="例如:Python程序设计-从入门到精通">
|
||||
<div class="cl"></div>
|
||||
<span class="color-orange ml20 fl none" style="margin-left: 12%;" id="new_subject_name_notice"><i class="fa fa-exclamation-circle mr5" ></i>请输入名称</span>
|
||||
</li>
|
||||
<!--<li class="clearfix pt20">
|
||||
<label class="panel-form-label label fl"><span class="color-orange">*</span> 描述</label>
|
||||
<input type="text" name="subject[describe]" id="new_subject_name" class="task task-height-40 panel-box-sizing task-form-80 fl color-grey ml20" maxlength="100" placeholder="一句话描述一下,吸引更多人学习吧(不超过50个字符)">
|
||||
</li>-->
|
||||
<!--<li class="clearfix pt20">-->
|
||||
<!--<label class="panel-form-label label fl"><span class="color-orange">*</span> 描述</label>-->
|
||||
<!--<input type="text" name="subject[introduction]" id="new_subject_intro" class="task task-height-40 panel-box-sizing task-form-80 fl color-grey ml20" maxlength="50" placeholder="一句话描述一下,吸引更多人学习吧(不超过50个字符)">-->
|
||||
<!--<div class="cl"></div>-->
|
||||
<!--<span class="color-orange ml20 fl none" style="margin-left: 12%;" id="new_subject_intro_notice"><i class="fa fa-exclamation-circle mr5" ></i>请输入描述</span>-->
|
||||
<!--</li>-->
|
||||
<li class="clearfix pt20">
|
||||
<label class="panel-form-label label fl">简介</label>
|
||||
<textarea name="subject[description]" class="task task-height-220 panel-box-sizing task-form-80 fl color-grey ml20"></textarea>
|
||||
<textarea name="subject[description]" id="new_subject_description" class="task task-height-220 panel-box-sizing task-form-80 fl color-grey ml20"></textarea>
|
||||
<div class="cl"></div>
|
||||
<span class="color-orange ml20 fl none" style="margin-left: 12%;" id="new_subject_description_notice"><i class="fa fa-exclamation-circle mr5" ></i>请输入简介</span>
|
||||
</li>
|
||||
<li class="clearfix pt20">
|
||||
<label class="panel-form-label label fl"><span class="color-orange">*</span> 学习须知</label>
|
||||
<textarea type="text" name="subject[learning_notes]" id="new_learning_notes" class="task task-height-220 panel-box-sizing task-form-70 fl color-grey ml20" placeholder=""></textarea>
|
||||
<div class="cl"></div>
|
||||
<span class="color-orange ml20 fl none" style="margin-left: 12%;" id="new_learning_notes_notice"><i class="fa fa-exclamation-circle mr5" ></i>请输入学习须知</span>
|
||||
</li>
|
||||
<!--<li class="clearfix pt20">
|
||||
<label class="panel-form-label label fl"><span class="color-orange">*</span> 学习须知</label>
|
||||
|
|
|
|||
|
|
@ -1,93 +1,66 @@
|
|||
<div class="with75 fl">
|
||||
<!--简介-->
|
||||
<% if !@subject.description.blank? || (User.current.manager_of_subject?(@subject) && @subject.status == 0) %>
|
||||
<div class="mb20 produce-content">
|
||||
<% if !@subject.description.blank? || User.current.manager_of_subject?(@subject) %>
|
||||
<div class="pb20 produce-content bor-bottom-greyE">
|
||||
<p class="clearfix">
|
||||
<span class="fl font-bd font-18">简介</span>
|
||||
<% if User.current.manager_of_subject?(@subject) && @subject.status == 0 %>
|
||||
<a href="<%= edit_subject_path(@subject) %>"><i class="fa fa-pencil fr mt10 mr5 color-grey-c edit-produce"></i></a>
|
||||
<% if User.current.manager_of_subject?(@subject) %>
|
||||
<a href="<%= edit_subject_path(@subject) %>"><i class="fa fa-pencil fr mt10 mr5 color-grey-c edit-produce"data-tip-down="编辑"></i></a>
|
||||
<% end %>
|
||||
</p>
|
||||
<div class="mt10 color-grey <%= @subject.description.blank? ? 'color-light-grey' : '' %>">
|
||||
<%= @subject.description.blank? ? "暂未填写" : @subject.description %>
|
||||
<div class="mt10 color-dark-grey <%= @subject.description.blank? ? 'color-light-grey' : '' %>">
|
||||
<%= @subject.description.blank? ? "暂未填写" : "简介:"+@subject.description %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<script>
|
||||
// //编辑套件简介
|
||||
// $(".edit-produce").on("click",function(){
|
||||
// $(".subject-produce").removeAttr("disabled");
|
||||
// $("#subject-produce").focus();
|
||||
// });
|
||||
// $(".subject-produce").on("blur",function(){
|
||||
// $(".subject-produce").removeAttr("disabled");
|
||||
// $.post(
|
||||
// '<%#= update_attr_subject_path(@subject) %>',
|
||||
// { description: $("#subject-produce").val().trim() },
|
||||
// function (data) {
|
||||
// }
|
||||
// );
|
||||
// if($("#subject-produce").html().trim() == ""){
|
||||
// $("#subject-produce").addClass("color-light-grey");
|
||||
// } else{
|
||||
// $("#subject-produce").removeClass("color-light-grey");
|
||||
// }
|
||||
// })
|
||||
// function getC(that){
|
||||
// if(document.all){
|
||||
// that.range=document.selection.createRange();
|
||||
// that.range.select();
|
||||
// that.range.moveStart("character",-1);
|
||||
// }else{
|
||||
// that.range=window.getSelection().getRangeAt(0);
|
||||
// that.range.setStart(that.range.startContainer,that.html().length);
|
||||
// }
|
||||
// }
|
||||
</script>
|
||||
<!--新版阶段列表-->
|
||||
<div class="lesson-saved-list mb20">
|
||||
<% count = 0 %>
|
||||
<% @stages.each do |stage| %>
|
||||
<div class="lesson-saved-list-item user_bg_shadow pt20 mb20" id="stage_div_<%= stage.id %>">
|
||||
<p class="clearfix">
|
||||
<!--<i class="font-20 fa fa-dot-circle-o ml20 color-orange"></i>-->
|
||||
<span class="font-16 font-bd ml20"><%= stage.name %></span>
|
||||
<% @stages.each_with_index do |stage, s_index| %>
|
||||
<div class="lesson-saved-list-item pt10 pb10 bor-bottom-greyE" id="stage_div_<%= stage.id %>">
|
||||
<p class="clearfix title-line">
|
||||
<i class="fa fa-pause-circle color-light-green font-16 transform90"></i>
|
||||
<span class="font-16 font-bd">第<%= s_index + 1 %>章 <%= stage.name %></span>
|
||||
<% if @subject.status == 0 && User.current.manager_of_subject?(@subject) %>
|
||||
<a href="javascript:void(0);" onclick="edit_stage(<%= stage.id %>)"><i class="fa fa-pencil fr mt10 mr20 color-grey-c delete"></i></a>
|
||||
<a href="javascript:void(0);" onclick="delete_confirm_box_2('<%= stage_path(stage) %>', '确定要删除该阶段吗?');"><i class="fa fa-trash fr mt10 mr10 color-grey-c edit"></i></a>
|
||||
<a href="javascript:void(0);" class="fr" onclick="edit_stage(<%= stage.id %>)"><i class="fa fa-pencil mt8 color-grey-c edit" data-tip-down="编辑"></i></a>
|
||||
<a href="javascript:void(0);" class="fr" onclick="delete_confirm_box_2('<%= stage_path(stage) %>', '确定要删除该阶段吗?');"><i class="fa fa-trash mt8 mr10 color-grey-c delete" data-tip-down="删除"></i></a>
|
||||
<% else %>
|
||||
<a href="javascript:void(0);" onclick="for_paragraph(this)" class="fr"><i class="fa fa-sort-down mt8 color-grey-c"></i></a>
|
||||
<% end %>
|
||||
</p>
|
||||
<p class="ml20 color-grey pr20 mt10 mb10"><%= stage.description %></p>
|
||||
<div class="detail_for_paragraph clearfix">
|
||||
<p class="ml20 color-dark-grey mt10 mb10"><%= stage.description %></p>
|
||||
<% stage.stage_shixuns.each_with_index do |stage_shixun, index| %>
|
||||
<% shixun = stage_shixun.shixun %>
|
||||
<div class="clearfix pt10 pb10 pl20 stage-info-line pr20" id="stage_shixun_<%= shixun.id %>" style="cursor: pointer;" onclick="shixun_link('<%= shixun.identifier %>')">
|
||||
<div class="clearfix pt10 pb10 ml20 pl10 mb10 paragraph" id="stage_shixun_<%= shixun.id %>" style="cursor: pointer;" onclick="shixun_link('<%= shixun.identifier %>')">
|
||||
<li class="fl li-width63">
|
||||
<span class="panel-inner-icon18 fl mr10 mt5 color_white font-12"><%= count = count + 1 %></span>
|
||||
<!--<i class="fa fa-gamepad color-light-green font-20"></i>-->
|
||||
<span class="color-grey3"><%= shixun.name %></span>
|
||||
<i class="fa fa-sort-up color-grey-c fl mt5 mr10 transform90 font-18"></i>
|
||||
<span class="color-grey3 paragraph_name"><%= s_index + 1 %>-<%= index + 1 %> <%= shixun.name %></span>
|
||||
</li>
|
||||
<li class="fl li-width15">
|
||||
<i class="fa fa-tasks color-light-green font-16 mr5" title="实训任务"></i>
|
||||
<span class="color-grey"><%= shixun.challenges.count %></span>
|
||||
</li>
|
||||
<li class="fl li-width15">
|
||||
<i class="fa fa-viacoin color-light-green mr5" title="经验值"></i><span class="mr5 color-grey"><%= shixun.shixun_score %></span></li>
|
||||
<li class="fl li-width7">
|
||||
<% if @subject.status == 0 && User.current.manager_of_subject?(@subject) %>
|
||||
<span class="color-grey"><%= shixun.shixun_status %></span>
|
||||
<span class="none ml10"><i class="fa fa-exclamation-circle color-red ml5 mr5"></i></span>
|
||||
<li class="fr mr20 status_li">
|
||||
<% if @subject.status < 2 %>
|
||||
<span class="color-grey paragraph_status"><%= shixun.shixun_status %></span>
|
||||
<% else %>
|
||||
<% case my_shixun_status(shixun, User.current) %>
|
||||
<% when '已通关' %>
|
||||
<i class="fa fa-check-circle color-light-green font-18 mr5" title="已通关"></i>
|
||||
<span class="status_sx">已通关</span> <i class="fr fa fa-check-circle color-light-green font-18 mr5 mt5" title="已通关"></i>
|
||||
<% when '未通关' %>
|
||||
<i class="fa fa-pause-circle color-orange font-18 mr5" title="未通关"></i>
|
||||
<span class="status_sx">未通关</span> <i class="fr fa fa-play-circle color-light-green font-18 mr5 mt5" title="未通关"></i>
|
||||
<% when '未开启' %>
|
||||
<i class="fa fa-play-circle color-grey font-18 mr5" title="未开启"></i>
|
||||
<span class="status_sx">未开启</span> <i class="fr fa fa-play-circle color-grey-c font-18 mr5 mt5" title="未开启"></i>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if shixun.status > 1 %>
|
||||
<% myshixun = Myshixun.where(:user_id => User.current.id, :shixun_id => shixun.id).first %>
|
||||
<% if myshixun.blank? %>
|
||||
<%= link_to "开始实战", operation_shixun_path(shixun, :myshixun_id => myshixun.try(:id)), :class => "task-btn task-btn-orange ", :style=>"display: none", :id => "shixun_operation", :remote => true %>
|
||||
<% else %>
|
||||
<%= link_to "继续实战", operation_shixun_path(shixun, :myshixun_id => myshixun.try(:id)), :class => "task-btn task-btn-orange", :style=>"display: none", :id => "shixun_operation", :remote => true %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</li>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
@ -133,7 +106,32 @@
|
|||
+点击新建阶段(选择1至多个实训项目,组成一个阶段)
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<div class="with25 fr">
|
||||
<div class="edu-class-right-box ml15 mb20 user_bg_shadow bor-grey-e pl15 pt15 pr15">
|
||||
<p class="font-16">学习须知
|
||||
<% if User.current.manager_of_subject?(@subject) %>
|
||||
<a href="<%= edit_subject_path(@subject) %>"><i class="fa fa-pencil fr mt10 mr5 color-grey-c edit-produce font-12"data-tip-down="编辑"></i></a>
|
||||
<% end %>
|
||||
</p>
|
||||
<p class="mt10 mb10 color-dark-grey"><%= @subject.learning_notes.blank? ? "暂未填写" : @subject.learning_notes %></p>
|
||||
</div>
|
||||
<div class="edu-class-right-box ml15 user_bg_shadow bor-grey-e pl15 pt15 pr15">
|
||||
<p class="font-16">教学名师
|
||||
<% if User.current == @subject.user %>
|
||||
<i class="fa fa-pencil fr mt10 mr5 color-grey-c edit-produce font-12"data-tip-down="编辑" onclick="edit_produce();"></i>
|
||||
<% end %>
|
||||
</p>
|
||||
<div style="text-align: center" class="bor-bottom-greyE mb10">
|
||||
<p style="line-height: 15px"><%= image_tag(url_to_avatar(@subject.user), :width =>"40", :height => "40", :class => "bor-radius-all", :alt=>"头像") %></p>
|
||||
<p style="line-height: 15px"><%= @subject.user.try(:show_name) %></p>
|
||||
<p style="line-height: 27px" class="color-dark-grey font-12"><%= @subject.user.school_name + @subject.user.identity %></p>
|
||||
</div>
|
||||
<p class="mb10 color-dark-grey produce"><%= @subject.user.user_extensions.brief_introduction.blank? ? "暂未填写" : @subject.user.user_extensions.brief_introduction %></p>
|
||||
<textarea id="user_produce_text" class="mb10 with100 panel-box-sizing produce_text undis" style="min-height: 100px;"></textarea>
|
||||
<input id="current_user_id" value="<%= User.current.id %>" type="hidden">
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var flag = true;
|
||||
$(function() {
|
||||
|
|
@ -158,7 +156,39 @@
|
|||
$("#stage_name_notice").hide();
|
||||
}
|
||||
});
|
||||
|
||||
$(".paragraph").hover(function(){
|
||||
if($(this).find(".status_li a").length>0){
|
||||
$(this).find(".status_li a").show();
|
||||
$(this).find(".status_li span").hide();
|
||||
}
|
||||
},function(){
|
||||
$(this).find(".status_li a").hide();
|
||||
$(this).find(".status_li span").show();
|
||||
})
|
||||
|
||||
$("#user_produce_text").blur(function(){
|
||||
if($(this).val() != $(this).siblings(".produce").html()){
|
||||
$.post(
|
||||
'/users/' + $("#current_user_id").val() + '/edit_brief_introduction',
|
||||
{ brief_introduction: $(this).val() },
|
||||
function (data) {
|
||||
}
|
||||
);
|
||||
}
|
||||
$(this).siblings(".produce").show();
|
||||
$(this).siblings(".produce").html($("#user_produce_text").val());
|
||||
$(this).hide();
|
||||
})
|
||||
});
|
||||
|
||||
function edit_produce(){
|
||||
$(".produce").hide();
|
||||
$(".produce_text").show();
|
||||
$(".produce_text").val($(".produce").html());
|
||||
$(".produce_text").focus();
|
||||
}
|
||||
|
||||
//编辑列表里右上角的删除icon,删除单个实训
|
||||
function deleidtstageitem(item){
|
||||
$(item).parent(".task-index-list-box-all").remove();
|
||||
|
|
@ -248,4 +278,9 @@
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
//缩放章节实训
|
||||
function for_paragraph(item){
|
||||
$(item).parent("p").siblings(".detail_for_paragraph").slideToggle(500);
|
||||
}
|
||||
</script>
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
</li>
|
||||
<% if @is_syllabus_admin %>
|
||||
<li class="fr">
|
||||
<a href="<%= edit_syllabus_path(@syllabus) %>" class="font-24 font-bold link-color-grey fl">
|
||||
<a href="<%= edit_syllabus_path(@syllabus) %>" class="font-24 font-bold color-grey fl">
|
||||
<i class="fa fa-edit ml15 " aria-hidden="true" data-tip-down="编辑"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
<div class="edu-tab clearfix mb20 user_bg_shadow">
|
||||
<ul id="edu-tab-nav" class="back-orange-01 bor-radius-upper">
|
||||
<p class="fl ml15 font-16 color_white" style="line-height: 47px;">授课大纲</p>
|
||||
<a href="javascript:void(0);" style="line-height: 47px;" id="edit_sy_des" class="fr font-16 mr15" data-tip-down="编辑"><i class="fa fa-edit color_white"></i></a>
|
||||
<a href="javascript:void(0);" style="line-height: 47px;" id="edit_sy_des" class="fr font-16 mr15"><i class="fa fa-edit color_white" data-tip-down="编辑"></i></a>
|
||||
<a href="javascript:void(0)" style="line-height: 47px;" id="save_sy_des" class="color_white font-16 fr mr15 undis" data-tip-down="保存"><i class="fa fa-floppy-o"></i></a>
|
||||
<a href="javascript:void(0)" style="line-height: 47px;" id="cancel_edit_sy_des" class="color_white font-16 fr mr15 undis" data-tip-down="取消"><i class="fa fa-undo"></i></a>
|
||||
<!--<li id="edu-tab-nav-1" class="new-tab-nav" onclick="HoverLi(1);">
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
if Rails.env.development?
|
||||
Rack::MiniProfiler.config.position = 'right'
|
||||
Rack::MiniProfiler.config.start_hidden = false
|
||||
Rack::MiniProfiler.config.start_hidden = true
|
||||
end
|
||||
|
|
@ -165,6 +165,12 @@ RedmineApp::Application.routes.draw do
|
|||
|
||||
resources :managements do
|
||||
collection do
|
||||
get 'mirror_repository'
|
||||
post 'add_mirror_type'
|
||||
get 'modify_mirror'
|
||||
post 'search_mirror_type'
|
||||
post 'update_mirror'
|
||||
delete 'delete_mirror'
|
||||
match 'applicable_course',:via=>[:get,:post]
|
||||
match 'profession',:via=>[:get,:post]
|
||||
match 'shixuns', :via => [:get, :post]
|
||||
|
|
@ -203,6 +209,7 @@ RedmineApp::Application.routes.draw do
|
|||
get 'update_subject_hidden'
|
||||
post 'course_homepage_show'
|
||||
post 'shixun_homepage_show'
|
||||
post 'support_shixun'
|
||||
post 'add_course'
|
||||
match 'add_major',:via=>[:get,:post]
|
||||
match 'approve_applied_schools',:via=>[:get,:post]
|
||||
|
|
@ -213,6 +220,8 @@ RedmineApp::Application.routes.draw do
|
|||
match 'approve_applied_departments',:via=>[:get,:post]
|
||||
delete 'delete_applied_departments'
|
||||
delete 'delete_applied_schools'
|
||||
match 'new_major', :via => [:get, :post]
|
||||
post 'insert_major'
|
||||
end
|
||||
end
|
||||
# Enable Grack support
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
class CreateMirrorTypes < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :mirror_types do |t|
|
||||
t.string :name
|
||||
t.references :user
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
class CreateMirrorRepositories < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :mirror_repositories do |t|
|
||||
t.string :mirrorID
|
||||
t.string :name
|
||||
t.string :main_type
|
||||
t.string :tag
|
||||
t.text :description
|
||||
t.integer :status
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
class CreateMirrorRepositoryTypes < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :mirror_repository_types do |t|
|
||||
t.references :mirror_type
|
||||
t.references :mirror_repository
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
add_index :mirror_repository_types, :mirror_type_id
|
||||
add_index :mirror_repository_types, :mirror_repository_id
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
class CreateMirrorUpdateRecords < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :mirror_update_records do |t|
|
||||
t.references :user
|
||||
t.references :mirror_repository
|
||||
t.string :oldName
|
||||
t.string :newName
|
||||
t.string :oldType
|
||||
t.string :newType
|
||||
t.text :oldTag
|
||||
t.text :newTag
|
||||
t.text :oldDescription
|
||||
t.text :newDescription
|
||||
t.integer :oldStatus
|
||||
t.integer :newStatus
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
add_index :mirror_update_records, :user_id
|
||||
add_index :mirror_update_records, :mirror_repository_id
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
class AddLearningNotesToSubjects < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :subjects, :learning_notes, :text
|
||||
add_column :subjects, :introduction, :string
|
||||
end
|
||||
end
|
||||
|
|
@ -157,7 +157,7 @@
|
|||
tocDropdown : false,
|
||||
tocContainer : "",
|
||||
tocStartLevel : 1, // Said from H1 to create ToC
|
||||
htmlDecode : false, // Open the HTML tag identification
|
||||
htmlDecode : "style,iframe|on*", // Open the HTML tag identification
|
||||
pageBreak : true, // Enable parse page break [========]
|
||||
atLink : true, // for @link
|
||||
emailLink : true, // for email address auto link
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ $(function(){
|
|||
});
|
||||
|
||||
//下拉框
|
||||
$("[select-for]").append("<i class='fa fa-sort-desc lesson_img'></i>");
|
||||
$("[select-for]").append("<i class='fa fa-sort-desc lesson_img color-grey'></i>");
|
||||
$("[select-for]").hover(function(){
|
||||
$(this).find(".down-select").show();
|
||||
},function(){
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
$(function(){
|
||||
$("#major_level_option p").bind("click", function(){
|
||||
$("#major_level_option p").live("click", function(){
|
||||
$("#major_level").val($(this).attr("data-major"));
|
||||
$.ajax({
|
||||
url: '/syllabuses/get_discipline_categories',
|
||||
|
|
@ -28,7 +28,7 @@ $(function(){
|
|||
});
|
||||
});
|
||||
|
||||
$("#discipline_category_option").on("click", "p", function(){
|
||||
$("#discipline_category_option p").live("click", function(){
|
||||
$(this).parents().prev("input").val($(this).html().trim());
|
||||
$(this).parents(".down-select").hide();
|
||||
$("#discipline_category_id").val($(this).attr("data-discipline-category-id"));
|
||||
|
|
@ -56,7 +56,7 @@ $(function(){
|
|||
});
|
||||
});
|
||||
|
||||
$("#first_level_discipline_option").on("click", "p", function(){
|
||||
$("#first_level_discipline_option p").live("click", function(){
|
||||
$(this).parents().prev("input").val($(this).html().trim());
|
||||
$(this).parents(".down-select").hide();
|
||||
$("#first_level_discipline_id").val($(this).attr("data-first-level-discipline-id"));
|
||||
|
|
@ -81,7 +81,7 @@ $(function(){
|
|||
});
|
||||
});
|
||||
|
||||
$("#syllabus_major_option").on("click", "p", function(){
|
||||
$("#syllabus_major_option p").live("click", function(){
|
||||
$(this).parents().prev("input").val($(this).html().trim());
|
||||
$(this).parents(".down-select").hide();
|
||||
$("#major_id").val($(this).attr("data-major_id"));
|
||||
|
|
@ -90,7 +90,7 @@ $(function(){
|
|||
}
|
||||
});
|
||||
|
||||
$("#syllabus_type_option p").bind("click", function(){
|
||||
$("#syllabus_type_option p").live("click", function(){
|
||||
$("#syllabus_type").val($(this).attr("data-syllabus-type"));
|
||||
})
|
||||
|
||||
|
|
@ -1023,19 +1023,51 @@ function destroy_all_hb(url){
|
|||
}
|
||||
|
||||
function submit_new_subject(){
|
||||
var check = true;
|
||||
if($("#new_subject_name").val().trim() == ""){
|
||||
check = false;
|
||||
$("#new_subject_name_notice").show();
|
||||
} else{
|
||||
$("#new_subject_name_notice").hide();
|
||||
}
|
||||
if($("#new_subject_description").val().trim() == ""){
|
||||
check = false;
|
||||
$("#new_subject_description_notice").show();
|
||||
} else{
|
||||
$("#new_subject_description_notice").hide();
|
||||
}
|
||||
if($("#new_learning_notes").val().trim() == ""){
|
||||
check = false;
|
||||
$("#new_learning_notes_notice").show();
|
||||
} else {
|
||||
$("#new_learning_notes_notice").hide();
|
||||
}
|
||||
if(check){
|
||||
$("#new_subject").submit();
|
||||
}
|
||||
}
|
||||
|
||||
function submit_edit_subject(id){
|
||||
var check = true;
|
||||
if($("#new_subject_name").val().trim() == ""){
|
||||
check = false;
|
||||
$("#new_subject_name_notice").show();
|
||||
} else{
|
||||
$("#new_subject_name_notice").hide();
|
||||
}
|
||||
if($("#new_subject_description").val().trim() == ""){
|
||||
check = false;
|
||||
$("#new_subject_description_notice").show();
|
||||
} else{
|
||||
$("#new_subject_description_notice").hide();
|
||||
}
|
||||
if($("#new_learning_notes").val().trim() == ""){
|
||||
check = false;
|
||||
$("#new_learning_notes_notice").show();
|
||||
} else {
|
||||
$("#new_learning_notes_notice").hide();
|
||||
}
|
||||
if(check){
|
||||
$("#edit_subject_"+id).submit();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +1,3 @@
|
|||
$(function() {
|
||||
$("#search_not_collaborators").on('input', function (e) {
|
||||
throttle(search_not_teacher_f, window, e);
|
||||
});
|
||||
});
|
||||
|
||||
var lastteSearchCondition = '';
|
||||
function search_not_teacher_f(e){
|
||||
console.log($(e.target).val().trim());
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ a.color-orange05:hover,i.color-orange05:hover{color:#ff7500!important;}
|
|||
|
||||
.color-light-grey{color:#afafaf!important;}
|
||||
.color-grey{color:#888!important;}
|
||||
a.color-grey:hover{color: #FF7500!important;}/*a标签,移入变橙色*/
|
||||
.color-dark-grey{color:#666!important;}
|
||||
.color-grey3{color:#333!important;}
|
||||
.u-color-light-grey{color: #CCCCCC}
|
||||
|
|
@ -117,7 +118,7 @@ a:hover.task-btn {background: #c3c3c3; color: #666;}
|
|||
a.task-btn-green{background: #29bd8b; color: #fff!important;}
|
||||
a:hover.task-btn-green{background: #19b17e;}
|
||||
a.task-btn-orange{ background:#fc8675; color:#fff !important;}
|
||||
a:hover.task-btn-orange{ background:#e27869;}
|
||||
a:hover.task-btn-orange{ background:#fc8675;}
|
||||
a.task-btn-blue{background: #3498db; color:#fff!important;}
|
||||
a:hover.task-btn-blue{background: #5faee3;color:#fff;}
|
||||
a.task-btn-grey{background-color: #d4d6d8; color: #4d555d!important;}
|
||||
|
|
@ -388,10 +389,11 @@ input::-ms-clear{display:none;}
|
|||
|
||||
.background-blue a{color:#ffffff!important;}
|
||||
.background-orange a{color: #ffffff!important;}
|
||||
/*---------------tab公用下边框-----------------*/
|
||||
/*---------------tab公用边框-----------------*/
|
||||
.border-bottom-orange{border-bottom: 2px solid #FC7033!important;}
|
||||
.bor-bottom-orange{border-bottom: 1px solid #FF9e6a!important;}
|
||||
.bor-bottom-greyE{border-bottom: 1px solid #EEEEEE!important;}
|
||||
.bor-top-greyE{border-top: 1px solid #EEEEEE!important;}
|
||||
/*---------------边框-----------------*/
|
||||
.bor-gray-c{border:1px solid #ccc;}
|
||||
.bor-grey-e{border:1px solid #eee;}
|
||||
|
|
@ -411,19 +413,19 @@ input::-ms-clear{display:none;}
|
|||
tip字体的颜色和阴影的设置在第2行。
|
||||
*/
|
||||
.-task-title{opacity:0;position:absolute;left:0;top:0;display:none;z-index:9999;} /*1*/
|
||||
.data-tip-down,.data-tip-left,.data-tip-right{ position:relative; box-shadow:0px 0px 8px #fff; background:#000; color:#fff; max-width:300px;/*2*/
|
||||
word-wrap: break-word; text-align:center; border-radius:4px; padding:0 10px; border:1px solid #ccc; display:none; }/*3*/
|
||||
.data-tip-down,.data-tip-left,.data-tip-right{ position:relative; box-shadow:0px 0px 8px #000; background:#000; color:#fff; max-width:300px;/*2*/
|
||||
word-wrap: break-word; text-align:center; border-radius:4px; padding:0 10px; border:1px solid #000; display:none; }/*3*/
|
||||
.data-tip-down:after,.data-tip-down:before,.data-tip-left:before,.data-tip-right:before,.data-tip-left:after,.data-tip-right:after{/*4*/
|
||||
position: absolute;content:''; width:0; height:0;}/*5*/
|
||||
.data-tip-down:after,.data-tip-down:before{left: 45%;top:-10px;/*6*/
|
||||
border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 10px solid #000; }/*7*/
|
||||
.data-tip-down:before{top:-11px;border-bottom:10px solid #ccc;}/*8*/
|
||||
.data-tip-down:before{top:-11px;border-bottom:10px solid #000;}/*8*/
|
||||
.data-tip-left:after,.data-tip-left:before{left: -10px;top:50%; margin-top:-5px;/*9*/
|
||||
border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-right: 10px solid #000; }/*10*/
|
||||
.data-tip-left:before{ left: -12px;border-right: 10px solid #ccc; }/*11*/
|
||||
.data-tip-left:before{ left: -12px;border-right: 10px solid #000; }/*11*/
|
||||
.data-tip-right:after,.data-tip-right:before{right: -10px; top:50%; margin-top:-5px;/*12*/
|
||||
border-top: 5px solid transparent;border-bottom: 5px solid transparent; border-left: 10px solid #000; }/*13*/
|
||||
.data-tip-right:before{ right: -12px;border-left: 10px solid #ccc; }/*14*/
|
||||
.data-tip-right:before{ right: -12px;border-left: 10px solid #000; }/*14*/
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
/*------课程实训首页---------*/
|
||||
/*background: linear-gradient(to right, rgb(68, 190, 164) 0%, rgb(62, 158, 207) 100%);*/
|
||||
.header-color{padding: 30px;background-image: url("../images/subject.jpg");background-size: 100%;}
|
||||
.header-color{padding: 30px;background:linear-gradient(to right, rgb(68, 190, 164) 0%, rgb(62, 158, 207) 100%);}
|
||||
/*linear-gradient(to right, rgb(68, 190, 164) 0%, rgb(62, 158, 207) 100%)*/
|
||||
|
||||
.box_bg_shandow{box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15);}
|
||||
.active-class .content .pre_sub-con{width:23.69%;margin: 0 1.5% 2% 0px;height: 264px;box-shadow: 0 5px 15px 0 rgba(0, 0, 0, 0.15);}
|
||||
.active-class .content .pre_sub-con:nth-child(4n+0){margin:0 0 2% 0;}
|
||||
.active-class .content .pre_sub-con{width:23.87%;margin: 0 1.5% 2.55% 0px;height: 269px;}
|
||||
.active-class .content .pre_sub-con:nth-child(4n+0){margin:0 0 2.55% 0;}
|
||||
.active-class .content .pre_sub-con:hover{cursor: pointer;-webkit-animation: bounce-down 1s linear 1;animation: bounce-down 1s linear 1;}
|
||||
.pre-book{height: 100%;position:absolute;}
|
||||
.subject-box{padding: 20px;background: #fff;text-align: center;position: relative;}
|
||||
.unit-name{line-height: 15px;overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;height: 30px; word-wrap: break-word;}
|
||||
.unit-name{line-height: 17px;overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;height: 32px; word-wrap: break-word;}
|
||||
|
||||
.active-class .content .sub-con{width:23.69%;border:1px solid #eee;background:#fff;margin: 0 1.5% 1.5% 0px;box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15);}
|
||||
.active-class .content .sub-con:nth-child(4n+0){margin:0 0 1.5% 0;}
|
||||
|
|
@ -37,14 +37,18 @@
|
|||
.subject-main-name{outline: none;background: none;border: none;width: auto;height: 45px}
|
||||
.subject-produce{outline: none;line-height: 1.5;width: 100%;border: none;background: none;height: 30px;}
|
||||
.stage-info-line:hover{background-color:rgba(142,212,254,0.3)}
|
||||
.lesson-saved-list-item{border:1px solid #EEEEEE}
|
||||
.lesson-saved-list-item:hover .edit{color:#29bd8b!important;}
|
||||
.lesson-saved-list-item:hover .delete{color:#29bd8b!important;}
|
||||
.lesson-saved-list-item{background-color: #FFFFFF}
|
||||
.lesson-saved-list-item .title-line:hover .edit,.lesson-saved-list-item .title-line:hover .delete{color:#29bd8b!important;}
|
||||
li.li-width63{width: 63%;text-align: left}
|
||||
li.li-width20{width: 20%;text-align: left}
|
||||
li.li-width15{width: 15%;text-align: left}
|
||||
li.li-width7{width: 7%;text-align: left}
|
||||
.lesson-saved-list-item{background-color: #FFFFFF}
|
||||
|
||||
|
||||
.paragraph{background-color:#f3f5f7;height: 30px;}
|
||||
.paragraph:hover{background-color:#a6aaab;}
|
||||
.paragraph:hover .paragraph_status,.paragraph:hover .paragraph_name{color: #ffffff!important;}
|
||||
.edu-class-right-box i:hover{color:#29bd8b!important;}
|
||||
/*------课程实训首页---------*/
|
||||
|
||||
.course_tip_box{width: 460px;padding: 10px;background-color: #FFFFFF;}
|
||||
|
|
@ -52,7 +56,8 @@ li.li-width7{width: 7%;text-align: left}
|
|||
.course_tip_box_Item li{float: left;width: auto;padding: 5px 10px;border-radius: 4px;border: 1px solid #2292e7;margin:0px 10px 10px 0px;}
|
||||
.tip_acitve{color: #FFFFFF;background-color: #2292e7;}
|
||||
|
||||
.subhead{width: 100%;background: #16D4BE linear-gradient(304.95deg,#1aecd4 0%, #1ad8c2 50%, #009E8A 77%, #16D4BE 100%);margin-bottom:20px;}
|
||||
/*background: #16D4BE linear-gradient(304.95deg,#1aecd4 0%, #1ad8c2 50%, #009E8A 77%, #16D4BE 100%);background-image: url("../images/services-banner.jpg");*/
|
||||
.subhead{width: 100%;margin-bottom:20px;background-size: 100% 100%;min-height: 180px;background: #16D4BE linear-gradient(304.95deg,#009E8A 0%, #1ad8c2 50%, #16D4BE 77%, #009E8A 100%);}
|
||||
.subhead_content{width: 1200px;margin: 0px auto;padding: 20px 0px;}
|
||||
.publich-half{width: 1200px;margin: 0px auto; min-height:566px}
|
||||
.saved-title{margin-bottom: 10px;}
|
||||
|
|
@ -76,9 +81,9 @@ li.li-width7{width: 7%;text-align: left}
|
|||
|
||||
/*编辑部分的列表不用加浮动效果*/
|
||||
|
||||
.task-index-list-box-all{ width:23.7%;margin: 6px; border-radius:2px; border:1px solid #eee; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15); color:#666; position:relative; }
|
||||
|
||||
/*.task-index-list-box-all{ width:23.7%;margin: 6px; border-radius:2px; border:1px solid #eee; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15); color:#666; position:relative; }*/
|
||||
|
||||
.task-index-list-box-all{ width:31.6%;margin: 6px; border-radius:2px; border:1px solid #eee; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15); color:#666; position:relative; }
|
||||
|
||||
.allback{background-color:#FFFFFF}
|
||||
.last-all-count{text-align: right;}
|
||||
|
|
@ -87,3 +92,31 @@ li.li-width7{width: 7%;text-align: left}
|
|||
.magic-radio + label:before, .magic-checkbox + label:before{top: 11px;left: 5px;}
|
||||
.magic-checkbox + label:after{top: 11px;left: 11px;}
|
||||
|
||||
|
||||
.rotate{
|
||||
transform-origin:center center; //旋转中心要是正中间 才行
|
||||
transform: rotate(180deg);
|
||||
-webkit-transform: rotate(180deg);
|
||||
-moz-transform: rotate(180deg);
|
||||
-ms-transform: rotate(180deg);
|
||||
-o-transform: rotate(180deg);
|
||||
transition: transform 0.2s; //过度时间 可调
|
||||
-moz-transition: -moz-transform 0.2s;
|
||||
-moz-transition: -moz-transform 0.2s;
|
||||
-o-transition: -o-transform 0.2s;
|
||||
-ms-transition: -ms-transform 0.2s;
|
||||
}
|
||||
|
||||
.rotate1{
|
||||
transform-origin:center center;
|
||||
transform: rotate(0deg); //返回原点
|
||||
-webkit-transform: rotate(0deg);
|
||||
-moz-transform: rotate(deg);
|
||||
-ms-transform: rotate(0deg);
|
||||
-o-transform: rotate(0deg);
|
||||
transition: transform 0.2s;
|
||||
-moz-transition: -moz-transform 0.2s;
|
||||
-moz-transition: -moz-transform 0.2s;
|
||||
-o-transition: -o-transform 0.2s;
|
||||
-ms-transition: -ms-transform 0.2s;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -225,11 +225,11 @@ input.knowledge_frame{height:28px;line-height:28px;border:none;background:#f3f5f
|
|||
.task-index-head{ box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15); }
|
||||
/*.task-index-head-top{background-image: linear-gradient(to right, rgb(106, 177, 216) 0%, rgb(1, 74, 78) 100%);background-color: rgb(1, 70, 74); padding:30px;}*/
|
||||
|
||||
/*background-color: rgb(1, 70, 74);background: linear-gradient(to right, rgb(104, 177, 215) 0%, rgb(1,75,79) 100%);*/
|
||||
.task-index-head-top{background-image: url(../images/shixun.jpg);background-size:100% 100%; padding:30px;}
|
||||
.task-index-head-top-course{background-image: url("../images/course.jpg");padding:30px;background-size: 100% 100%;}
|
||||
/*background: linear-gradient(to right, rgb(69, 191, 165) 0%, rgb(164, 175, 247) 100%);background-color:rgb(160, 175, 247);*/
|
||||
|
||||
/*background: linear-gradient(to right, rgb(104, 177, 215) 0%, rgb(1,75,79) 100%);*/
|
||||
/*background: linear-gradient(to right,#5DDAE4,#23ADC9);*/
|
||||
.task-index-head-top{ padding:30px;background:#FCA24B;background: linear-gradient(to right, rgb(104, 177, 215) 0%, rgb(1,75,79) 100%);}
|
||||
.task-index-head-top-course{padding:30px;background:linear-gradient(to right, rgb(69, 191, 165) 0%, rgb(164, 175, 247) 100%);}
|
||||
/*linear-gradient(to right, rgb(69, 191, 165) 0%, rgb(164, 175, 247) 100%);*/
|
||||
.task-inde-head-title{ color:#fff; }
|
||||
.task-index-head-info{ background:#fff; padding:10px 30px;}
|
||||
.task-index-head-info li{ width:100px; float: left; text-align: center; color:#666;}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
FactoryGirl.define do
|
||||
factory :mirror_repository do
|
||||
mirrorID "MyString"
|
||||
name "MyString"
|
||||
tag "MyText"
|
||||
description "MyText"
|
||||
status 1
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
FactoryGirl.define do
|
||||
factory :mirror_repository_type do
|
||||
mirror_type nil
|
||||
mirror_repository nil
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
FactoryGirl.define do
|
||||
factory :mirror_type do
|
||||
name "MyString"
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
FactoryGirl.define do
|
||||
factory :mirror_update_record do
|
||||
user nil
|
||||
oldName "MyString"
|
||||
newName "MyString"
|
||||
oldType "MyString"
|
||||
newType "MyString"
|
||||
oldTag "MyText"
|
||||
newTag "MyText"
|
||||
oldDescription "MyText"
|
||||
newDescription "MyText"
|
||||
oldStatus 1
|
||||
newStatus 1
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe MirrorRepository, :type => :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe MirrorRepositoryType, :type => :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe MirrorType, :type => :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe MirrorUpdateRecord, :type => :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
Loading…
Reference in New Issue