commit
27ed6df9d6
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,4 @@
|
||||
class HomeworkDetailGroup < ActiveRecord::Base
|
||||
belongs_to :homework_common
|
||||
attr_accessible :base_on_project, :homework_common_id, :max_num, :min_num
|
||||
end
|
@ -0,0 +1,7 @@
|
||||
class StudentWorkProject < ActiveRecord::Base
|
||||
# attr_accessible :title, :body
|
||||
belongs_to :homework_common
|
||||
belongs_to :student_work
|
||||
belongs_to :project
|
||||
belongs_to :user
|
||||
end
|
@ -0,0 +1,96 @@
|
||||
<div id="popbox02">
|
||||
<div>
|
||||
<div class="relateText fl">请添加小组成员</div>
|
||||
</div>
|
||||
<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="clickCanel();"></a></div>
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<form class="resourcesSearchBox">
|
||||
<input type="text" name="serach" placeholder="输入关键字搜索" class="searchResourcePopup" />
|
||||
</form>
|
||||
</div>
|
||||
<ul class="addMemberC fl" id="all_students_list"></ul>
|
||||
<div class="rightArrow"><img src="/images/course/right-arrow.png" width="16" height="30" /></div>
|
||||
<ul class="addMemberC fr" id="choose_students_list">
|
||||
<li id="choose_student_<%=User.current.id %>"><%=User.current.show_name %>
|
||||
<% unless User.current.user_extensions.student_id == "" %>
|
||||
(<%=User.current.user_extensions.student_id %>)
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<div class="courseSendCancel mr15" style="float:right;"><a href="javascript:void(0);" class="sendSourceText" onclick="clickCanel();">取消</a></div>
|
||||
<div class="courseSendSubmit" style="float:right;"><a href="javascript:void(0);" class="sendSourceText" onclick="clickOK()">确定</a></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var lastSearchCondition = '';
|
||||
var count = 0;
|
||||
function search_stus(e){
|
||||
if($(e.target).val().trim() == lastSearchCondition && lastSearchCondition != '')
|
||||
{
|
||||
return;
|
||||
}
|
||||
lastSearchCondition = $(e.target).val().trim();
|
||||
$.ajax({
|
||||
url: '<%= url_for(:controller => 'student_work', :action => 'search_course_students') %>'+'?name='+ e.target.value+'&homework='+<%=@homework.id %>,
|
||||
type:'get'
|
||||
});
|
||||
}
|
||||
|
||||
function throttle(method,context,e){
|
||||
clearTimeout(method.tId);
|
||||
method.tId=setTimeout(function(){
|
||||
method.call(context,e);
|
||||
},500);
|
||||
}
|
||||
|
||||
//查询
|
||||
$("input[name='serach']").on('input', function (e) {
|
||||
throttle(search_stus,window,e);
|
||||
});
|
||||
|
||||
function clickOK() {
|
||||
var str="";
|
||||
var show = "合作成员:";
|
||||
var lists = $("#choose_students_list li");
|
||||
if(lists.length > 0) {
|
||||
for(var i=0; i<lists.length; i++) {
|
||||
var id = $(lists[i]).attr("id").replace(/[^0-9]/ig,"");
|
||||
str += id;
|
||||
var show_name = $(lists[i]).html();
|
||||
var index = show_name.indexOf("(");
|
||||
if (index != -1) {
|
||||
var name = show_name.substring(0,show_name.indexOf("("));
|
||||
} else {
|
||||
var name = show_name;
|
||||
}
|
||||
show += name;
|
||||
if (i == 0) {
|
||||
show += "(组长)";
|
||||
}
|
||||
if (i != lists.length -1) {
|
||||
str += ",";
|
||||
show += "、";
|
||||
}
|
||||
}
|
||||
$("#group_member_ids").val(str);
|
||||
}
|
||||
hideModal("#popbox02");
|
||||
$("#group_members_show").show().html(show);
|
||||
}
|
||||
|
||||
function delete_student(id) {
|
||||
$("#choose_student_"+id).remove();
|
||||
$("#student_"+id).one("click",function choose_student() {
|
||||
$("#choose_students_list").append("<li id='choose_student_"+id+"' onclick='delete_student("+id+");'>"+$("#student_"+id).html()+"</li>");
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
$.ajax({
|
||||
url: '<%= url_for(:controller => 'student_work', :action => 'search_course_students') %>'+'?homework='+<%=@homework.id %>,
|
||||
type:'get'
|
||||
});
|
||||
});
|
||||
</script>
|
@ -0,0 +1,58 @@
|
||||
<div id="popbox02" style="">
|
||||
<span class="f16 fontBlue">关联项目</span>
|
||||
<a href="javascript:void(0);" class="popClose" onclick="clickCanel();"></a>
|
||||
<%=form_tag url_for(:controller=>'student_work',:action=>'student_work_project',:homework=>@homework.id,:user_activity_id=>@user_activity_id,:is_in_course=>@is_in_course,:course_activity =>@course_activity),:id =>'student_work_relate_project',:class=>'resourcesSearchBox',:remote => true do %>
|
||||
<input type="text" name="project" placeholder="输入项目名称进行搜索" class="searchResourcePopup mb10" />
|
||||
<div class="cl"></div>
|
||||
<p id="no_search_result" class="c_red" style="width:220px;display: none">您当前尚未参与任何项目,请先加入项目再关联。</p>
|
||||
<ul id="search_project_list" class="maxHeight100"></ul>
|
||||
<p id="notes" class="c_red"></p>
|
||||
<div class="courseSendSubmit mt10"><a href="javascript:void(0);" class="sendSourceText" onclick="clickOK();">确定</a></div>
|
||||
<div class="courseSendCancel mt10"><a href="javascript:void(0);" class="sendSourceText" onclick="clickCanel();">取消</a></div>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var lastSearchCondition = '';
|
||||
var count = 0;
|
||||
function search_pros(e){
|
||||
if($(e.target).val().trim() == lastSearchCondition && lastSearchCondition != '')
|
||||
{
|
||||
return;
|
||||
}
|
||||
lastSearchCondition = $(e.target).val().trim();
|
||||
$.ajax({
|
||||
url: '<%= url_for(:controller => 'student_work', :action => 'search_user_projects') %>'+'?name='+ e.target.value,
|
||||
type:'get'
|
||||
});
|
||||
}
|
||||
|
||||
function throttle(method,context,e){
|
||||
clearTimeout(method.tId);
|
||||
method.tId=setTimeout(function(){
|
||||
method.call(context,e);
|
||||
},500);
|
||||
}
|
||||
|
||||
//查询项目
|
||||
$("input[name='project']").on('input', function (e) {
|
||||
throttle(search_pros,window,e);
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
$.ajax({
|
||||
url: '<%= url_for(:controller => 'student_work', :action => 'search_user_projects') %>'+'?first=1',
|
||||
type:'get'
|
||||
});
|
||||
});
|
||||
|
||||
function clickOK() {
|
||||
var radio = $("input[name='projectName']:checked");
|
||||
if(radio.length < 1) {
|
||||
$("#notes").html("请先选择一个项目");
|
||||
return false;
|
||||
} else {
|
||||
$("#student_work_relate_project").submit();
|
||||
}
|
||||
}
|
||||
</script>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue