Merge branch 'develop' of https://bdgit.trustie.net/hushasha/bigdata into develop

This commit is contained in:
miss 2017-09-04 08:59:05 +08:00
commit d59e7b7cea
53 changed files with 528 additions and 182 deletions

View File

@ -151,7 +151,11 @@ class ChallengesController < ApplicationController
end
end
end
redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => params[:tab]), notice: 'Succeed'
if params[:tab].to_i == 5
redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => params[:tab]), notice: 'Succeed'
else
redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => params[:tab])
end
rescue Exception => e
flash[:error] = "#{e.message}"
redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => params[:tab])

View File

@ -1,5 +1,7 @@
class DepartmentController < ApplicationController
before_filter :find_department, :only => [:destroy]
#根据部门名字或者拼音来查询
def on_search
school = School.find params[:school_id]
@ -95,4 +97,24 @@ class DepartmentController < ApplicationController
render :json =>status
end
def destroy
if @department
if UserExtensions.where(:department_id => @department.id).count == 0
ApplyAddDepartment.where(:department_id=>@department.id).update_all(:status => 2)
@apply_dep = ApplyAddDepartment.where(:department_id=>@department.id).first
@department.destroy
end
respond_to do |format|
format.js
end
end
end
private
def find_department
@department = Department.find params[:id]
rescue ActiveRecord::RecordNotFound
render_404
end
end

View File

@ -268,7 +268,7 @@ end
@menu_type = 6
@sub_type = 2
@sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order]
@department =Department.where("0=0")
@department = ApplyAddDepartment.where(:status => 1)
search=params[:search]
if search.blank?
@department = @department
@ -288,6 +288,69 @@ end
end
end
# 新增
def create_departments
respond_to do |format|
format.js
end
end
def add_department
department = Department.where(:school_id => params[:school], :name => params[:department]).first
if department.nil?
department = Department.create(:school_id => params[:school],:name => params[:department])
ApplyAddDepartment.create(:school_id => params[:school],
:status => 1,
:name => params[:department],
:department_id => department.id,
:user_id => User.current.id);
end
redirect_to departments_managements_path
end
# 修改单位部门列表
def update_department
dep = Department.find params[:department_id]
apply_schools = ApplyAddDepartment.where(:status => 1, :school_id => dep.school_id)
apply_school_ids = apply_schools.empty? ? "(-1)" : "(" + apply_schools.map{|sc| sc.department_id}.join(',') + ")"
@edit_id = params[:department_id]
@search = params[:search]
if !params[:search].nil?
search = "%#{params[:search].to_s.strip.downcase}%"
@departments = Department.where("id in #{apply_school_ids} and #{Department.table_name}.name like :p", :p => search)
#@schools = School.all
else
@departments = Department.where("id in #{apply_school_ids}")
end
respond_to do |format|
format.js
end
end
def edit_departments_school
begin
dep = Department.find(params[:department_id])
alter_dep = Department.find(params[:alter_dep_id])
apply_dep = ApplyAddDepartment.where(:department_id => params[:alter_dep_id])
if dep && alter_dep && dep != alter_dep
# users = UserExtensions.where("department_id = #{dep.id}")
# users.update_all(:department_id => params[:alter_dep_id])
# dep.destroy
# apply_dep.update_all(:status => 2)
# ApplyAddDepartment.where(:department_id =>params[:departments]).update_all(:department_id=>department_id)
# users = UserExtensions.where("department_id = #{alt_dep.department_id}")
# users.update_all(:department_id => department.id)
apply_dep.destroy_all;
users = UserExtensions.where(:department_id => params[:alter_dep_id])
users.update_all(:department_id => dep.id)
alter_dep.destroy
end
rescue Exception => e
puts e
end
redirect_to departments_managements_path
end
# 单位列表
def departments_part
@menu_type = 6
@ -373,23 +436,25 @@ end
# 部门修改
def all_department
apply_department = ApplyAddDepartment.where("status = 0")
@edit_id = params[:department_id]
@search = params[:search]
dep = ApplyAddDepartment.where(:id => @edit_id).first
apply_department = ApplyAddDepartment.where(:status => 1, :school_id => dep.school_id)
apply_department_ids = apply_department.empty? ? "(-1)" : "(" + apply_department.map{|sc| sc.department_id}.join(',') + ")"
if !params[:search].nil?
search = "%#{params[:search].to_s.strip.downcase}%"
@department = Department.where("id not in #{apply_department_ids} and #{Department.table_name}.name like :p", :p => search)
@department = Department.where("id in #{apply_department_ids} and #{Department.table_name}.name like :p", :p => search)
#@schools = School.all
else
#@course = @user.courses.where("is_delete = 0 and #{Course.table_name}.id != #{homework.course_id}").select { |course| @user.allowed_to?(:as_teacher,course)}
@department = Department.where("id not in #{apply_department_ids}")
@department = Department.where("id in #{apply_department_ids}")
end
@edit_id = params[:department_id]
@search = params[:search]
respond_to do |format|
format.js
end
# redirect_to unit_managements_path
end
# 修改
def edit_applied_department
aas =ApplyAddDepartment.find(params[:applied_id])
@ -398,19 +463,19 @@ end
department =Department.find params[:department_id]
begin
#更新消息表的status
applied_message_id = aas.department_id
applied_message = AppliedMessage.where(:applied_id => applied_message_id, :applied_type => "ApplyAddDepartment")
applied_message.update_all(:status => 4)
aas.update_attribute(:status, 2)
AppliedMessage.create(:user_id => aas.user_id, :status => 2, :viewed => 0, :applied_id => aas.id, :applied_type => "ApplyAddDepartment", :name =>department[0].name )
users = UserExtensions.where("department_id = #{aas.department_id}")
users.update_all(:department_id => department.id)
if aas.department_id != department.id.to_i
applied_message_id = aas.department_id
applied_message = AppliedMessage.where(:applied_id => applied_message_id, :applied_type => "ApplyAddDepartment")
applied_message.update_all(:status => 4)
aas.update_attribute(:status, 2)
AppliedMessage.create(:user_id => aas.user_id, :status => 2, :viewed => 0, :applied_id => aas.id, :applied_type => "ApplyAddDepartment", :name =>department.name )
users = UserExtensions.where("department_id = #{aas.department_id}")
users.update_all(:department_id => department.id)
aas.department.destroy
ApplyAddDepartment.where(:department_id => aas.department_id).update_all(:department_id => department.id)
Department.where(:department_id => aas.department_id).destroy_all
aas.destroy_all
end
ApplyAddDepartment.where(:department_id => aas.department_id).update_all(:department_id => department.id)
Department.where(:department_id => aas.department_id).update_all(:department_id => department.id)
aas.update_attribute(:department_id, department.id)
rescue Exception => e
puts e
end
@ -512,19 +577,20 @@ end
school = School.find params[:school_id]
begin
#更新消息表的status
applied_message_id = aas.school_id
applied_message = AppliedMessage.where(:applied_id => applied_message_id, :applied_type => "ApplyAddSchools")
applied_message.update_all(:status => 4)
aas.update_attribute(:status, 2)
AppliedMessage.create(:user_id => aas.user_id, :status => 2, :viewed => 0, :applied_id => aas.id, :applied_type => "ApplyAddSchools", :name => school[0].name )
users = UserExtensions.where("school_id = #{aas.school_id}")
users.update_all(:school_id => school.id)
if aas.school_id != school.id.to_i
applied_message_id = aas.school_id
applied_message = AppliedMessage.where(:applied_id => applied_message_id, :applied_type => "ApplyAddSchools")
applied_message.update_all(:status => 4)
aas.update_attribute(:status, 2)
AppliedMessage.create(:user_id => aas.user_id, :status => 2, :viewed => 0, :applied_id => aas.id, :applied_type => "ApplyAddSchools", :name => school.name )
users = UserExtensions.where("school_id = #{aas.school_id}")
users.update_all(:school_id => school.id)
ApplyAddDepartment.where(:school_id => aas.school_id).update_all(:school_id => school.id)
Department.where(:school_id => aas.school_id).update_all(:school_id => school.id)
aas.school.destroy
aas.update_attribute(:school_id, school.id)
end
ApplyAddDepartment.where(:school_id => aas.school_id).update_all(:school_id => school.id)
Department.where(:school_id => aas.school_id).update_all(:school_id => school.id)
aas.update_attribute(:school_id, school.id)
rescue Exception => e
puts e
end
@ -588,7 +654,7 @@ end
end
end
# 班级列表
# 课堂列表
def classroom_classment
@menu_type = 2
@sub_type = 2

View File

@ -151,7 +151,7 @@ class MyController < ApplicationController
ue = @user.user_extensions
@trail_authentication = ApplyAction.where(:user_id => User.current.id, :container_type => "TrialAuthorization").order("created_at desc").first
@authentication = @user.authentication
if @user.nickname.nil? || @user.lastname.nil? || ue.identity.nil? || ue.location.nil? || ue.school_id.nil?
if @user.nickname.nil? || @user.lastname.nil? || ue.try(:identity).nil? || ue.try(:location).nil? || ue.try(:location).nil?
@require_auth = true
else
if User.current.certification != 1 && (@trail_authentication.blank? || (@trail_authentication.status == 2 && (@trail_authentication.updated_at.to_i + 24*60*60) < Time.now.to_i))

View File

@ -1,7 +1,7 @@
class SchoolController < ApplicationController
layout 'course_base'
before_filter :require_admin, :only => :upload_logo
before_filter :find_school, :only => [:destroy]
def upload
uploaded_io = params[:logo]
school_id ||= params[:id]
@ -283,4 +283,23 @@ class SchoolController < ApplicationController
render :json=>{:status=>status,:id=>params[:id],:province=>province,:city=>city}
end
def destroy
if @school
if UserExtensions.where(:school_id => @school.id).count == 0
School.where(:id=>@school.id).destroy_all
@school.destroy
end
respond_to do |format|
format.js
end
end
end
private
def find_school
@school = School.find params[:id]
rescue ActiveRecord::RecordNotFound
render_404
end
end

View File

@ -1,7 +1,8 @@
class ApplyAddDepartment < ActiveRecord::Base
belongs_to :school
belongs_to :user
attr_accessible :name, :remarks, :status, :school_id, :user_id
has_many :applied_messages, :class_name =>'AppliedMessage', :as => :applied
belongs_to :department
end
class ApplyAddDepartment < ActiveRecord::Base
belongs_to :school
belongs_to :user
attr_accessible :name, :remarks, :status, :school_id, :user_id, :department_id
has_many :applied_messages, :class_name =>'AppliedMessage', :as => :applied
belongs_to :department
# status: 0表示未批准 status1表示已批准 status 2表示已更改 status 3表示已拒绝 status: 4表示已更改后废除的部门
end

View File

@ -34,7 +34,7 @@
<div class="cl"></div>
</li>
<p id="send_success_notice" class="none" style="margin-top: -15px; margin-bottom: 10px;"></p>
<li><a href="javascript:void(0);" class="new-user-submit" id="bind_email_or_phone_form_submit">保存</a></li>
<li><a href="javascript:void(0);" class="new-user-submit" id="bind_email_or_phone_form_submit">确定</a></li>
</ul>
</div>
</div>
@ -70,7 +70,7 @@
<div class="cl"></div>
</li>
<p id="send_success_notice" class="none" style="margin-top: -15px; margin-bottom: 10px;"></p>
<li><a href="javascript:void(0);" class="new-user-submit" id="bind_email_or_phone_form_submit">保存</a></li>
<li><a href="javascript:void(0);" class="new-user-submit" id="bind_email_or_phone_form_submit">确定</a></li>
</ul>
</div>
</div>

View File

@ -11,7 +11,7 @@
<% end %>
<% end %>
<div class="task-tag tag-grey mt5 mr10 fl <%= @challenge_tags.count > 0 ? "undis" : "" %>" id="add_shixun_skill">
<div class="task-tag tag-grey mt5 mr10 fl <%#= @challenge_tags.count > 0 ? "undis" : "" %>" id="add_shixun_skill">
<button data-dismiss="alert" class="close fr mt3 ml5" type="button" onclick="$('#add_shixun_skill').slideToggle();">×</button>
<input type="text" class="task-tag-input" onblur="add_tag();" id="shixun_skill_input" placeholder="请输入技能标签" />
</div>
@ -41,7 +41,6 @@
function add_tag(){
var num = $(".task-bd-grey").children('div').length;
var val = $(".task-tag-input").val().trim();
var nSkill = $(".knowledge_frame");
if (val != ""){
testLength = $(".task-tag-input").val().trim().length;
$("#add_shixun_skill").before("<div class='task-tag tag-grey mt5 mr10 fl' id='knowledge_" + num + "'>" +
@ -52,6 +51,8 @@
}
$("#shixun_skill_input").val("");
$("#add_shixun_skill").hide();
var nSkill = $(".knowledge_frame");
console.log(nSkill.length);
if (nSkill.length > 0){
$("#challenge_skill_update").submit(); //当增加或者保存技能标签以后执行保存操作
}else{

View File

@ -89,13 +89,14 @@
</div>
<script>
$(function(){
<% if notice %>
<% if notice && @tab == 5 %>
<% notice = nil %>
$(".save-tip").show();
<% end %>
setTimeout(function(){
$(".save-tip").hide();
}, 2000)
}, 2000);
<% end %>
})
</script>

View File

@ -14,56 +14,66 @@
<li class="clearfix pt20">
<label class="panel-form-label label fl color-dark-grey"><span class="color-orange mr5">*</span>课程名称&nbsp;&nbsp;&nbsp;&nbsp;</label>
<div class="pr fl with75">
<input type="text" name="course[course_list]" autocomplete="off" style="width: 100%;" id="new_course_list" class="task task-height-40 panel-box-sizing fl color-grey" maxlength="100" placeholder="例如:计算机基础">
<input type="text" name="course[course_list]" autocomplete="off" style="width: 100%;" id="new_course_list" class="task task-height-40 panel-box-sizing fl color-grey" maxlength="100" placeholder="例如:数据结构">
<ul class="course_list_ul">
</ul>
</div>
<div class="cl"></div>
<span class="color-orange fl none" id="new_course_syllabus_notice" style="margin-left:25%;"><i class="fa fa-exclamation-circle mr5" ></i>请先输入课程</span>
</li>
<li class="pt20 clearfix">
<li class="pt20 clearfix mb40">
<label class="panel-form-label label fl color-dark-grey"><span class="color-orange mr5">*</span>课堂名称&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input type="text" name="course[name]" autocomplete="off" id="new_course_name" class="task task-height-40 panel-box-sizing fl color-grey" maxlength="100" placeholder="例如:软件工程计算机系2016秋季A班" onkeyup="regex_course_name('new');">
<input type="text" name="course[name]" autocomplete="off" id="new_course_name" class="task task-height-40 panel-box-sizing fl color-grey" maxlength="100" placeholder="例如:数据结构2016秋季班级" onkeyup="regex_course_name('new');">
<div class="cl"></div>
<span class="color-orange fl none" id="new_course_name_notice" style="margin-left:25%;"><i class="fa fa-exclamation-circle mr5" ></i>课堂名称不能为空且至少有两个字符</span>
<div class="cl"></div>
<li class="ml125 mb5 fontGrey3" style="margin-left:25%;"><i class="fa fa-check-circle color-light-green mr5"></i>正确示例软件工程计算机系2016秋季A班</li>
<li class="ml125 fontGrey3" style="margin-left:25%;"><i class="fa fa-times-circle color-orange mr5"></i>错误示例计算机系2016秋季A班</li>
<div class="tusi" style="left:108% ">
<div class="entry">
<em></em>
<span class="after"></span>
<p class="color-grey mt10" style="height: 26px;line-height: 26px;">注意1、课堂名称 = 课程名称 + 学期信息 + 其它</p>
<p class="color-grey ml50" style="height: 26px;line-height: 26px;margin-left: 55px;"><i class="fa fa-check-circle color-light-green mr5"></i>正确示例数据结构2016秋季班级</p>
<p class="color-grey" style="height: 26px;line-height: 26px;margin-left: 55px;"><i class="fa fa-times-circle color-orange mr5"></i>错误示例:数据结构班级</p>
<p class="color-grey" style="height: 26px;line-height: 26px;margin-left: 42px;">2、如果本学期包含多个班级只需创建一个课堂</p>
<p class="color-grey mb10" style="height: 26px;line-height: 26px;margin-left: 65px;">然后在课堂内部建立不同的分班</p>
</div>
</div>
</li>
<li class="pt20 clearfix">
<label class="panel-form-label label fl color-dark-grey">总学时&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input type="text" name="period" id="new_class_period" class="task task-height-40 panel-box-sizing fl cut color-grey" onkeyup="regex_course_class_period('new');" placeholder="例如&nbsp;&nbsp;30" maxlength="6">
<input type="text" name="period" id="new_class_period" class="task task-height-40 panel-box-sizing fl color-grey" onkeyup="regex_course_class_period('new');" placeholder="例如&nbsp;&nbsp;30" maxlength="6">
<div class="cl"></div>
<span class="color-orange fl none" id="new_course_class_period_notice" style="margin-left:25%;"><i class="fa fa-exclamation-circle mr5" ></i>请输入正整数</span>
</li>
<li class="pt20 clearfix">
<label class="panel-form-label label fl color-dark-grey">学分&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input type="text" id="new_course_credit" name="credit" maxlength="4" onkeyup="regex_course_credit('new');" class="task task-height-40 panel-box-sizing fl cut color-grey" onkeyup="regex_course_credit('new');" placeholder="例如&nbsp;&nbsp;4">
<input type="text" id="new_course_credit" name="credit" maxlength="4" onkeyup="regex_course_credit('new');" class="task task-height-40 panel-box-sizing fl color-grey" onkeyup="regex_course_credit('new');" placeholder="例如&nbsp;&nbsp;4">
<div class="cl"></div>
<span class="color-orange fl none" id="new_course_credit_notice" style="margin-left:25%;"><i class="fa fa-exclamation-circle mr5" ></i>请输入正整数或保留一位小数的浮点数</span>
</li>
<li class="pt20 clearfix">
<label class="panel-form-label label fl color-dark-grey">结束时间&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input type="text" id="new_course_end_date" class="task task-height-40 panel-box-sizing fl cut color-grey" name="end_date" placeholder="请选择结束日期">
<input type="text" id="new_course_end_date" class="task task-height-40 panel-box-sizing fl color-grey" name="end_date" placeholder="请选择结束日期">
<div class="cl"></div>
<div class="tusi">
<div class="tusi" style="left:108% ">
<div class="entry">
<em></em>
<span class="after"></span>
<p class="color-grey">结束日期过后,课堂进入<%= link_to '归档状态', courses_path(:is_over => 1),:target => '_blank', :class => 'color-orange05' %>,只能在历史课堂中查看</p>
<p class="color-grey">结束日期过后,课堂进入归档状态<%#= link_to '归档状态', courses_path(:is_over => 1),:target => '_blank', :class => 'color-orange05' %>,只能在历史课堂中查看</p>
</div>
</div>
<div class="cl"></div>
<span class="color-orange fl none" id="new_course_end_date_notice" style="margin-left:25%;"><i class="fa fa-exclamation-circle mr5" ></i>结束日期必须晚于当前日期</span>
</li>
<li class="pt20 clearfix">
<li class="pt20 clearfix mb15">
<label class="panel-form-label label fl">公开课堂&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input id="course_is_public" name="course[is_public]" class="magic-checkbox fl mt8 mr5" type="checkbox" value="1">
<label for="course_is_public" class="color-grey fl">选中后本课堂对所有用户可见,否则仅本课堂成员可见</label>
</li>
<li class=" clearfix pb20">
<label class="panel-form-label label fl">&nbsp;&nbsp;&nbsp;&nbsp;</label>
<a href="javascript:void(0);" class="task-btn task-btn-blue fl mr10" onclick="submit_new_course();">保存</a>
<a href="javascript:void(0);" class="task-btn task-btn-blue fl mr20" onclick="submit_new_course();">保存</a>
<%= link_to '取消', courses_path, :class => 'task-btn fl' %>
</li>
</ul>

View File

@ -0,0 +1,6 @@
console.log(111);
for(var i=0; i<$("#apply_add_department_<%= @apply_dep.id %>").nextAll().length; i++){
var index = parseInt($($("#apply_add_department_<%= @apply_dep.id %>").nextAll()[i]).children(":first").html());
$($("#apply_add_department_<%= @apply_dep.id %>").nextAll()[i]).children(":first").html(index - 1);
}
$("#apply_add_department_<%= @apply_dep.id %>").remove();

View File

@ -122,8 +122,9 @@
if(data.error){
return;
}else{
var h = $("#games_repository_contents").height() - 50;
var rows = parseInt(h / 18);
var h = $("#games_repository_contents").height() - 50;
var line_h = (navigator.userAgent.indexOf('Firefox') >= 0 ? 19 : 18);
var rows = parseInt(h / line_h);
// 测试版
var html = "<iframe src='<%= Redmine::Configuration['tomcat_webssh'] %>/?Host=" + data.host + "&Port=" + data.port + "&Username=" + data.username + "&Password=" + data.password + "&Gameid=" + data.game_id + "&Rows=" + rows + "'" + " style='width:100%;border:0;' scrolling='no' class='game_webssh'></iframe><div class='-brother undis'></div>";
// 本地版

View File

@ -10,7 +10,7 @@
<tbody id="new_shixun_homework_list">
<% @shixuns.each do |shixun| %>
<tr>
<td class="clearfix">
<td class="clearfix" style="padding-left: 20px">
<input name="shixun_homework" type="radio" class="magic-radio" id="shixun_input_<%= shixun.id %>" value="<%= shixun.id %>">
<label for="shixun_input_<%= shixun.id %>" style="top:2px"></label>
<%= link_to shixun.name, shixun_path(shixun), :class => "edu-info-dark task-hide mt3 ml20",:style=> "text-align:left", :target => "_blank" %>

View File

@ -11,7 +11,7 @@
<tbody id="new_shixun_homework_list">
<% @shixuns.each do |shixun| %>
<tr>
<td class="clearfix">
<td class="clearfix" style="padding-left: 20px">
<input name="shixun_homework" type="radio" class="magic-radio" id="shixun_input_<%= shixun.id %>" value="<%= shixun.id %>">
<label style="top:2px" for="shixun_input_<%= shixun.id %>"></label>
<%= link_to shixun.name, shixun_path(shixun), :class => "edu-info-dark task-hide mt3 ml20",:style=> "text-align:left", :target => "_blank" %>

View File

@ -5,10 +5,10 @@
<% if @is_teacher %>
<% if @homework_type != 4 %>
<%= link_to '新建', new_homework_common_path(:course => @course.id, :homework_type =>@homework_type), :class => "task-btn task-btn-blue fr mr20", :title => "新建作业" %>
<%= link_to("题库选用", user_import_homeworks_user_path(User.current.id, :select_course => @course.id, :homework_type =>@homework_type), :class => "edu-btn fr mr10",:remote => true,:title=>"导入自己发布过的作业,或者共享题库中的作业") %>
<% else %>
<%= link_to '新建', shixuns_homework_common_index_path(:course => @course.id), :remote => true, :class => "task-btn task-btn-blue fr mr20", :title => "新建作业" %>
<%= link_to '选用实训', shixuns_homework_common_index_path(:course => @course.id), :remote => true, :class => "task-btn task-btn-blue fr mr20", :title => "新建作业" %>
<% end %>
<%= link_to("题库选用", user_import_homeworks_user_path(User.current.id, :select_course => @course.id, :homework_type =>@homework_type), :class => "edu-btn fr mr10",:remote => true,:title=>"导入自己发布过的作业,或者共享题库中的作业") %>
<% end %>
<!--<a href="<%#= export_course_member_excel_course_path(@course) %>" class="edu-btn fr mr10">导出成绩</a>-->
</div>

View File

@ -42,7 +42,7 @@
<div class="alert alert-orange mb15 mt15" style="width: 1180px; margin:20px auto;">
试用申请已提交,我们将在一个工作日内完成审核
</div>
<% elsif @trail_authentication.status == 2 && (@trail_authentication.updated_at.to_i + 24*60*60) > Time.now.to_i %>
<% elsif User.current.certification == 2 || (@trail_authentication.status == 2 && (@trail_authentication.updated_at.to_i + 24*60*60) > Time.now.to_i) %>
<div class="alert alert-orange mb15 mt15" style="width: 1180px; margin:20px auto;">
您的试用申请已被拒绝,原因:<%= @trail_authentication.reason %>请于24小时后重新申请
</div>

View File

@ -24,7 +24,7 @@
});
</script>
</head>
<body onload="prettyPrint();">
<body onload="prettyPrint();" style="height: 100%">
<div class="newContainer"> <!-- 页面全部内容 -->
<div class="newHeader"> <!-- 头部 -->
<% if User.current.logged? %>

View File

@ -26,7 +26,7 @@
<span class="color-dark-grey">
<% case @menu_type %>
<% when 2 %>
<%= @sub_type == 1 ? "课程列表" : "班级列表" %>
<%= @sub_type == 1 ? "课程列表" : "课堂列表" %>
<% when 3 %>
<%= @sub_type == 1 ? "实训列表" :(@sub_type == 2 ? "已发布的实训": (@sub_type == 3 ? "已关闭的实训": "镜像管理")) %>
<% when 4 %>
@ -55,7 +55,7 @@
<li class="fl edu-admin-nav-li edu-position <%= 'active' if @menu_type == 2 %>"><a href="javascript:void(0);" class="edu-admin-nav-a">课堂+</a>
<ul class="edu-admin-nav-inner edu-absolute">
<li><%= link_to "课程列表", classroom_managements_path %></li>
<li><%= link_to "班级列表", classroom_classment_managements_path %></li>
<li><%= link_to "课堂列表", classroom_classment_managements_path %></li>
</ul>
</li>
<li class="fl edu-admin-nav-li edu-position <%= 'active' if @menu_type == 3 %>"><a href="javascript:void(0);" class="edu-admin-nav-a">全部实训+</a>

View File

@ -27,7 +27,7 @@
throttle(search_courses, window, e);
});
function department_submit() {
var checkboxs = $("input[name='department_id[]']:checked");
var checkboxs = $("input[name='department_id']:checked");
if(checkboxs.length == 0) {
$("#choose_courses_notice").text("请选择单位");
} else{

View File

@ -27,7 +27,7 @@
throttle(search_courses, window, e);
});
function school_submit() {
var checkboxs = $("input[name='school_id[]']:checked");
var checkboxs = $("input[name='school_id']:checked");
if(checkboxs.length == 0) {
$("#choose_courses_notice").text("请选择单位");
} else{

View File

@ -2,13 +2,12 @@
<thead>
<tr>
<th width="9%">ID</th>
<th width="20%" class="edu-txt-left">班级名称</th>
<th width="20%" class="edu-txt-left">课堂名称</th>
<th width="4%">成员</th>
<th width="4%">资源</th>
<th width="4%">作业</th>
<th width="4%">试卷</th>
<th width="4%">私有</th>
<th width="4%">模版</th>
<th width="8%">状态</th>
<th width="13%" class="edu-txt-left">创建者单位</th>
<th width="11%">创建者</th>
@ -26,14 +25,13 @@
<td><%= course.homework_commons.count%></td>
<td><%= course.exercises.count %></td>
<td><%= course.is_public.to_i == 1 ? '--' : '√' %></td>
<td></td>
<td><%= course.is_end ? "已结束" : "正在进行" %></td>
<td class="edu-txt-left"><%= course.teacher.try(:user_extensions).try(:school).try(:name).blank? ? "--" : course.teacher.try(:user_extensions).try(:school) %></td>
<td> <%= link_to course.teacher.show_real_name, user_path(course.teacher) %></td>
<td> <%= format_time(course.updatetime) %></td>
<td>
<input type="checkbox" name="homepage_show" value="<%= course.id %>" <%= course.homepage_show ? "checked" : "" %> class="ml-3 mr5 magic-checkbox" id="join_course_role_<%= course.id %>">
<label style="top:-14px;padding-left: 35px;float:right;" for="join_course_role_<%= course.id %>"></label>
<label style="top:-14px;padding-left: 55px;float:right;" for="join_course_role_<%= course.id %>"></label>
</td>
</tr>
<% end %>

View File

@ -0,0 +1,100 @@
<div style="width:400px" 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="mt10 ml30">
<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" />
<input nhname="tag" nh_tag_5="true" class="fl" id="school_id" name="school_id" style="display:none;" type="text"/> <!-- 单位名称的test框选中下拉列表框的id -->
<div class="cl"></div>
<span class="color-orange fl none" id="school_id_notice" style="margin-left:20%;"><i class="fa fa-exclamation-circle mr5" ></i>请选择单位</span>
</div>
<div id="search_school_result_list" style="width: 260px;line-height: 1.5;min-height:20px; max-height: 200px; height: auto !important;display:none;background: white;overflow: scroll;border: solid 1px #cccccc; overflow-x: hidden; overflow-y: auto;">
</div>
<div class="mt10 ml30">
<span class="fl font-16 color-grey mr10 mt3 ">子单位名称:</span><input class="task-height-40 panel-box-sizing fl" type="text" placeholder="请输入子单位名称" style="width: 260px" name="add_department" />
<div class="cl"></div>
<span class="color-orange fl none" id="add_department_notice" style="margin-left:20%;"><i class="fa fa-exclamation-circle mr5" ></i>请输入子单位名称</span>
</div>
<div class="cl"></div>
<div id="schools_list" class="mt10 mb20 ml40 mr40">
</div>
<span id="choose_courses_notice" class="c_red"></span>
<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="school_submit();" class="task-btn task-btn-blue fr" >确定</a>
</div>
<div class="cl"></div>
</div>
<script type="text/javascript">
$("input[name='school']").on('input', function (e) {
throttle(department_search_fn, window, e);
});
var d_lastSearchCondition = '';
var d_page = 1; //唯一控制页码 变量
var d_count = 0; //查询结果的总量
var d_maxPage = 0;//最大页面值
function department_search_fn(e) {
if($(e.target).val().trim() == ''){
$("#search_school_result_list").hide();
$("input[name='school_id']").val("");
return;
}
if ($(e.target).val().trim() == d_lastSearchCondition && $(e.target).val().trim() != '') {//如果输入框没有改变或者输入框为空就返回
return;
}
d_lastSearchCondition = $(e.target).val().trim();
page = 1; //有新的搜索页面重置为1
$.ajax({
url: '<%= url_for(:controller => 'school',:action => 'on_search') %>' + '?name=' + e.target.value + '&school_id=' + $("input[name='occupation']").val() + '&page=' + d_page,
type: 'post',
success: function (data) {
d_schoolsResult = data.schools;
count = data.count;
maxPage = Math.ceil(count / 100); //最大页码值
if (d_schoolsResult.length != undefined && d_schoolsResult.length != 0) {
var i = 0;
$("#search_school_result_list").html('');
for (; i < d_schoolsResult.length; i++) {
link = '<a onclick="window.changeSchoolValue(\'' + d_schoolsResult[i].school.name.replace(/\s/g, " ") + '\',\'' + d_schoolsResult[i].school.id + '\')" href="javascript:void(0)">' + d_schoolsResult[i].school.name + '</a><br/>';
$("#search_school_result_list").append(link);
}
$("#search_school_result_list").css('left',108);
$("#search_school_result_list").css('top',113);
$("#search_school_result_list").css("position", "absolute");
$("#search_school_result_list").show();
} else {
$("#search_school_result_list").css('left', 108);
$("#search_school_result_list").css('top',113);
$("#search_school_result_list").css("position", "absolute");
$("#search_school_result_list").html('你的学校不在列表中?请确认后输入');
$("#search_school_result_list").show();
}
}
});
}
function changeSchoolValue(value, data) {
$("input[name='school']").val(value);
$("input[name='school_id']").val(data);
$("#search_school_result_list").hide();
};
function school_submit(){
var school=$("input[name='school_id']").val();
var department=$("input[name='add_department']").val()
// console.log(school ,department);
if($("input[name='school']").val() == ""){
$("#school_id_notice").show();
} else if($("input[name='add_department']").val() ==""){
$("#add_department_notice").show();
}else{
$.ajax({
url: '/managements/add_department',
type: 'post',
dataType: 'script',
data:{school:school,department:department}
});
hideModal();
}
}
</script>

View File

@ -2,22 +2,31 @@
<thead>
<tr>
<th width="9%">序号</th>
<th width="30%" class="edu-txt-left">部门名称</th>
<th width="15%">用户数</th>
<th width="15%">已认证职业</th>
<th width="20%" class="edu-txt-left">部门名称</th>
<th width="20%" class="edu-txt-left">单位名称</th>
<th width="10%">用户数</th>
<th width="10%">已认证职业</th>
<th width="20%" class="eud-pointer">创建于<i class="fa <%= @sx_order == "desc" ? "fa-long-arrow-down" : "fa-long-arrow-up" %> color-light-green ml5" title=""></i></th>
<th></th>
</tr>
</thead>
<tbody>
<% @department.each do |department| %>
<tr>
<td><%=department.id %></td>
<% @department.each_with_index do |department,index| %>
<tr id="apply_add_department_<%= department.id %>">
<td><%= index + 1 %></td>
<td class="edu-txt-left"><%= department.name %></td>
<td><%= UserExtensions.where(:department_id => department.id).count %></td>
<td>3</td>
<td class="edu-txt-left"><%= School.where(:id => department.school_id).first %></td>
<td><%= UserExtensions.where(:department_id => department.id,:school_id => department.school_id ).count %></td>
<td><%= ApplyUserAuthentication.where(:auth_type => 2,:user_id =>UserExtensions.where(:department_id => department.id,:school_id => department.school_id).map(&:user_id)).count%></td>
<td><%= format_time department.created_at %></td>
<td><a href="javascript:void(0);"><i class="fa fa-edit font-16"></i> 修改</a></td>
<td>
<% if UserExtensions.where(:department_id => department.id,:school_id => department.school_id ).count == 0 %>
<a href="javascript:void(0);" onclick="delete_confirm_box_2('<%= department_path(department.department_id) %>', '确定要删除该部门吗?')">删除&nbsp;</a>
<% else %>
--
<% end %>
<%= link_to '更改', update_department_managements_path(:school_id=> department.school_id,:department_id => department.department_id), :remote => true, :class => "application-default-link" %>
</td>
</tr>
<% end %>
</tbody>
@ -50,4 +59,10 @@
dateType: "script"
});
});
function alert_update_departments(){
/* var html = <%#= j (render :partial => '', :department => department) %>*/
}
</script>

View File

@ -25,7 +25,7 @@
</span>
</td>
<td><%= schools.province %></td>
<td class="edu-txt-left"><%= schools.address == nil ? "--" :schools.address %></td>
<td class="edu-txt-left"><%= schools.province == nil ? "--" :schools.province%><%= schools.city == nil ? "" :schools.city %><%= schools.address == nil ? "" :schools.address %></td>
<td><%= UserExtensions.where(:school_id => schools.id).count %></td>
<td><%= schools.departments.count %></td>
<td><%= format_time schools.created_at %></td>

View File

@ -0,0 +1,52 @@
<div style="width:400px" 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="mt10 ml10">
<input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入名称搜索" class="task-height-40 panel-box-sizing fl edu-txt-w320 ml30" style="padding: 2px 5px" />
</div>
<div class="cl"></div>
<div id="schools_list" class="mt10 mb20 ml40 mr40">
<%= render :partial => "managements/update_department_school", :locals => {:departments => departments, :edit_id => edit_id} %>
</div>
<span id="choose_courses_notice" class="color-red ml40"></span>
<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="school_submit();" class="task-btn task-btn-blue fr" >确定</a>
</div>
<div class="cl"></div>
</div>
<script type="text/javascript">
$("#search_course_input").on('input',function(e){
throttle(search_courses, window, e);
});
function school_submit() {
var checkboxs = $("input[name='department_id']:checked");
if(checkboxs.length == 0) {
$("#choose_courses_notice").text("请选择部门");
} else{
$("#choose_courses_notice").text("");
$("#schools_list_form").submit();
hideModal();
}
}
var lastSearchCondition = '';
var count = 0;
function search_courses(e){
if($(e.target).val().trim() == lastSearchCondition && lastSearchCondition != '')
{
return;
}
lastSearchCondition = $(e.target).val().trim();
$.ajax({
url: '<%= url_for(:controller => 'managements', :action => 'update_department') %>'+'?search='+ e.target.value+'&department_id=<%= edit_id %>',
type:'get',
data: {is_observe:true},
success: function(data){ },
beforeSend: function(){ $(this).addClass('ajax-loading'); },
complete: function(){ $(this).removeClass('ajax-loading'); }
});
}
</script>

View File

@ -5,7 +5,7 @@
<% department.each do |department| %>
<ul class="courseSend" >
<li class="" style="display:inline-block">
<input name="department_id[]" id="search_school_<%= department.id %>" type="radio" value="<%= department.id %>" class="courseSendCheckbox magic-radio"/>
<input name="department_id" id="search_school_<%= department.id %>" type="radio" value="<%= department.id %>" class="courseSendCheckbox magic-radio"/>
<label for="search_school_<%= department.id %>"><%= truncate(department.name, :lendght => 25)%></label>
</li>
</ul>

View File

@ -0,0 +1,24 @@
<%= form_tag edit_departments_school_managements_path(:alter_dep_id => edit_id), :id => 'schools_list_form' %>
<div>
<div class="courseReferContainer" >
<% if !departments.empty? && !@search.nil? %>
<% departments.each do |department| %>
<ul class="courseSend">
<li class="" style="display:inline-block">
<input name="department_id" id="search_school_<%= department.id %>" type="radio" value="<%= department.id %>" class="courseSendCheckbox magic-radio"/>
<label for="search_school_<%= department.id %>"><%= truncate(department.name, :lendght => 25)%></label>
</li>
</ul>
<% end %>
<% end %>
</div>
</div>
<div class="cl"></div>
<script>
$(function(){
var height=$(".courseReferContainer").height();
if (height>200){
$(".courseReferContainer").css({"height":"200px","overflow-y":"auto"});
}
})
</script>

View File

@ -6,7 +6,7 @@
<% schools.each do |school| %>
<ul class="courseSend">
<li class="" style="display:inline-block">
<input name="school_id[]" id="search_school_<%= school.id %>" type="radio" value="<%= school.id %>" class="courseSendCheckbox magic-radio"/>
<input name="school_id" id="search_school_<%= school.id %>" type="radio" value="<%= school.id %>" class="courseSendCheckbox magic-radio"/>
<label for="search_school_<%= school.id %>"><%= truncate(school.name, :lendght => 25)%></label>
</li>
</ul>

View File

@ -0,0 +1 @@
$("#managements_departments_list").html("<%= j( render :partial => "managements/departments_list" ) %>")

View File

@ -1,4 +1,4 @@
<% if params[:search].nil? %>
<% if params[:is_observe].nil? %>
var htmlvalue = " <%= escape_javascript( render :partial => 'managements/all_department', :locals => {:department => @department, :edit_id => @edit_id}) %>";
pop_box_new(htmlvalue, 400, 260);
<% else %>

View File

@ -1,4 +1,4 @@
<% if params[:search].nil? %>
<% if params[:is_observe].nil? %>
var htmlvalue = " <%= escape_javascript( render :partial => 'managements/all_schools', :locals => {:schools => @schools, :edit_id => @edit_id}) %>";
pop_box_new(htmlvalue, 400, 260);
<% else %>

View File

@ -0,0 +1,2 @@
var htmlvalue = "<%= escape_javascript( render :partial => 'managements/create_department') %>";
pop_box_new(htmlvalue, 400, 260);

View File

@ -3,7 +3,7 @@
<input class="fl task-form-20 task-height-30 ml35" id="shixun_Look_name" name="search" maxlength="" placeholder="输入关键字进行搜索" type="text" style="height: 21px;" onkeyup="myFunction()">
<a href="javascript:void(0);" class="fl task-btn task-btn-blue ml5 mt2" onclick="$('#department_search').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 mt6 mr30" >创建</a>
<%= link_to '创建',{:controller => 'managements', :action => 'create_departments'}, :remote => true, :class => "task-btn task-btn-green fr mt6 mr30" %>
<input name="sx_order" type="hidden"/>
</div>
<% end %>

View File

@ -126,7 +126,7 @@
}else{
type = 2;
}
alert(type);
// alert(type);
$.ajax({
url: "<%= trial_authorization_managements_path %>" +".js",
data: { search: iName, status: type}

View File

@ -0,0 +1,6 @@
<% if params[:is_observe].nil? %>
var htmlvalue = " <%= escape_javascript( render :partial => 'managements/update_department', :locals => {:departments => @departments, :edit_id => @edit_id }) %>";
pop_box_new(htmlvalue, 400, 260);
<% else %>
$("#schools_list").html("<%= escape_javascript(render :partial => 'managements/update_department_school', :locals => {:departments => @departments, :edit_id => @edit_id }) %>");
<% end %>

View File

@ -0,0 +1,5 @@
for(var i=0; i<$("#subject_shixun_<%= @school.id %>").nextAll().length; i++){
var index = parseInt($($("#subject_shixun_<%= @school.id %>").nextAll()[i]).children(":first").html());
$($("#subject_shixun_<%= @school.id %>").nextAll()[i]).children(":first").html(index - 1);
}
$("#subject_shixun_<%= @school.id %>").remove();

View File

@ -1,5 +1,5 @@
<% if @mail %>
sure_box_redirect('#{security_settings_path}', '开启实训,请先绑定邮箱');
sure_box_redirect('<%= security_settings_path %>', '开启实训,请先绑定邮箱');
<% else %>
<% if @is_modify.blank? %>
//为了防止浏览器阻挡,在实训路径中需要弹出新的页面,而实训首页又不需要弹出新的页面

View File

@ -49,8 +49,8 @@
</li>
<% end %>
<% if @is_teacher %>
<div class="fr edu-position edu-position-hidebox mr15 mt8">
<a href="javascript:void(0);" class="font-16"><i class="fa fa-bars mr15 mt20"></i></a>
<div class="fr edu-position edu-position-hidebox mr10 mt8">
<a href="javascript:void(0);" class="font-16"><i class="fa fa-bars mr10"></i></a>
<ul class="edu-position-hide undis" style="left:-85px;">
<% if @homework.homework_type != 4 %>
<li>

View File

@ -154,7 +154,7 @@
<div style="text-align: center">
<p style="line-height: 15px;width:50%;margin:0px auto" class="bor-top-greyE pt40"><%= image_tag(url_to_avatar(user), :width =>"80", :height => "80", :class => "bor-radius-all", :alt=>"头像") %></p>
<p><%= user.try(:show_name) %></p>
<p style="line-height: 19px" class="color-dark-grey font-12"><%= user.school_name + user.identity %></p>
<p style="line-height: 19px" class="color-dark-grey font-12"><%= user.school_name %></p>
</div>
<!--<pre class="pre_word mb10 color-dark-grey produce justify clearfix font-15" style="color: #666;font-family: '微软雅黑','宋体';"><span class="color-black"><%#= user.try(:show_name) %></span><%#= user.user_extensions.brief_introduction.blank? ? "这家伙很懒,什么都没有留下" : user.user_extensions.brief_introduction %></pre>-->
</div>

View File

@ -5,7 +5,10 @@
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo break_word">
<div class="homepagePostTitle break_word" >
<%= link_to activity.filename, course_files_path(activity.course), :class => "color-dark" %>
</div>
<div class="homepagePostTo break_word fl" style="margin:0px">
<% if activity.try(:author).show_real_name == ' ' %>
<%= link_to activity.try(:author).show_real_name, user_path(activity.author_id), :class => "newsBlue mr15" %>
<% else %>
@ -14,10 +17,8 @@
TO
<%= link_to "班级资源", course_files_path(activity.course), :class => "newsBlue ml15" %>
</div>
<div class="homepagePostTitle break_word" >
<%= link_to activity.filename, course_files_path(activity.course), :class => "postGrey" %>
</div>
<div class="homepagePostSubmitContainer">
<div class="homepagePostSubmitContainer fr" style="margin:0px">
<div class="homepagePostDeadline mr15">
文件大小:
<%= number_to_human_size activity.filesize%>

View File

@ -5,7 +5,10 @@
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.teacher} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo break_word">
<div class="homepagePostTitle break_word" >
<%= link_to activity.name, course_path(activity.id,:host=>Setting.host_course), :class => "color-dark" %>
</div>
<div class="homepagePostTo break_word fl">
<% if activity.try(:teacher).show_real_name == ' ' %>
<%= link_to activity.try(:teacher), user_path(activity.teacher), :class => "newsBlue mr15" %>
<% else %>
@ -15,10 +18,8 @@
<% str = defined?(is_course) && is_course == 1 ? "班级" : "#{activity.name.to_s} | 班级" %>
<%= link_to str, course_path(activity.id,:host=>Setting.host_course), :class => "newsBlue ml15" %>
</div>
<div class="homepagePostTitle break_word" >
<%= link_to activity.name, course_path(activity.id,:host=>Setting.host_course), :class => "postGrey" %>
</div>
<div class="homepagePostDate">
<div class="homepagePostDate fr">
创建时间:<%= format_time(activity.created_at) %>
</div>
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">

View File

@ -6,6 +6,25 @@
<%#= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTitle fl "> <!--+"(作业名称)"-->
<% if hw_status == 3 || hw_status == 5 %>
<% index = get_hw_index(activity, is_teacher) %>
<%= link_to "<span class='fontBlue2'>作业#{index+1}</span>".html_safe+activity.name,student_work_index_path(:homework => activity.id),:class => "color-black edu-txt-850"%>
<% else %>
<%= link_to activity.name.to_s, student_work_index_path(:homework => activity.id,:host=> Setting.host_course), :class => "color-black edu-txt-850"%>
<% end %>
</div>
<% homework_curr_status = homework_curr_time(activity) %>
<% if homework_curr_status[:status] != "" %>
<span class="edu-filter-btn <%= homework_status_color homework_curr_status[:status] %> ml10 fl mt3"><%= homework_curr_status[:status] %></span>
<% end %>
<% if activity.homework_detail_manual.try(:comment_status) != 0 && activity.homework_detail_manual.try(:comment_status) != 6 %>
<% allow_late = activity.allow_late ? '已开启补交' : '未开启补交' %>
<span class="edu-filter-btn <%= homework_status_color allow_late %> ml10 fl mt3"><%= allow_late %></span>
<% end %>
<div class="cl"></div>
<div class="homepagePostTo break_word">
<%= link_to activity.user.show_real_name, user_path(activity.user,:host=>Setting.host_user), :class => "newsBlue mr15" %>
TO <!--+"(课程名称)" -->
@ -15,24 +34,7 @@
<%= link_to activity.course.name.to_s+" | #{activity.homework_type_ch}作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course, :homework_type => activity.homework_type), :class => "newsBlue ml15"%>
<% end %>
</div>
<div class="homepagePostTitle fl "> <!--+"(作业名称)"-->
<% if hw_status == 3 || hw_status == 5 %>
<% index = get_hw_index(activity, is_teacher) %>
<%= link_to "<span class='fontBlue2'>作业#{index+1}</span>".html_safe+activity.name,student_work_index_path(:homework => activity.id),:class => "postGrey edu-txt-850"%>
<% else %>
<%= link_to activity.name.to_s, student_work_index_path(:homework => activity.id,:host=> Setting.host_course), :class => "postGrey edu-txt-850"%>
<% end %>
</div>
<% homework_curr_status = homework_curr_time(activity) %>
<% if homework_curr_status[:status] != "" %>
<span class="edu-filter-btn <%= homework_status_color homework_curr_status[:status] %> ml10 fl mt3"><%= homework_curr_status[:status] %></span>
<% end %>
<% if activity.homework_detail_manual.try(:comment_status) != 0 && activity.homework_detail_manual.try(:comment_status) != 6 %>
<% allow_late = activity.allow_late ? '已开启补交' : '未开启补交' %>
<span class="edu-filter-btn <%= homework_status_color allow_late %> ml10 fl mt3"><%= allow_late %></span>
<% end %>
<div class="cl"></div>
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1%>
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name, :course_id => activity.course_id),:target => "_blank",:class=>"linkBlue",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
<% elsif activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 0%>
@ -41,7 +43,7 @@
<div class="homepagePostSubmitContainer">
<%= render :partial => 'users/homework_opr', :locals => {:activity => activity, :is_teacher => is_teacher, :hw_status => hw_status, :user_activity_id => user_activity_id} %>
<% if !activity.end_time.nil? %>
<div class="homepagePostDeadline">提交截止时间:<%= format_time activity.end_time %></div>
<div class="homepagePostDeadline fr">提交截止时间:<%= format_time activity.end_time %></div>
<% end %>
<% if activity.homework_detail_manual.comment_status == 0 && !activity.publish_time.nil? %>
<div class="homepagePostDeadline ml15">

View File

@ -5,17 +5,11 @@
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo break_word">
<%= link_to activity.author.show_real_name, user_path(activity.author, :host=>Setting.host_user), :class => "newsBlue mr15" %>
TO
<% str = is_course == 1 ? "#{activity.board.parent.nil? ? '班级讨论区' : activity.board.name}" : activity.course.name.to_s+" | #{activity.board.parent.nil? ? '班级讨论区' : activity.board.name}" %>
<%= link_to str, course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15"%>
</div>
<div class="homepagePostTitle fl">
<div class="homepagePostTitle fl">
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "postGrey edu-txt-850" %>
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "color-black edu-txt-850" %>
<% else %>
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "postGrey edu-txt-850 " %>
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "color-black edu-txt-850 " %>
<% end %>
</div>
<% if activity.sticky == 1 %>
@ -25,10 +19,17 @@
<span class="locked_btn_cir ml10 fl" title="已锁定">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
<% end %>
<div class="cl"></div>
<div class="homepagePostDate fl">
发帖时间:<%= format_time(activity.created_on) %>
<div class="homepagePostTo break_word fl">
<%= link_to activity.author.show_real_name, user_path(activity.author, :host=>Setting.host_user), :class => "newsBlue mr15" %>
TO
<% str = is_course == 1 ? "#{activity.board.parent.nil? ? '班级讨论区' : activity.board.name}" : activity.course.name.to_s+" | #{activity.board.parent.nil? ? '班级讨论区' : activity.board.name}" %>
<%= link_to str, course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15"%>
</div>
<div class="homepagePostDate fl ml15">
<!--<div class="homepagePostDate fl">
发帖时间:<%#= format_time(activity.created_on) %>
</div>-->
<div class="homepagePostDate fr ml15">
更新时间:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %>
</div>
<div class="cl"></div>

View File

@ -9,7 +9,7 @@
</li>
</ul>
<div id="edu-tab-con-1" class="box_bg_shandow bor-grey-e">
<div id="edu-tab-con-1" class="box_bg_shandow">
<% if @user_watchlist_count > 12 %>
<a href="<%= user_watchlist_user_path(@user) %>" target="_blank" class="font-12 color-grey fr mr20 mt5" style="cursor: pointer">查看全部</a>
<% end %>
@ -33,7 +33,7 @@
</div>
<% end %>
</div>
<div id="edu-tab-con-2" class="undis box_bg_shandow bor-grey-e" >
<div id="edu-tab-con-2" class="undis box_bg_shandow" >
<% if @user_fanlist_count > 12 %>
<a href="<%= user_fanslist_user_path(@user) %>" target="_blank" class="font-12 color-grey fr mr20 mt5" style="cursor: pointer">查看全部</a>
<% end %>

View File

@ -1,39 +1,39 @@
<div class="mh550">
<% if @user_experiences.blank? %>
<div class="edu-tab-con-box" style="text-align: center">
<img class="edu-nodata-img" src="/images/edu_user/edu-nodata.png"/>
<p class="edu-nodata-p mb30">您还没有获得过经验值哦~</p>
<% if @user_experiences.blank? %>
<div class="edu-tab-con-box" style="text-align: center">
<img class="edu-nodata-img" src="/images/edu_user/edu-nodata.png"/>
<p class="edu-nodata-p mb30">您还没有获得过经验值哦~</p>
</div>
<% else %>
<table class="edu-pop-table-all" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th width="15%">操作</th>
<th width="15%">变更</th>
<th width="55%">详情</th>
<th width="15%">操作时间</th>
</tr>
</thead>
<tbody>
<% @user_experiences.each do |exp| %>
<tr>
<td class="pl10">闯关</td>
<td>+ <%= exp.score %></td>
<% game = Game.where(:id => exp.container_id).first %>
<td><%= game ? "通过实训“#{game.challenge.shixun.name}”的第#{game.challenge.position}关获得的奖励" : "--" %></td>
<td><%= format_time exp.created_at %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
<div class="cl"></div>
<div style="text-align:center;" class="new_expand">
<div class="pages_user_show" style="width:auto; display:inline-block;margin: 18px 0;">
<ul>
<%= pagination_links_full @experiences_pages, @experiences_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
</ul>
<div class="cl"></div>
</div>
<% else %>
<table class="edu-pop-table-all" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th width="15%">操作</th>
<th width="15%">变更</th>
<th width="55%">详情</th>
<th width="15%">操作时间</th>
</tr>
</thead>
<tbody>
<% @user_experiences.each do |exp| %>
<tr>
<td class="pl10">闯关</td>
<td>+ <%= exp.score %></td>
<% game = Game.where(:id => exp.container_id).first %>
<td><%= game ? "通过实训“#{game.challenge.shixun.name}”的第#{game.challenge.position}关获得的奖励" : "--" %></td>
<td><%= format_time exp.created_at %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
<div class="cl"></div>
<div style="text-align:center;" class="new_expand">
<div class="pages_user_show" style="width:auto; display:inline-block;margin: 18px 0;">
<ul>
<%= pagination_links_full @experiences_pages, @experiences_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
</ul>
<div class="cl"></div>
</div>
</div>
<% end %>
</div>
<% end %>

View File

@ -20,7 +20,7 @@
</li>
</ul>
<div class="new-tab-con new-tab-con-1 pt15 pl15 pr15 pb15 white_bg shadow_border" style="border-top: none;" id="growth_record_content">
<%= render :partial => "users/user_experience" %>
<%#= render :partial => "users/user_experience" %>
</div>
</div>
<style>body{background-color: #FFFFFF}</style><!--后续会删除-->

View File

@ -90,10 +90,10 @@
</div>
<ul class="task-index-list-box-bottom clearfix">
<li>
<i class="fa fa-gamepad mr5 color-light-green" data-tip-down="实训任务"></i><span><%= shixun.challenges.count %></span>
<i class="fa fa-tasks mr5 color-light-green" data-tip-down="实训任务"></i><span><%= shixun.challenges.count %></span>
</li>
<li>
<i class="fa fa-users mr5 color-light-green" data-tip-down="已开启实训"></i><span><%= shixun.myshixuns.count %></span>
<i class="fa fa-users mr5 color-light-green" data-tip-down="学习人数"></i><span><%= shixun.myshixuns.count %></span>
</li>
<li>
<i class="fa fa-viacoin mr5 color-light-green" data-tip-down="实训经验值"></i><span><%= shixun.shixun_score %></span>

View File

@ -103,7 +103,7 @@
<!--<%#= link_to '编辑我的资料', my_account_path %>-->
<!--</p>-->
<p class="p2 font-12 mt12">
<p class="p2 font-12 mt5">
<i class="fa fa-eye font-12" aria-hidden="true"></i>
<% update_visiti_count @user %>
<span><%= @user.visits.to_i %></span> 次访问
@ -140,13 +140,13 @@
</div>
<% else %>
<div class="itnew">
<p class="p2 font-14 mt10 mb10">
<p class="p2 font-12 mt10 mb10">
<i class="fa fa-eye" aria-hidden="true"></i>
<span><%= @user.visits.to_i %></span> 次访问
</p>
<p class="sub clearfix">
<a href="<%= feedback_path(@user, :host=> Setting.host_user) %>" class="fr font-14 ml10 link-color-orange">给TA留言</a>
<a href="<%= feedback_path(@user, :host=> Setting.host_user) %>" class="fr font-14 ml10 link-color-orange">给TA留言</a>
<% if(@user.watched_by?(User.current)) %>
<%= link_to "已关注",
watch_path(:object_type => 'user', :object_id => @user.id, :target_id => @user.id),
@ -163,6 +163,8 @@
:remote => "true",
:title => "添加关注" %>
<% end %>
<span class="fr mr20 color-grey-8 mt3">经验值 <span class="ml5 color-orange03"><%= @user.experience %></span> </span>
<span class="fr mr20 color-grey-8 mt3">金币<span class="ml5 color-orange03"><%= @user.grade %></span></span>
</p>
<!--<div class="alert">-->
@ -212,7 +214,7 @@
</li>
</ul>
<div class="box_bg_shandow bor-grey-e">
<div class="box_bg_shandow">
<div style="margin-left: 28px;height: 70px">
<a href="<%= shixuns_or_courses_filter_user_path(@user, :index => "shixun", :filter => "all") %>" data-remote="true" class="user_course_filtrate fl mt20 mr30"><span class="user_filtrate_span1 user_filtrate_span1_bg">全部</span><span class="user_filtrate_span2 user_filtrate_span2_bg ml10"><%= @shixuns_count %></span></a>
<a href="<%= shixuns_or_courses_filter_user_path(@user, :index => "shixun", :filter => "create") %>" class="user_course_filtrate fl mt20 mr30" data-remote="true"><span class="user_filtrate_span1"><%= str %>创建的</span><span class="user_filtrate_span2 ml10"><%= @create_num %></span></a>

View File

@ -222,6 +222,10 @@ RedmineApp::Application.routes.draw do
delete 'delete_applied_schools'
match 'new_major', :via => [:get, :post]
post 'insert_major'
match 'update_department',:via => [:get, :post]
post 'edit_departments_school'
get 'create_departments'
post 'add_department'
get 'shixun_feedback'
end
end

View File

@ -431,13 +431,13 @@ function code_evaluation(test_sets,
"<li class=\"clearfix\">" +
"<div class=\"clearfix\">" +
" <span class=\"-task-ces-info-left color-blue fl fb\">预期输出:</span>" +
"<p class=\"fl\">" + ( test_sets[i].output == null ? "空" : test_sets[i].output.replace(/\r\n/g, "<br>") ) + "</p>" +
"<p class=\"fl\">" + ( test_sets[i].output == null ? "空" : test_sets[i].output.replace(/\r\n/g, "<br>").replace(/ /g, "<span class=\"empty\"></span>") ) + "</p>" +
"</div>" +
"</li>" +
"<li class=\"clearfix\">" +
"<div class=\"clearfix\">" +
"<span class=\"-task-ces-info-left color-blue fl fb\">实际输出:</span>" +
"<p class=\"fl color-orange\">" + (test_sets[i].actual_output == null ? "空" : test_sets[i].actual_output.replace(/\r\n/g, "<br>")) + "</p>" +
"<p class=\"fl color-orange\">" + (test_sets[i].actual_output == null ? "空" : test_sets[i].actual_output.replace(/\r\n/g, "<br>").replace(/ /g, "<span class=\"empty\"></span>")) + "</p>" +
"</div>" +
"</li>" +
"</ul>" +

View File

@ -135,7 +135,7 @@ a:hover.edu-class-right-add{ background-color: rgba(0, 0, 0, 0.4);}
.stud-class-container .con-content ul li{position:relative;}
.stud-class-container .con-content ul li .tig{position:absolute;top:20px;left:110%;width:200px;height:40px;line-height:40px;}
.stud-class-container .con-content ul li .tusi{position:absolute;top:20px;left:120%;width:450px;}
.stud-class-container .con-content ul li .tusi .entry {background-color: #FFFEF4;height: 40px;line-height: 40px;border: 1px solid #F3DDB3;width:400px;margin:0 auto;position:relative;
.stud-class-container .con-content ul li .tusi .entry {background-color: #FFFEF4;line-height: 40px;border: 1px solid #F3DDB3;width:400px;margin:0 auto;position:relative;
text-indent:10px;}
.stud-class-container .con-content ul li .tusi .entry em,.after{display: block;border-width: 9px;
position: absolute;top: 10px;left: -18px;border-style: dashed solid dashed dashed;border-color: transparent #F3DDB3 transparent transparent;font-size: 0;line-height: 0;}

View File

@ -367,3 +367,4 @@ input::-ms-input-placeholder,textarea::-ms-input-placeholder {color:#cccccc;}
.down-select{display:none;position: absolute;z-index: 10;left: 0px;width: 100%;overflow-y: auto;background: #fff;max-height: 200px;}
.down-select p{height: 35px;line-height: 35px;padding-left: 5px;}
.down-select p:hover{background: #f3f4f6}

View File

@ -412,4 +412,4 @@ html>body #ajax-indicator-base { position: fixed; }
.save-tip{display:none;position: fixed;top:0px;left: 0px;width: 100%;height: 100%;}
.save-tip-content{position: absolute;top:50%;left: 50%;margin-left: -36px;margin-top:-19px;background: rgba(0,0,0,0.7);color:#fff;padding:5px 15px;border-radius: 4px}
.empty{font-family: Consolas;background: #494A4C;display: inline; margin: 0 2px; padding: 0 3px;}