Merge branch 'develop' into dev_partners

dev_local
jasder 6 years ago
commit 57fb324875

@ -1677,7 +1677,8 @@ class StudentWorkController < ApplicationController
def student_work_project def student_work_project
project = Project.where(:id => params[:projectName].to_i).first project = Project.where(:id => params[:projectName].to_i).first
if project.present? if project.present?
@work = @homework.student_works.where("user_id = #{User.current.id} and work_status = 0").first @work = @homework.student_works.where("user_id = #{User.current.id} and work_status = 0").first ||
StudentWork.create(homework_common_id: @homework.id, user_id: User.current.id)
if @work if @work
@work.update_column('project_id', params[:projectName].to_i) @work.update_column('project_id', params[:projectName].to_i)
end end

@ -6922,148 +6922,154 @@ def quote_resource_bank resource, course
end end
def quote_homework_bank homework, course def quote_homework_bank homework, course
new_homework = HomeworkCommon.new(:name => homework.name, :user_id => User.current.id, :description => homework.description, :homework_type => homework.homework_type, :late_penalty => 5, ActiveRecord::Base.transaction do
:course_id => course.id, :teacher_priority => 1, :anonymous_comment => 1, :quotes => 0, :is_open => 0, :homework_bank_id => homework.id, :score_open => 1, new_homework = HomeworkCommon.new(:name => homework.name, :user_id => User.current.id, :description => homework.description, :homework_type => homework.homework_type, :late_penalty => 5,
:anonymous_appeal => 0, :is_public => 0, :reference_answer => homework.reference_answer, :answer_public => 1, :allow_late => 1) :course_id => course.id, :teacher_priority => 1, :anonymous_comment => 1, :quotes => 0, :is_open => 0, :homework_bank_id => homework.id, :score_open => 1,
:anonymous_appeal => 0, :is_public => 0, :reference_answer => homework.reference_answer, :answer_public => 1, :allow_late => 1)
new_homework.homework_detail_manual = HomeworkDetailManual.new
new_homework_detail_manual = new_homework.homework_detail_manual new_homework.homework_detail_manual = HomeworkDetailManual.new
new_homework_detail_manual.te_proportion = 1.0 new_homework_detail_manual = new_homework.homework_detail_manual
new_homework_detail_manual.ta_proportion = 0 new_homework_detail_manual.te_proportion = 1.0
new_homework_detail_manual.comment_status = 0 new_homework_detail_manual.ta_proportion = 0
new_homework_detail_manual.comment_status = 0
new_homework_detail_manual.evaluation_num = 0
new_homework_detail_manual.absence_penalty = 0 new_homework_detail_manual.evaluation_num = 0
new_homework_detail_manual.absence_penalty = 0
if new_homework.homework_type == 2
new_homework.homework_detail_programing = HomeworkDetailPrograming.new if new_homework.homework_type == 2
new_homework.homework_detail_programing.ta_proportion = 0 new_homework.homework_detail_programing = HomeworkDetailPrograming.new
new_homework.homework_detail_programing.language = homework.language new_homework.homework_detail_programing.ta_proportion = 0
homework.homework_bank_tests.each_with_index do |homework_test| new_homework.homework_detail_programing.language = homework.language
new_homework.homework_tests << HomeworkTest.new( homework.homework_bank_tests.each_with_index do |homework_test|
input: homework_test.input, new_homework.homework_tests << HomeworkTest.new(
output: homework_test.output input: homework_test.input,
) output: homework_test.output
)
end
homework.homework_bank_samples.each_with_index do |homework_test|
new_homework.homework_samples << HomeworkSample.new(
input: homework_test.input,
output: homework_test.output
)
end
end end
homework.homework_bank_samples.each_with_index do |homework_test|
new_homework.homework_samples << HomeworkSample.new( if new_homework.homework_type == 3
input: homework_test.input, new_homework.homework_detail_group = HomeworkDetailGroup.new
output: homework_test.output new_homework.homework_detail_group.min_num = homework.min_num
) new_homework.homework_detail_group.max_num = homework.max_num
new_homework.homework_detail_group.base_on_project = homework.base_on_project
end end
end
if new_homework.homework_type == 3 homework.attachments.each do |attachment|
new_homework.homework_detail_group = HomeworkDetailGroup.new att = attachment.copy
new_homework.homework_detail_group.min_num = homework.min_num att.container_id = nil
new_homework.homework_detail_group.max_num = homework.max_num att.container_type = nil
new_homework.homework_detail_group.base_on_project = homework.base_on_project att.author_id = homework.user_id
end att.copy_from = attachment.id
att.save
new_homework.attachments << att
end
homework.attachments.each do |attachment| if new_homework.save
att = attachment.copy if new_homework.homework_type == 4
att.container_id = nil HomeworkCommonsShixuns.create(:homework_common_id => new_homework.id, :shixun_id => homework.homework_bank_shixun.shixun_id)
att.container_type = nil end
att.author_id = homework.user_id new_homework_detail_manual.save if new_homework_detail_manual
att.copy_from = attachment.id new_homework.homework_detail_programing.save if new_homework.homework_detail_programing
att.save new_homework.homework_detail_group.save if new_homework.homework_detail_group
new_homework.attachments << att create_works_list new_homework
end
if new_homework.save homework.update_column(:quotes, homework.quotes+1)
if new_homework.homework_type == 4 QuestionBank.where(:container_id => homework.id, :container_type => ["Common", "Shixun", "Group"]).update_all(:quotes => homework.quotes)
HomeworkCommonsShixuns.create(:homework_common_id => new_homework.id, :shixun_id => homework.homework_bank_shixun.shixun_id)
end end
new_homework_detail_manual.save if new_homework_detail_manual return new_homework
new_homework.homework_detail_programing.save if new_homework.homework_detail_programing
new_homework.homework_detail_group.save if new_homework.homework_detail_group
create_works_list new_homework
homework.update_column(:quotes, homework.quotes+1)
QuestionBank.where(:container_id => homework.id, :container_type => ["Common", "Shixun", "Group"]).update_all(:quotes => homework.quotes)
end end
return new_homework
end end
def quote_exercise_bank exercise, course def quote_exercise_bank exercise, course
new_exercise = Exercise.new(:exercise_name => exercise.name, :exercise_description => exercise.description, :user_id => User.current.id, :is_public => 0, ActiveRecord::Base.transaction do
:exercise_status => 1, :show_result => 1, :course_id => course.id, :time => -1, :exercise_bank_id => exercise.id) new_exercise = Exercise.new(:exercise_name => exercise.name, :exercise_description => exercise.description, :user_id => User.current.id, :is_public => 0,
:exercise_status => 1, :show_result => 1, :course_id => course.id, :time => -1, :exercise_bank_id => exercise.id)
exercise.exercise_bank_questions.each do |q|
option = { exercise.exercise_bank_questions.each do |q|
:question_title => q[:question_title], option = {
:question_type => q[:question_type] || 1, :question_title => q[:question_title],
:question_number => q[:question_number], :question_type => q[:question_type] || 1,
:question_score => q[:question_score], :question_number => q[:question_number],
:shixun_id => q[:shixun_id] :question_score => q[:question_score],
} :shixun_id => q[:shixun_id]
exercise_question = new_exercise.exercise_questions.new option }
exercise_question = new_exercise.exercise_questions.new option
if q.question_type != 5
for i in 1..q.exercise_bank_choices.count if q.question_type != 5
choice_option = { for i in 1..q.exercise_bank_choices.count
:choice_position => i, choice_option = {
:choice_text => q.exercise_bank_choices[i-1][:choice_text] :choice_position => i,
} :choice_text => q.exercise_bank_choices[i-1][:choice_text]
exercise_question.exercise_choices.new choice_option }
end exercise_question.exercise_choices.new choice_option
end
for i in 1..q.exercise_bank_standard_answers.count for i in 1..q.exercise_bank_standard_answers.count
standard_answer_option = { standard_answer_option = {
:exercise_choice_id => q.exercise_bank_standard_answers[i-1][:exercise_bank_choice_id], :exercise_choice_id => q.exercise_bank_standard_answers[i-1][:exercise_bank_choice_id],
:answer_text => q.exercise_bank_standard_answers[i-1][:answer_text] :answer_text => q.exercise_bank_standard_answers[i-1][:answer_text]
} }
exercise_question.exercise_standard_answers.new standard_answer_option exercise_question.exercise_standard_answers.new standard_answer_option
end end
else else
for i in 1..q.exercise_bank_shixun_challenges.count for i in 1..q.exercise_bank_shixun_challenges.count
challenge_option = { challenge_option = {
:position => i, :position => i,
:challenge_id => q.exercise_bank_shixun_challenges[i-1][:challenge_id], :challenge_id => q.exercise_bank_shixun_challenges[i-1][:challenge_id],
:shixun_id => q.exercise_bank_shixun_challenges[i-1][:shixun_id], :shixun_id => q.exercise_bank_shixun_challenges[i-1][:shixun_id],
:question_score => q.exercise_bank_shixun_challenges[i-1][:question_score] :question_score => q.exercise_bank_shixun_challenges[i-1][:question_score]
} }
exercise_question.exercise_shixun_challenges.new challenge_option exercise_question.exercise_shixun_challenges.new challenge_option
end
end end
end end
if new_exercise.save
create_exercises_list new_exercise
exercise.update_column(:quotes, exercise.quotes+1)
QuestionBank.where(:container_id => exercise.id, :container_type => "Exercise").update_all(:quotes => exercise.quotes)
end
return new_exercise
end end
if new_exercise.save
create_exercises_list new_exercise
exercise.update_column(:quotes, exercise.quotes+1)
QuestionBank.where(:container_id => exercise.id, :container_type => "Exercise").update_all(:quotes => exercise.quotes)
end
return new_exercise
end end
def quote_poll_bank poll, course def quote_poll_bank poll, course
new_poll = Poll.new(:polls_name => poll.name, :polls_description => poll.description, :user_id => User.current.id, :is_public => 0, ActiveRecord::Base.transaction do
:polls_status => 1, :show_result => 1, :polls_type => 'Course', :course_id => course.id, :exercise_bank_id => poll.id) new_poll = Poll.new(:polls_name => poll.name, :polls_description => poll.description, :user_id => User.current.id, :is_public => 0,
:polls_status => 1, :show_result => 1, :polls_type => 'Course', :course_id => course.id, :exercise_bank_id => poll.id)
poll.exercise_bank_questions.each do |q|
option = { poll.exercise_bank_questions.each do |q|
:question_title => q[:question_title], option = {
:question_type => q[:question_type] || 1, :question_title => q[:question_title],
:is_necessary => q[:is_necessary], :question_type => q[:question_type] || 1,
:question_number => q[:question_number], :is_necessary => q[:is_necessary],
:max_choices => q[:max_choices], :question_number => q[:question_number],
:min_choices => q[:min_choices] :max_choices => q[:max_choices],
} :min_choices => q[:min_choices]
poll_question = new_poll.poll_questions.new option
for i in 1..q.exercise_bank_choices.count
choice_option = {
:answer_position => i,
:answer_text => q.exercise_bank_choices[i-1][:choice_text]
} }
poll_question.poll_answers.new choice_option poll_question = new_poll.poll_questions.new option
for i in 1..q.exercise_bank_choices.count
choice_option = {
:answer_position => i,
:answer_text => q.exercise_bank_choices[i-1][:choice_text]
}
poll_question.poll_answers.new choice_option
end
end end
if new_poll.save
create_polls_list new_poll
poll.update_column(:quotes, poll.quotes+1)
QuestionBank.where(:container_id => poll.id, :container_type => "Poll").update_all(:quotes => poll.quotes)
end
return new_poll
end end
if new_poll.save
create_polls_list new_poll
poll.update_column(:quotes, poll.quotes+1)
QuestionBank.where(:container_id => poll.id, :container_type => "Poll").update_all(:quotes => poll.quotes)
end
return new_poll
end end
def major_level_option def major_level_option

@ -15,7 +15,7 @@ class HomeworkCommon < ActiveRecord::Base
belongs_to :homework_bank belongs_to :homework_bank
has_many :homework_group_settings, :dependent => :destroy has_many :homework_group_settings, :dependent => :destroy
has_one :homework_detail_manual, :dependent => :destroy has_one :homework_detail_manual, :dependent => :destroy
# has_one :homework_detail_programing, :dependent => :destroy has_one :homework_detail_programing, :dependent => :destroy
has_one :homework_detail_group, :dependent => :destroy has_one :homework_detail_group, :dependent => :destroy
has_one :homework_commons_shixuns, :dependent => :destroy has_one :homework_commons_shixuns, :dependent => :destroy
has_many :homework_challenge_settings, :dependent => :destroy has_many :homework_challenge_settings, :dependent => :destroy

@ -113,7 +113,7 @@
<% elsif work.present? && work.try(:work_status) != 0 %> <% elsif work.present? && work.try(:work_status) != 0 %>
<%= link_to "查看作品", student_work_path(work), :class => 'white-btn orange-btn fr mr20 mt8', :target => "_blank" %> <%= link_to "查看作品", student_work_path(work), :class => 'white-btn orange-btn fr mr20 mt8', :target => "_blank" %>
<% elsif ((work.present? && work.try(:work_status) == 0) || work.nil?) && setting_time.end_time > Time.now %> <% elsif ((work.present? && work.try(:work_status) == 0) || work.nil?) && setting_time.end_time > Time.now %>
<% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1 && (work.project_id.nil? || work.project_id == 0 || work.project_id = -1) %> <% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1 && (work.try(:project_id).nil? || work.try(:project_id) == 0 || work.try(:project_id) == -1) %>
<%= link_to "关联项目", new_student_work_project_student_work_index_path(:homework => homework_common.id, :user_activity_id=> homework_common.id, :hw_status => 1), :remote => true, :class=> 'white-btn orange-btn fr mr20 mt8', :title=> '请各组长关联作业项目' %> <%= link_to "关联项目", new_student_work_project_student_work_index_path(:homework => homework_common.id, :user_activity_id=> homework_common.id, :hw_status => 1), :remote => true, :class=> 'white-btn orange-btn fr mr20 mt8', :title=> '请各组长关联作业项目' %>
<% else %> <% else %>
<%= link_to "提交作品", new_student_work_path(:homework => homework_common.id), :class => 'white-btn orange-btn fr mr20 mt8', :target => "_blank" %> <%= link_to "提交作品", new_student_work_path(:homework => homework_common.id), :class => 'white-btn orange-btn fr mr20 mt8', :target => "_blank" %>

@ -53,6 +53,9 @@
<li><%= link_to '我的实训', user_path(User.current, :type => 'a_shixun') %></li> <li><%= link_to '我的实训', user_path(User.current, :type => 'a_shixun') %></li>
<li><%= link_to '我的实训课程', user_path(User.current, :type => 'a_path') %></li> <li><%= link_to '我的实训课程', user_path(User.current, :type => 'a_path') %></li>
<li><%= link_to '我的项目', user_path(User.current, :type => 'a_project') %></li> <li><%= link_to '我的项目', user_path(User.current, :type => 'a_project') %></li>
<li><a>客户管理</a></li>
<% if User.current.department_members.count > 0 %> <% if User.current.department_members.count > 0 %>
<li><%= link_to '学院统计', statistics_college_path(User.current.department_members.first.try(:department)) %></li> <li><%= link_to '学院统计', statistics_college_path(User.current.department_members.first.try(:department)) %></li>
<% end %> <% end %>

@ -1,8 +1,5 @@
<div style="width:400px" class="task-popup"> <div style="width:400px" class="task-popup">
<div class="task-popup-title clearfix "> <div class="task-popup-title clearfix ">新增自动授权单位</div>
<h3 class="fl color-grey mt10 ml5">新增自动授权单位</h3>
<a href="javascript:void(0)" id="closeIcon" style="top: -48px;right: -20px;z-index: 100000;"><i class="iconfont icon-shanchudiao"></i></a>
</div>
<div class="mt10 ml30"> <div class="mt10 ml30">
<span class="fl font-16 color-grey mr10 mt3 ">单位名称:</span> <span class="fl font-16 color-grey mr10 mt3 ">单位名称:</span>
<input nhname="tag" name="school" class="task-height-40 panel-box-sizing fl" type="text" placeholder="请输入单位名称" style="width: 260px" value="<%= @schools %>" /> <input nhname="tag" name="school" class="task-height-40 panel-box-sizing fl" type="text" placeholder="请输入单位名称" style="width: 260px" value="<%= @schools %>" />

@ -0,0 +1,84 @@
<div class="task-popup" style="width: 572px;">
<div class="task-popup-title clearfix">添加管理员</div>
<div class="task_popup_con">
<div class="clearfix mb20" id="add_major_manager">
<li class="">
<input id="object_id" type="hidden" value="">
<input id="object_type" type="hidden" value="">
<p class="clearfix mb15">
<span class="fl">姓名:<input placeholder="请输入真实姓名" type="text" name="name" class="winput-120-30 greyInput"/></span>
<span class="ml20 fl">单位:<input placeholder="请输入单位名称" name="school" value="" type="text" class="winput-240-30 greyInput"/></span>
</p>
<div class="df">
<span class="fl lineh-35">职业:</span>
<div class="pr flex1" select-for>
<input type="hidden" name="identity">
<input type="text" class="input-100-35 color-grey-3" readonly value="请选择职业" placeholder="请选择职业"/>
<div class="down-select bor-grey-e user_bg_shadow" id="vecation_option">
<p>请选择职业</p>
<p data-shixun-value="0">教师</p>
<p data-shixun-value="1">学生</p>
<p data-shixun-value="2">专业人士</p>
</div>
</div>
<a href="javascript:void(0);" onclick="submit_search_user()" class="white-btn mt6 edu-blueback-btn fl ml15">搜索</a>
</div>
</li>
</div>
<div class="mb20 clearfix">
<p class="pl10 color-grey-6 clearfix">
<span class="fl edu-txt-w90 pl10">姓名</span>
<span class="fl edu-txt-w90 edu-txt-center">职称</span>
<span class="fl edu-txt-w200 edu-txt-left">单位</span>
<span class="fl edu-txt-w100 edu-txt-center">手机号</span>
</p>
<div class="edu-back-skyblue clearfix pl10 over280" id="serch_user_list">
<p class="clearfix">
<span class="fl edu-txt-w90">
<input type="checkbox" name="user_id[]" value="12545" id="user_12545" class="magic-checkbox">
<label for="user_12545">李健</label>
</span>
<span class="fl edu-txt-w90 mt5 edu-txt-center color-grey-6 pointer">学生</span>
<span class="fl task-hide edu-txt-w200 mt5 edu-txt-left color-grey-9">湖北工业大学 </span>
<span class="fl edu-txt-w100 mt5 edu-txt-center color-grey-9">156****9087</span>
</p>
<p class="clearfix">
<span class="fl edu-txt-w90">
<input type="checkbox" name="user_id[]" value="12545" id="user_12545" class="magic-checkbox">
<label for="user_12545">李健</label>
</span>
<span class="fl edu-txt-w90 mt5 edu-txt-center color-grey-6 pointer">学生</span>
<span class="fl task-hide edu-txt-w200 mt5 edu-txt-left color-grey-9">湖北工业大学 </span>
<span class="fl edu-txt-w100 mt5 edu-txt-center color-grey-9"></span>
</p>
</div>
</div>
<p class="color-orange-tip" id="form_notice"></p>
<li class="clearfix mt10 edu-txt-center">
<a href="javascript:void(0);" class="task-btn mr10" onclick="hideModal()">取消</a>
<a href="javascript:void(0);" class="task-btn task-btn-orange ml20" onclick="submit_add_manager()">确定</a>
</li>
</div>
</div>
<script>
$(function() {
unitDownOption();
$("#add_major_manager").on("keydown", "input[name='name'],input[name='school']", function(e){
// 兼容FF和IE和Opera
var theEvent = e || window.event;
var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
if (code == 13) {
//回车执行查询
submit_search_user();
}
});
function submit_search_user(){
if($("input[name='name']").val()==""){
$("input[name='name']").addClass("bor-red");
return;
}
}
})
</script>

@ -0,0 +1,71 @@
<div class="task-popup" style="width: 572px;">
<div class="task-popup-title clearfix">添加合作伙伴</div>
<div class="task_popup_con">
<div class="clearfix mb20 df">
<div class="flex1">
<div class="df">
<span class="fl lineh-35">地区:</span>
<select placeholder="请选择地区" id="province" class="flex1"></select>
</div>
<div class="df mt15">
<span class="fl lineh-35">单位:</span>
<input placeholder="请输入单位关键字" class="input-flex-35"/>
</div>
</div>
<a href="javascript:void(0);" onclick="submit_search_user()" class="white-btn mt6 edu-blueback-btn fl ml15 mt55">搜索</a>
</div>
<div class="mb20 clearfix">
<p class="pl10 color-grey-6 clearfix">
<span class="fl ml25">单位</span>
<span class="fr with30">地区</span>
</p>
<div class="edu-back-skyblue clearfix pl10 over280" id="serch_user_list">
<p class="clearfix mt5">
<span class="fl with70">
<span>
<input type="checkbox" name="user_id[]" value="1" id="user_1" class="magic-checkbox">
<label for="user_1">国防科技大学</label>
</span>
</span>
<span class="fl with30">湖南</span>
</p>
<p class="clearfix mt5">
<span class="fl with70">
<span>
<input type="checkbox" name="user_id[]" value="12" id="user_12" class="magic-checkbox">
<label for="user_12">国防科技大学</label>
</span>
</span>
<span class="fl with30">湖南</span>
</p>
<p class="clearfix mt5">
<span class="fl with70">
<span>
<input type="checkbox" name="user_id[]" value="125" id="user_125" class="magic-checkbox">
<label for="user_125">国防科技大学</label>
</span>
</span>
<span class="fl with30">湖南</span>
</p>
</div>
<p class="clearfix" style="height: 20px;"><span class="fl lineh-20 none color-red" id="checkNotice"></span></p>
</div>
<li class="clearfix mt10 edu-txt-center">
<a href="javascript:void(0);" class="task-btn mr10" onclick="hideModal()">取消</a>
<a href="javascript:void(0);" class="task-btn task-btn-orange ml20" onclick="submit_add_partner()">确定</a>
</li>
</div>
</div>
<script>
$(function() {
unitDownOption();
showprovince("province");
})
function submit_add_partner(){
if($("input[name='user_id[]']:checked").length==0){
$("#checkNotice").html("请选择需要添加的内容").removeClass("none");
return;
}
}
</script>

@ -0,0 +1,75 @@
<div class="mt20">
<div class="clearfix edu-back-white padding20-30">
<input class="fl task-form-20 task-height-30" placeholder="输入合作伙伴名称进行搜索">
<a href="javascript:void(0)" class="fl task-btn task-btn-orange ml10">搜索</a>
<a href="javascript:void(0)" class="fl task-btn ml10">清除</a>
</div>
<div class="clearfix mt20">
<div class="with25 fl edu-back-white">
<a href="javascript:void(0)" class="color-blue addOperation">+添加</a>
<ul class="partnerList">
<li><a class="active" href="javascript:void(0)">北京真假科技有限公司</a></li>
<li><a href="javascript:void(0)">北京真假科技有限公司</a></li>
<li><a href="javascript:void(0)">北京真假科技有限公司</a></li>
<li><a href="javascript:void(0)">北京真假科技有限公司</a></li>
<li><a href="javascript:void(0)">北京真假科技有限公司</a></li>
</ul>
</div>
<div class="with75 fl pl20">
<div class="edu-back-white">
<div>
<div class="padding10-20">
<p class="mb20"><span class="mr30 color-grey-9">添加时间</span><span class="color-grey-6">2019-04-03 15:40</span></p>
<div class="clearfix">
<span class="mr45 color-grey-9 fl">管理员</span>
<ul class="manageList">
<li><a href="javascript:void(0)" class="addManage">+</a></li>
<li><img src="https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=105293018,2500805440&fm=27&gp=0.jpg"/><a href="javascript:void(0)" class="removeImg"><i class="iconfont icon-htmal5icon19 color-grey-9"></i></a></li>
</ul>
</div>
</div>
<div class="tableList">
<li class="clearfix tableHead">
<span>序号</span>
<span>客户名称</span>
<span><a href="javascript:void(0)" class="color-blue">+添加</a></span>
<span>添加时间</span>
</li>
<li>
<span>1</span>
<span class="task-hide">国防科技大学</span>
<span>
<a href="javascript:void(0)" class="color-grey-9">删除</a>
</span>
<span>
2019-04-03 16:04
</span>
</li>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(function(){
$(".partnerList li").on("click","a",function(){
$(".partnerList li a").removeClass("active");
$(this).addClass("active");
})
$(".removeImg").on("click",function(){
$(this).parents("li").remove();
})
$(".addOperation").on("click",function(){
var html="<%= escape_javascript(render :partial => "managements/partner_addUnit") %>";
pop_box_new(html,572,500);
})
$(".manageList").on("click",".addManage",function(){
var html="<%= escape_javascript(render :partial => "managements/partner_addManage") %>";
pop_box_new(html,572,500);
})
})
</script>

@ -0,0 +1,42 @@
<p class="clearfix edu-back-white">
<span class="column-No">序号</span>
<span class="column-2">单位名称</span>
<span class="column-2">教师</span>
<span class="column-2">学生</span>
<span class="column-2">课堂</span>
<span class="column-2">发布实训</span>
<span class="column-2">实训报告</span>
<span class="column-2 fr">使用详情</span>
</p>
<ul class="minH-560 edu-back-white pb20 courselist">
<li class="clearfix bor-bottom-greyE" id="major_list">
<span class="column-No major_index">1</span>
<span class="column-2">国防科技大学</span>
<span class="column-2">22</span>
<span class="column-2">
33
</span>
<span class="column-2">
44
</span>
<span class="column-2">
55
</span>
<span class="column-2">
66
</span>
<span class="column-2 fr">
<a href="" class="color-blue">查看</a>
</span>
</li>
</ul>
<div class="educontent edu-txt-center mb80 mt20">
<div class="inline pages_user_show">
<ul>
<%= 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>

@ -0,0 +1,86 @@
<div id="Auth_main">
<div class="educontent clearfix edu-back-white bor-bottom-greyE">
<div class="padding20-30">
<!-- <p class="mb20"><span class="font-18 mr20">管理员</span><span class="font-12 color-grey-9"></span></p>-->
<!-- <ul class="clearfix managerPanels">-->
<!-- <a class="fl relative">-->
<!-- <img alt="头像" class="radius" height="48" src="https://www.educoder.net/images/avatars/User/6?1543479003" width="48" />-->
<!-- <i class="iconfont icon-shanchudiao userimg color-grey-9" ></i>-->
<!-- <span class="color-black">达达老师</span>-->
<!-- </a>-->
<!-- <a class="fl relative">-->
<!-- <i class="iconfont icon-tianjiafangda useradd color-grey-9"></i>-->
<!-- </a>-->
<!-- </ul>-->
<!-- <ul class="clearfix managerPanels">-->
<!-- <a class="fl font-16 padding5-20 block mr30 navItem active color-blue"><span class="fl">实训回复</span></a>-->
<!-- </ul>-->
</div>
</div>
<div class="educontent mb30">
<div class="clearfix padding20-30 bor-bottom-greyE edu-back-white">
<span class="fl font-12 mt5">
<span class="color-orange-tip mr3" id="search_major_count"><%= @obj_count %></span>
<span class="color-grey-9">个检索结果(<span id="all_major_count"><%= @major_count %></span> 单位)</span>
</span>
<div class="fr" id="pollingPanel">
<input type="text" name="search" placeholder="请输入单位名称搜索" />
<a href="javascript:void(0)" onclick="submit_search_major()"><i class="iconfont icon-sousuo font-16 color-grey-9"></i></a>
</div>
</div>
<div class="ListTableLine ListTableLines" id="school_major_list">
<%= render :partial => "department_list" %>
</div>
</div>
</div>
<script>
$(function(){
$(".MajorName i").click(function(){
$(this).parents(".MajorName").remove();
});
$("#school_major_list").on("click", ".addMajorManager", function(){
if($("#major_managers_"+$(this).attr("data-major-id")).children("span").length < 5){
var html="<%= escape_javascript(render :partial => "ecs/authList_addUnit") %>";
pop_box_new(html,572,500);
$("#object_id").val($(this).attr("data-major-id"));
$("#object_type").val('major');
$("input[name='school']").val('<%= @school.name %>');
} else {
notice_box("只能配置5个专业管理员");
}
});
$("#pollingPanel").on("keydown", "input[name='search']", function(e){
// 兼容FF和IE和Opera
var theEvent = e || window.event;
var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
if (code == 13) {
//回车执行查询
submit_search_major()
}
});
});
function submit_search_major(){
$.get('/ecs/department?school_id=<%= @school.id %>',
{ search: $("input[name='search']").val().trim()});
}
</script>

@ -2973,6 +2973,29 @@ a.singlepublishtwo{
/*合作伙伴*/ /*合作伙伴*/
.edu-cooperation li{height: 60px;width: 210px;padding: 10px 0px;margin-left: 20px;float: left;margin-bottom: 20px;text-align: center;line-height: 40px;box-sizing: border-box} .edu-cooperation li{height: 60px;width: 210px;padding: 10px 0px;margin-left: 20px;float: left;margin-bottom: 20px;text-align: center;line-height: 40px;box-sizing: border-box}
.edu-cooperation li img{height: 40px;width: 210px;} .edu-cooperation li img{height: 40px;width: 210px;}
/*单位-合作伙伴*/
.addOperation{width: 100%;display: block;height: 56px;line-height: 56px;text-align: center;border-bottom: 1px solid #eee;}
.partnerList li a{
display: block;height: 40px;line-height: 40px;padding:0px 10px;width: 100%;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;
box-sizing: border-box;position: relative;
}
.partnerList li a.active:after{
position: absolute;left: 0px;height: 100%;width: 2px;content: '';background: #4cacff;
}
.partnerList{max-height: 500px;overflow-y: auto;}
.manageList{float: left}
.manageList li{width: 60px;height: 60px;float: left;margin-right: 15px;border-radius: 50%;text-align: center;position: relative;margin-bottom: 10px;}
.manageList li>a.addManage,.manageList li>img{width: 60px;height: 60px;line-height: 49px;float: left;margin-right: 10px;border-radius: 50%;}
.addManage{display: block;background: #cdcdcd;color: #fff!important;font-size: 55px;}
.removeImg{position: absolute;right: 1px;top: -12px;}
.tableList .tableHead{background: #fafafa}
.tableList{min-height: 400px;}
.tableList li{height: 45px;line-height: 45px;}
.tableList li span{float: left;display: block;text-align: center}
.tableList li span:nth-child(1){width: 10%}
.tableList li span:nth-child(2){width: 60%;text-align: left}
.tableList li span:nth-child(3){width: 10%;float: right}
.tableList li span:nth-child(4){width: 20%;float: right}
/* 兼容(小屏幕)手机浏览器 */ /* 兼容(小屏幕)手机浏览器 */
@ -3110,3 +3133,40 @@ line-height: 20px;display: inline-block;color: rgba(65, 140, 205, 1) !important;
width: calc( 100% ) width: calc( 100% )
} }
#requireTable thead .td-head-child:last-child{border-right: none;} #requireTable thead .td-head-child:last-child{border-right: none;}
/*用户列表*/
.managerPanels a{margin-right:24px;}
.managerPanels a:nth-child(16n){margin-right: 0px;}
.managerPanels a span{display: block;text-align: center;max-width: 70px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color: #666;}
.managerPanels a:hover span{color: #4cacff!important;}
.userimg{position: absolute;top: -16px;right: -5px;}
.useradd{font-size: 42px !important; position: absolute; top: -16px;}
.ListTableLines .column-2{
width: 150px;
text-align: center;
padding-left: 5px;
box-sizing: border-box;
color:#999999;
}
.ListTableLines .column-No{
color:#999999;
}
.courselist .column-2{
width: 150px;
text-align: center;
padding-left: 5px;
box-sizing: border-box;
color:#656565;
}
.courselist .column-No{
color:#999999;
}
.poll_list a {
display: inline-block;
padding: 20px;
font-size: 18px;
text-align: center;
position: relative;
color: #05101a;
}

@ -100,7 +100,7 @@ a.decoration{text-decoration: underline}
.panel-form-label{ display:inline-block; width:10%; min-width:90px; text-align:right; line-height:40px; font-weight: normal; } .panel-form-label{ display:inline-block; width:10%; min-width:90px; text-align:right; line-height:40px; font-weight: normal; }
/*通用内外边距*/ /*通用内外边距*/
.mt-10{ margin-top:-10px;}.mt-3{ margin-top:-3px;}.mt0{ margin-top:0px!important;} .mt1{ margin-top:1px;}.mt2{ margin-top:2px;}.mt3{ margin-top:3px;}.mt4{ margin-top:4px;}.mt5{ margin-top:5px!important;}.mt6{ margin-top:6px;}.mt7{ margin-top:7px!important;}.mt8{ margin-top:8px;}.mt9{ margin-top:9px;}.mt10{ margin-top:10px!important;}.mt12{ margin-top:12px;}.mt13{ margin-top:13px;}.mt14{ margin-top:14px;}.mt15{ margin-top:15px!important;}.mt16{ margin-top:16px;}.mt17{ margin-top:17px;}.mt18{ margin-top:18px;}.mt20{ margin-top:20px!important;}.mt22{ margin-top:22px!important;}.mt23{ margin-top:23px!important;}.mt24{ margin-top:24px!important;}.mt25{ margin-top:25px;}.mt28{ margin-top:28px;}.mt30{ margin-top:30px!important;}.mt34{ margin-top:34px!important;}.mt35{ margin-top:35px!important;}.mt36{ margin-top:36px!important;}.mt40{ margin-top:40px;}.mt45{ margin-top:45px;}.mt46{ margin-top:46px;}.mt50{ margin-top:50px;!important;}.mt56{ margin-top:56px;!important;}.mt60{ margin-top:60px;}.mt70{ margin-top:70px;}.mt80{ margin-top:80px;}.mt95{ margin-top:95px;}.mt100{ margin-top:100px;}.mt110{ margin-top:110px;}.mt120{ margin-top:120px;}.mt130{ margin-top:130px;}.mt140{ margin-top:140px;}.mt150{ margin-top:150px;}.mt160{ margin-top:160px;} .mt-10{ margin-top:-10px;}.mt-3{ margin-top:-3px;}.mt0{ margin-top:0px!important;} .mt1{ margin-top:1px;}.mt2{ margin-top:2px;}.mt3{ margin-top:3px;}.mt4{ margin-top:4px;}.mt5{ margin-top:5px!important;}.mt6{ margin-top:6px;}.mt7{ margin-top:7px!important;}.mt8{ margin-top:8px;}.mt9{ margin-top:9px;}.mt10{ margin-top:10px!important;}.mt12{ margin-top:12px;}.mt13{ margin-top:13px;}.mt14{ margin-top:14px;}.mt15{ margin-top:15px!important;}.mt16{ margin-top:16px;}.mt17{ margin-top:17px;}.mt18{ margin-top:18px;}.mt20{ margin-top:20px!important;}.mt22{ margin-top:22px!important;}.mt23{ margin-top:23px!important;}.mt24{ margin-top:24px!important;}.mt25{ margin-top:25px;}.mt28{ margin-top:28px;}.mt30{ margin-top:30px!important;}.mt34{ margin-top:34px!important;}.mt35{ margin-top:35px!important;}.mt36{ margin-top:36px!important;}.mt40{ margin-top:40px;}.mt45{ margin-top:45px;}.mt46{ margin-top:46px;}.mt50{ margin-top:50px;!important;}.mt55{ margin-top:55px;!important;}.mt56{ margin-top:56px;!important;}.mt60{ margin-top:60px;}.mt70{ margin-top:70px;}.mt80{ margin-top:80px;}.mt95{ margin-top:95px;}.mt100{ margin-top:100px;}.mt110{ margin-top:110px;}.mt120{ margin-top:120px;}.mt130{ margin-top:130px;}.mt140{ margin-top:140px;}.mt150{ margin-top:150px;}.mt160{ margin-top:160px;}
.mb3{ margin-bottom: 3px;}.mb5{ margin-bottom: 5px;}.mb7{ margin-bottom: 7px;}.mb9{ margin-bottom: 9px;}.mb10{ margin-bottom: 10px;}.mb11{ margin-bottom: 11px;}.mb14{ margin-bottom: 14px;}.mb15{ margin-bottom: 15px;}.mb16{ margin-bottom: 16px;}.mb20{ margin-bottom: 20px!important;}.mb25{ margin-bottom: 25px;}.mb26{ margin-bottom: 26px;}.mb28{ margin-bottom: 28px;}.mb30{ margin-bottom: 30px!important;}.mb40{ margin-bottom: 40px!important;}.mb50{ margin-bottom: 50px!important;}.mb60{ margin-bottom: 60px!important;}.mb70{ margin-bottom: 70px!important;}.mb80{ margin-bottom: 80px!important;}.mb90{ margin-bottom: 90px!important;}.mb100{ margin-bottom: 100px!important;}.mb110{ margin-bottom: 110px;} .mb3{ margin-bottom: 3px;}.mb5{ margin-bottom: 5px;}.mb7{ margin-bottom: 7px;}.mb9{ margin-bottom: 9px;}.mb10{ margin-bottom: 10px;}.mb11{ margin-bottom: 11px;}.mb14{ margin-bottom: 14px;}.mb15{ margin-bottom: 15px;}.mb16{ margin-bottom: 16px;}.mb20{ margin-bottom: 20px!important;}.mb25{ margin-bottom: 25px;}.mb26{ margin-bottom: 26px;}.mb28{ margin-bottom: 28px;}.mb30{ margin-bottom: 30px!important;}.mb40{ margin-bottom: 40px!important;}.mb50{ margin-bottom: 50px!important;}.mb60{ margin-bottom: 60px!important;}.mb70{ margin-bottom: 70px!important;}.mb80{ margin-bottom: 80px!important;}.mb90{ margin-bottom: 90px!important;}.mb100{ margin-bottom: 100px!important;}.mb110{ margin-bottom: 110px;}
.ml-3{ margin-left: -3px;}.ml1{margin-left: 1px;}.ml2{margin-left: 2px;}.ml3{margin-left: 3px;}.ml4{margin-left: 4px;}.ml5{ margin-left: 5px;}.ml6{ margin-left: 6px;}.ml10{ margin-left: 10px;}.ml12{ margin-left:12px!important;}.ml13{ margin-left:13px!important;}.ml15{ margin-left: 15px;}.ml18{ margin-left: 18px;}.ml20{ margin-left: 20px;}.ml22{ margin-left: 22px;}.ml25{ margin-left: 25px;}.ml30{ margin-left: 30px;}.ml33{ margin-left: 33px;}.ml35{ margin-left:35px;}.ml40{margin-left:40px;}.ml42{margin-left:42px;}.ml45{ margin-left: 45px;}.ml50{ margin-left: 50px;}.ml55{ margin-left: 55px;}.ml60{ margin-left: 60px;}.ml72{ margin-left: 72px;}.ml73{ margin-left: 73px;}.ml75{ margin-left: 75px;}.ml80{ margin-left: 80px;}.ml95{ margin-left: 95px;}.ml115{margin-left: 115px}.ml123{ margin-left: 123px;}.ml150{ margin-left: 150px;}.ml180{ margin-left: 180px;}.ml230{ margin-left: 230px;} .ml-3{ margin-left: -3px;}.ml1{margin-left: 1px;}.ml2{margin-left: 2px;}.ml3{margin-left: 3px;}.ml4{margin-left: 4px;}.ml5{ margin-left: 5px;}.ml6{ margin-left: 6px;}.ml10{ margin-left: 10px;}.ml12{ margin-left:12px!important;}.ml13{ margin-left:13px!important;}.ml15{ margin-left: 15px;}.ml18{ margin-left: 18px;}.ml20{ margin-left: 20px;}.ml22{ margin-left: 22px;}.ml25{ margin-left: 25px;}.ml30{ margin-left: 30px;}.ml33{ margin-left: 33px;}.ml35{ margin-left:35px;}.ml40{margin-left:40px;}.ml42{margin-left:42px;}.ml45{ margin-left: 45px;}.ml50{ margin-left: 50px;}.ml55{ margin-left: 55px;}.ml60{ margin-left: 60px;}.ml72{ margin-left: 72px;}.ml73{ margin-left: 73px;}.ml75{ margin-left: 75px;}.ml80{ margin-left: 80px;}.ml95{ margin-left: 95px;}.ml115{margin-left: 115px}.ml123{ margin-left: 123px;}.ml150{ margin-left: 150px;}.ml180{ margin-left: 180px;}.ml230{ margin-left: 230px;}
.mr3{margin-right: 3px}.mr4{margin-right: 4px}.mr5{ margin-right: 5px;}.mr8{ margin-right: 8px;}.mr10{ margin-right: 10px;}.mr12{ margin-right:12px!important;}.mr15{ margin-right: 15px;}.mr18{ margin-right: 18px;}.mr20{ margin-right: 20px;}.mr24{ margin-right: 24px;}.mr25{ margin-right: 25px;}.mr30{ margin-right:30px;}.mr35{margin-right:35px;}.mr40{margin-right:40px;}.mr45{margin-right:45px;}.mr50{ margin-right: 50px;}.mr60{ margin-right:60px;}.mr70{ margin-right: 70px;}.mr75{ margin-right: 75px;}.mr80{ margin-right:80px;}.mr90{ margin-right:90px;}.mr100{ margin-right: 100px;}.mr110{ margin-right:110px;}.mr350{ margin-right:350px;} .mr3{margin-right: 3px}.mr4{margin-right: 4px}.mr5{ margin-right: 5px;}.mr8{ margin-right: 8px;}.mr10{ margin-right: 10px;}.mr12{ margin-right:12px!important;}.mr15{ margin-right: 15px;}.mr18{ margin-right: 18px;}.mr20{ margin-right: 20px;}.mr24{ margin-right: 24px;}.mr25{ margin-right: 25px;}.mr30{ margin-right:30px;}.mr35{margin-right:35px;}.mr40{margin-right:40px;}.mr45{margin-right:45px;}.mr50{ margin-right: 50px;}.mr60{ margin-right:60px;}.mr70{ margin-right: 70px;}.mr75{ margin-right: 75px;}.mr80{ margin-right:80px;}.mr90{ margin-right:90px;}.mr100{ margin-right: 100px;}.mr110{ margin-right:110px;}.mr350{ margin-right:350px;}

Loading…
Cancel
Save