Merge branch 'hjq_new_course' of http://repository.trustie.net/xianbo/trustie2 into hjq_new_course
commit
5d18b14e73
@ -1,5 +1,5 @@
|
||||
class CourseContributorScore < ActiveRecord::Base
|
||||
attr_accessible :course_id, :journal_num, :journal_reply_num, :message_num, :message_reply_num, :news_reply_num, :resource_num, :user_id
|
||||
attr_accessible :course_id, :journal_num, :journal_reply_num, :message_num, :message_reply_num, :news_reply_num, :resource_num, :user_id, :total_score
|
||||
belongs_to :course
|
||||
belongs_to :user
|
||||
end
|
||||
|
@ -0,0 +1,99 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link href="css/public.css" rel="stylesheet" type="text/css" />
|
||||
<link href="css/org.css" rel="stylesheet" type="text/css" />
|
||||
<script src="js/jquery-1.3.2.js" type="text/javascript"></script>
|
||||
<script type="text/javascript" src="js/bootstrap.js"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
var popupHeight = $(".resourceSharePopup").outerHeight(true);
|
||||
$(".resourceSharePopup").css("marginTop",-popupHeight/2);
|
||||
|
||||
|
||||
$(".resourcePopupClose").click(function(){
|
||||
$(".resourceSharePopup").css("display","none");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="resourceSharePopup">
|
||||
<div>
|
||||
<div class="relateText fl">请选择关联到组织的课程</div>
|
||||
</div>
|
||||
<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose"></a></div>
|
||||
<div class="fl">
|
||||
<%=form_tag url_for(:controller => 'organizations', :action => 'join_courses', :organization_id => organization_id),:method => 'post', :id => 'join_courses_form', :remote => true,:class=>"resourcesSearchBox" do %>
|
||||
<input type="text" name="courses" placeholder="搜索您已加入的课程的名称" class="searchCourse" />
|
||||
<div id="search_courses_result_list" class="mb8"></div>
|
||||
<div class="courseSendSubmit">
|
||||
<a href="javascript:void(0);" onclick="org_join_courses(<%= organization_id %>);" class="sendSourceText">关联</a>
|
||||
</div>
|
||||
<div class="courseSendCancel"><a href="javascript:void(0);" onclick="cancel_join_courses();" class="sendSourceText">取消</a></div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var lastSearchCondition = '';
|
||||
var page = 1;
|
||||
var count = 0;
|
||||
var maxPage = 0;
|
||||
function search_courses(e){
|
||||
if($(e.target).val().trim() == lastSearchCondition && lastSearchCondition != '')
|
||||
{
|
||||
return;
|
||||
}
|
||||
lastSearchCondition = $(e.target).val().trim();
|
||||
$.ajax({
|
||||
url: '<%= url_for(:controller => 'organizations', :action => 'search_courses') %>'+'?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='courses']").on('input', function (e) {
|
||||
throttle(search_courses,window,e);
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
$.ajax({
|
||||
url: '<%= url_for(:controller => 'organizations', :action => 'search_courses') %>',
|
||||
type:'get'
|
||||
});
|
||||
});
|
||||
function cancel_join_courses() {
|
||||
$("#join_courses_form input:checked").attr("checked", false);
|
||||
//$("#search_courses_result_list").html("");
|
||||
}
|
||||
function org_join_courses(orgId) {
|
||||
$.ajax({
|
||||
url: "/organizations/"+orgId + "/join_courses?" + $("#join_courses_form").serialize(),
|
||||
type: "post",
|
||||
success: function (data) {
|
||||
$.ajax({
|
||||
url: "/organizations/" + orgId + "/search_courses?name=" + $("input[name='courses']").val().trim(),
|
||||
type: "get"
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,95 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<link href="css/public.css" rel="stylesheet" type="text/css" />
|
||||
<link href="css/org.css" rel="stylesheet" type="text/css" />
|
||||
<script src="js/jquery-1.3.2.js" type="text/javascript"></script>
|
||||
<script type="text/javascript" src="js/bootstrap.js"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
var popupHeight = $(".resourceSharePopup").outerHeight(true);
|
||||
$(".resourceSharePopup").css("marginTop",-popupHeight/2);
|
||||
|
||||
|
||||
$(".resourcePopupClose").click(function(){
|
||||
$(".resourceSharePopup").css("display","none");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="resourceSharePopup">
|
||||
<div>
|
||||
<div class="relateText fl">请选择关联到组织的项目</div>
|
||||
</div>
|
||||
<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose"></a></div>
|
||||
<div class="fl">
|
||||
<%=form_tag url_for(:controller => 'organizations', :action => 'join_projects', :organization_id => organization_id),:method => 'post', :id => 'join_projects_form', :remote => true,:class=>"resourcesSearchBox" do %>
|
||||
<input type="text" name="projects" placeholder="搜索您已加入的项目的名称" class="searchCourse" />
|
||||
<div id="search_projects_result_list" class="mb8"></div>
|
||||
<div class="courseSendSubmit">
|
||||
<a href="javascript:void(0);" onclick="org_join_projects(<%= organization_id %>);" class="sendSourceText">关联</a>
|
||||
</div>
|
||||
<div class="courseSendCancel"><a href="javascript:void(0);" onclick="cancel_join_projects();" class="sendSourceText">取消</a></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var lastSearchCondition = '';
|
||||
var page = 1;
|
||||
var count = 0;
|
||||
var maxPage = 0;
|
||||
function search_projects(e){
|
||||
if($(e.target).val().trim() == lastSearchCondition && lastSearchCondition != '')
|
||||
{
|
||||
return;
|
||||
}
|
||||
lastSearchCondition = $(e.target).val().trim();
|
||||
$.ajax({
|
||||
url: '<%= url_for(:controller => 'organizations', :action => 'search_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='projects']").on('input', function (e) {
|
||||
throttle(search_projects,window,e);
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
$.ajax({
|
||||
url: '<%= url_for(:controller => 'organizations', :action => 'search_projects') %>',
|
||||
type:'get'
|
||||
});
|
||||
});
|
||||
function cancel_join_projects() {
|
||||
$("#join_projects_form input:checked").attr("checked", false);
|
||||
//$("#search_projects_result_list").html("");
|
||||
}
|
||||
function org_join_projects(orgId) {
|
||||
$.ajax({
|
||||
url: "/organizations/"+orgId + "/join_projects?" + $("#join_projects_form").serialize(),
|
||||
type: "post",
|
||||
success: function (data) {
|
||||
$.ajax({
|
||||
url: "/organizations/" + orgId + "/search_projects?name=" + $("input[name='projects']").val().trim(),
|
||||
type: "get"
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,3 @@
|
||||
$('#topnav_course_menu').hide();
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'join_course_menu', :locals => {:organization_id => @organization.id}) %>');
|
||||
$('#ajax-modal').show();
|
@ -0,0 +1,5 @@
|
||||
$("#homepageLeftMenuCourses").html("");
|
||||
$("#homepageLeftMenuCourses").append("<ul>");
|
||||
$("#homepageLeftMenuCourses").append("<%= escape_javascript(render :partial => 'layouts/org_courses',
|
||||
:locals=>{:courses=>@organization.courses.reorder('created_at').limit(5),:org_id=>@organization.id,:page=> 1}) %>");
|
||||
$("#homepageLeftMenuCourses").append("</ul>");
|
@ -0,0 +1,3 @@
|
||||
$('#topnav_project_menu').hide();
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'join_project_menu', :locals => {:organization_id => @organization.id}) %>');
|
||||
$('#ajax-modal').show();
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue