Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
This commit is contained in:
commit
bfdfde8028
|
@ -2351,7 +2351,7 @@ module ApplicationHelper
|
|||
def user_for_homework_common homework,is_teacher
|
||||
if User.current.member_of_course?(homework.course)
|
||||
if is_teacher #老师显示作品数量
|
||||
link_to "提交(#{homework.student_works.count})",student_work_index_path(:homework => homework.id),:class => "c_blue"
|
||||
link_to "作品(#{homework.student_works.count})",student_work_index_path(:homework => homework.id),:class => "c_blue"
|
||||
else #学生显示提交作品、修改作品等按钮
|
||||
work = cur_user_works_for_homework homework
|
||||
if work.nil?
|
||||
|
@ -2367,7 +2367,7 @@ module ApplicationHelper
|
|||
end
|
||||
end
|
||||
else
|
||||
link_to "提交(#{homework.student_works.count})",student_work_index_path(:homework => homework.id),:class => "c_blue"
|
||||
link_to "作品(#{homework.student_works.count})",student_work_index_path(:homework => homework.id),:class => "c_blue"
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -527,7 +527,7 @@
|
|||
}
|
||||
function changeValue(value,data){
|
||||
//console.log(value+","+data)
|
||||
$("input[name='province']").val(value);
|
||||
$("input[name='province']").val(value);
|
||||
$("input[name='occupation']").val(data);
|
||||
$("#search_school_result_list").hide();
|
||||
$("#hint").hide();
|
||||
|
@ -570,7 +570,7 @@
|
|||
var i = 0;
|
||||
$("#search_school_result_list").html('');
|
||||
for (; i < data.length; i++) {
|
||||
link = '<a onclick="window.changeValue(\'' + data[i].school.name + '\',\'' + data[i].school.id + '\')" href="javascript:void(0)">' + data[i].school.name + '</a><br/>';
|
||||
link = '<a onclick="window.changeValue(\'' + data[i].school.name.replace(/\s/g," ") + '\',\'' + data[i].school.id + '\')" href="javascript:void(0)">' + data[i].school.name + '</a><br/>';
|
||||
$("#search_school_result_list").append(link);
|
||||
}
|
||||
$("#search_school_result_list").css('left', $(e.target).offset().left);
|
||||
|
@ -601,7 +601,10 @@
|
|||
}
|
||||
})
|
||||
$("input[name='province']").on('focus', function (e) {
|
||||
if($(e.target).val() == ''){
|
||||
if($(e.target).val() == ''){ //
|
||||
return;
|
||||
}
|
||||
if( $("input[name='occupation']").val() != ''){ //如果已经有id了。肯定存在,不用去找了。
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
|
@ -612,7 +615,7 @@
|
|||
var i = 0;
|
||||
$("#search_school_result_list").html('');
|
||||
for (; i < data.length; i++) {
|
||||
link = '<a onclick="window.changeValue(\'' + data[i].school.name + '\',\'' + data[i].school.id + '\')" href="javascript:void(0)">' + data[i].school.name + '</a><br/>';
|
||||
link = '<a onclick="window.changeValue(\'' + data[i].school.name.replace(/\s/g," ") + '\',\'' + data[i].school.id + '\')" href="javascript:void(0)">' + data[i].school.name + '</a><br/>';
|
||||
$("#search_school_result_list").append(link);
|
||||
}
|
||||
$("#search_school_result_list").css('left', $(e.target).offset().left);
|
||||
|
@ -658,8 +661,10 @@
|
|||
<% if( !@act.nil? && @act == 'password') %>
|
||||
$("#users_tb_2").click();
|
||||
<% end %>
|
||||
$('#my_account_form_link').click(function(){
|
||||
$('#my_account_form_link').click(function(e){
|
||||
if( $("input[name='province']").val().trim() != '' && $("input[name='occupation']").val().trim() == ''){ //学校名字和id不对的话
|
||||
$("#hint").html('<span style="color:red">学校必须是从下拉列表中选择的,不能手动修改</span>').show();
|
||||
e.stopImmediatePropagation();
|
||||
return;
|
||||
}
|
||||
$('#my_account_form_btn').click();
|
||||
|
|
Loading…
Reference in New Issue