Merge branch 'develop' into szzh
This commit is contained in:
commit
1ac206eb74
|
@ -4,7 +4,7 @@
|
|||
<span class="c_red">*</span>
|
||||
<%= l(:field_name)%>:
|
||||
</label>
|
||||
<input type="text" name="homework_common[name]" id="homework_name" class="w548 h26 fl" maxlength="<%= Bid::NAME_LENGTH_LIMIT%>" onkeyup="regex_homework_name();" value="<%= homework.name%>" >
|
||||
<input type="text" name="homework_common[name]" id="homework_name" class="w548 h26 fl" maxlength="255" onkeyup="regex_homework_name();" value="<%= homework.name%>" >
|
||||
<p id="homework_name_span" class="c_red ml110"></p>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<div class="invi_search">
|
||||
<input hidden="hidden" value="true" name="flag">
|
||||
<input id="principal_search" class="invi_search_input fl" type="text" placeholder=<%= l(:label_invite_trustie_user_tips) %>>
|
||||
<a class="invi_search_btn fl" onclick="observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js',:flag => true) }')">搜索</a>
|
||||
<a class="invi_search_btn fl" onclick="observeSearchfield('principal_search', null, '<%= escape_javascript autocomplete_project_memberships_path(@project, :format => 'js',:flag => true)%> ')">搜索</a>
|
||||
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js',:flag => true) }')" %>
|
||||
<div class="cl"></div>
|
||||
<div id="principals_for_new_member">
|
||||
|
@ -48,7 +48,7 @@
|
|||
<% end %>
|
||||
</ul>
|
||||
<div class="cl mb10"></div>
|
||||
<a href="#" class="btn_free" onclick="$('#new_membership').submit();">
|
||||
<a href="javascript:void(0)" class="btn_free" onclick="submit_invite_members()">
|
||||
<%= l(:label_invite_members)%>
|
||||
</a>
|
||||
</div>
|
||||
|
@ -67,37 +67,39 @@
|
|||
var text=$(label).text();
|
||||
$(label).attr("title",text);
|
||||
}
|
||||
|
||||
function nh_show_err_message(msg){
|
||||
$("#RSide>.flash").remove();
|
||||
$("#RSide").prepend('<div class="flash error" id="flash_error">'+msg+'</div>');
|
||||
}
|
||||
$('#new_membership').submit(function(){
|
||||
var user_ischeck=false;
|
||||
$("input[name='membership[user_ids][]']").each(function(){
|
||||
if($(this).prop('checked')){
|
||||
user_ischeck=true;
|
||||
}
|
||||
});
|
||||
var role_ischeck=false;
|
||||
$("input[name='membership[role_ids][]']").each(function(){
|
||||
if($(this).prop('checked')){
|
||||
role_ischeck=true;
|
||||
}
|
||||
});
|
||||
if(user_ischeck==false && role_ischeck==false){
|
||||
nh_show_err_message('请选择用户和角色!');
|
||||
return false;
|
||||
}
|
||||
if(user_ischeck==false){
|
||||
nh_show_err_message('请选择用户!');
|
||||
return false;
|
||||
}
|
||||
if(role_ischeck==false){
|
||||
nh_show_err_message('请选择角色!');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
});
|
||||
|
||||
function nh_show_err_message(msg){
|
||||
$("#RSide>.flash").remove();
|
||||
$("#RSide").prepend('<div class="flash error" id="flash_error">'+msg+'</div>');
|
||||
}
|
||||
|
||||
function submit_invite_members()
|
||||
{
|
||||
var user_ischeck=false;
|
||||
$("input[name='membership[user_ids][]']").each(function(){
|
||||
if($(this).prop('checked')){
|
||||
user_ischeck=true;
|
||||
}
|
||||
});
|
||||
var role_ischeck=false;
|
||||
$("input[name='membership[role_ids][]']").each(function(){
|
||||
if($(this).prop('checked')){
|
||||
role_ischeck=true;
|
||||
}
|
||||
});
|
||||
if(user_ischeck==false && role_ischeck==false){
|
||||
nh_show_err_message('请选择用户和角色!');
|
||||
return false;
|
||||
}
|
||||
if(user_ischeck==false){
|
||||
nh_show_err_message('请选择用户!');
|
||||
return false;
|
||||
}
|
||||
if(role_ischeck==false){
|
||||
nh_show_err_message('请选择角色!');
|
||||
return false;
|
||||
}
|
||||
$('#new_membership').submit();
|
||||
}
|
||||
</script>
|
|
@ -1,5 +1,5 @@
|
|||
<li class="hwork_num ">
|
||||
<a href="javascript:void(0);" class=" f14 f_b c_dark fl" >学号</a>
|
||||
<span class="c_dark f14 fb fl">学号</span>
|
||||
</li>
|
||||
<li class=" hwork_name f14 fb c_dark">
|
||||
学生姓名
|
||||
|
|
Loading…
Reference in New Issue