|
|
|
@ -29,18 +29,20 @@
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
<div id="RSide" class="fl">
|
|
|
|
|
<div class="message_box mb10" nhname='new_message'>
|
|
|
|
|
<form action="<%= url_for(:controller => 'words', :action => 'create', :user_id => @user.id) %>" data-remote="true" method="post">
|
|
|
|
|
<textarea nhname='new_message_textarea' name="new_form[user_message]" style="display:none;"></textarea>
|
|
|
|
|
<p nhname='contentmsg'></p>
|
|
|
|
|
<div nhname='toolbar_container' style="float:left;padding-top:3px;"></div>
|
|
|
|
|
<a id="new_message_cancel_btn" href="javascript:void(0)" class="grey_n_btn fr " style="margin-top:3px;">取消</a>
|
|
|
|
|
<a id="new_message_submit_btn" href="javascript:void(0)" class="blue_n_btn fr mr5 " style="margin-top:3px;">发布</a>
|
|
|
|
|
</form>
|
|
|
|
|
<div class="message_box mb10">
|
|
|
|
|
<div nhname='new_message' style="display:none;">
|
|
|
|
|
<form action="<%= url_for(:controller => 'words', :action => 'create', :user_id => @user.id) %>" data-remote="true" method="post">
|
|
|
|
|
<textarea nhname='new_message_textarea' name="new_form[user_message]" style="display:none;"></textarea>
|
|
|
|
|
<p nhname='contentmsg'></p>
|
|
|
|
|
<div nhname='toolbar_container' style="float:left;padding-top:3px;"></div>
|
|
|
|
|
<a id="new_message_cancel_btn" href="javascript:void(0)" class="grey_n_btn fr " style="margin-top:3px;">取消</a>
|
|
|
|
|
<a id="new_message_submit_btn" href="javascript:void(0)" class="blue_n_btn fr mr5 " style="margin-top:3px;">发布</a>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
|
|
|
|
|
<div class="message_list_box" nhname="list_more_div">
|
|
|
|
|
<div id="jours_container" nhname="container" data-pagesize="3" data-url="<%=user_path(@user)%>/user_feedback4show" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
|
|
|
|
|
<div class="message_list_box" nhname="list_more_div" id="nh_messages" style="display:none;">
|
|
|
|
|
<div nhname="container" data-pagesize="3" data-url="<%= url_for(:controller => 'users', :action => 'user_feedback4show') %>" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
|
|
|
|
|
<div class="message_list_more">
|
|
|
|
|
<a nhname="expand" href="javascript:void(0)" class="c_blue02">点击展开更多</a> <a nhname="close" style="display:none" href="javascript:void(0)" class="c_lgrey fr mr10">收起</a>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
@ -48,7 +50,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="users_courses_box line_box mb10" nhname="list_more_div">
|
|
|
|
|
<div class="users_courses_box line_box mb10" nhname="list_more_div" style="display:none;">
|
|
|
|
|
<div class="users_top">
|
|
|
|
|
<a href="<%=url_for(:controller => 'users', :action => 'user_courses')%>" class="f14 fb fl c_dark ml10 mt8"><%= @center_flag ? '我的课程' : 'TA的课程' %></a>
|
|
|
|
|
<% if @center_flag %>
|
|
|
|
@ -60,7 +62,7 @@
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<div nhname="container" data-url="<%=user_path(@user)%>/user_courses4show" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
|
|
|
|
|
<div nhname="container" data-url="<%= url_for(:controller => 'users', :action => 'user_courses4show') %>" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<div class="message_list_more mt10">
|
|
|
|
|
<a nhname="expand" href="javascript:void(0)" class="c_blue02">点击展开更多</a> <a nhname="close" style="display:none" href="javascript:void(0)" class="c_lgrey fr">收起</a>
|
|
|
|
@ -69,16 +71,16 @@
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="users_courses_box line_box mb10" nhname="list_more_div">
|
|
|
|
|
<div class="users_courses_box line_box mb10" nhname="list_more_div" style="display:none;">
|
|
|
|
|
<h4 class="users_h4">课程动态</h4>
|
|
|
|
|
<div nhname="container" data-url="<%=user_path(@user)%>/user_course_activities" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
|
|
|
|
|
<div nhname="container" data-url="<%= url_for(:controller => 'users', :action => 'user_course_activities') %>" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
|
|
|
|
|
<div class="message_list_more">
|
|
|
|
|
<a nhname="expand" href="javascript:void(0)" class="c_blue02">点击展开更多</a> <a nhname="close" style="display:none" href="javascript:void(0)" class="c_lgrey fr">收起</a>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="users_courses_box line_box mb10" nhname="list_more_div">
|
|
|
|
|
<div class="users_courses_box line_box mb10" nhname="list_more_div" style="display:none;">
|
|
|
|
|
<div class=" users_top">
|
|
|
|
|
<a href="<%=url_for(:controller => 'users', :action => 'user_projects')%>" class="f14 fb fl c_dark ml10 mt8"><%= @center_flag ? '我的项目' : 'TA的项目' %></a>
|
|
|
|
|
<% if @center_flag %>
|
|
|
|
@ -90,7 +92,7 @@
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<div nhname="container" data-url="<%=user_path(@user)%>/user_projects4show" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
|
|
|
|
|
<div nhname="container" data-url="<%= url_for(:controller => 'users', :action => 'user_projects4show') %>" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<div class="message_list_more mt10">
|
|
|
|
|
<a nhname="expand" href="javascript:void(0)" class="c_blue02">点击展开更多</a> <a nhname="close" style="display:none" href="javascript:void(0)" class="c_lgrey fr">收起</a>
|
|
|
|
@ -99,9 +101,9 @@
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="users_courses_box line_box mb10" nhname="list_more_div">
|
|
|
|
|
<div class="users_courses_box line_box mb10" nhname="list_more_div" style="display:none;">
|
|
|
|
|
<h4 class="users_h4">项目动态</h4>
|
|
|
|
|
<div nhname="container" data-url="<%=user_path(@user)%>/user_project_activities" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
|
|
|
|
|
<div nhname="container" data-url="<%= url_for(:controller => 'users', :action => 'user_project_activities') %>" data-isclose="0" data-currpage="0" data-hasmore="1"></div>
|
|
|
|
|
<div class="message_list_more">
|
|
|
|
|
<a nhname="expand" href="javascript:void(0)" class="c_blue02">点击展开更多</a> <a nhname="close" style="display:none" href="javascript:void(0)" class="c_lgrey fr">收起</a>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
@ -109,75 +111,6 @@
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
$(function(){
|
|
|
|
|
function init_list_more_div(params){
|
|
|
|
|
var p=params;
|
|
|
|
|
p.exbtn.click(function(){
|
|
|
|
|
var isclose = p.container.data('isclose');
|
|
|
|
|
var hasmore = p.container.data('hasmore');
|
|
|
|
|
if(isclose == '1'){
|
|
|
|
|
$("div[nhname='rec']",p.container).show();
|
|
|
|
|
p.container.data('isclose','0');
|
|
|
|
|
p.clbtn.show();
|
|
|
|
|
if(hasmore == '0'){
|
|
|
|
|
p.exbtn.html('没有更多了');
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(hasmore == '0'){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var url = p.container.data('url');
|
|
|
|
|
if($("div[nhname='rec']",p.container).length > 0){
|
|
|
|
|
var lastid = $("div[nhname='rec']",p.container).filter(':last').data('id');
|
|
|
|
|
url += "?lastid="+lastid;
|
|
|
|
|
}
|
|
|
|
|
$.ajax( {url:url,dataType:'text',success:function(data){
|
|
|
|
|
var html = $("<div>"+data+"</div>");
|
|
|
|
|
var lens = $("div[nhname='rec']",html).length;
|
|
|
|
|
if(lens < p.size){
|
|
|
|
|
p.container.data('hasmore','0');
|
|
|
|
|
p.exbtn.html('没有更多了');
|
|
|
|
|
}
|
|
|
|
|
if(lens>0){
|
|
|
|
|
var currpage = parseInt(p.container.data('currpage'))+1;
|
|
|
|
|
if(currpage>1){
|
|
|
|
|
p.clbtn.show();
|
|
|
|
|
}
|
|
|
|
|
p.container.data('currpage',currpage);
|
|
|
|
|
p.container.append(html.html())
|
|
|
|
|
}
|
|
|
|
|
}} );
|
|
|
|
|
});
|
|
|
|
|
p.clbtn.click(function(){
|
|
|
|
|
var i=0;
|
|
|
|
|
$("div[nhname='rec']",p.container).each(function(){
|
|
|
|
|
i++;
|
|
|
|
|
if(i> p.size){
|
|
|
|
|
$(this).hide();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
p.container.data('isclose','1');
|
|
|
|
|
p.clbtn.hide();
|
|
|
|
|
p.exbtn.html('点击展开更多');
|
|
|
|
|
});
|
|
|
|
|
p.exbtn.click();
|
|
|
|
|
}
|
|
|
|
|
$("div[nhname='list_more_div']").each(function(){
|
|
|
|
|
var params = {};
|
|
|
|
|
params.container = $("div[nhname='container']",$(this));
|
|
|
|
|
params.exbtn = $("a[nhname='expand']",$(this));
|
|
|
|
|
params.clbtn = $("a[nhname='close']",$(this));
|
|
|
|
|
params.size = params.container.data('pagesize');
|
|
|
|
|
if( params.size == undefined ){
|
|
|
|
|
params.size = 8;
|
|
|
|
|
}
|
|
|
|
|
init_list_more_div(params)
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
$(function(){
|
|
|
|
|
|
|
|
|
@ -255,36 +188,35 @@
|
|
|
|
|
$("a[nhname='reply_btn']").live('click',function(){
|
|
|
|
|
var params = {};
|
|
|
|
|
params.kindutil = K;
|
|
|
|
|
if($(this).parent('span')==undefined || $(this).parent('span').length==0){
|
|
|
|
|
params.container = $(this).parent('div').parent('div');
|
|
|
|
|
}else{
|
|
|
|
|
params.container = $(this).parent('span').parent('div').parent('div');
|
|
|
|
|
}
|
|
|
|
|
params.div_form = $(">.respond-form",params.container);
|
|
|
|
|
params.container = $(this).parent('div');
|
|
|
|
|
params.div_form = $("div[nhname='div_form']",params.container);
|
|
|
|
|
params.form = $("form",params.div_form);
|
|
|
|
|
params.textarea = $("textarea[name='user_notes']",params.div_form);
|
|
|
|
|
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
|
|
|
|
|
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
|
|
|
|
|
params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form);
|
|
|
|
|
params.cancel_btn = $("a[nhname='cancel_btn']",params.div_form);
|
|
|
|
|
params.submit_btn = $("a[nhname='submit_btn']",params.div_form);
|
|
|
|
|
if(params.textarea.data('init') == undefined){
|
|
|
|
|
params.editor = init_editor(params);
|
|
|
|
|
init_form(params);
|
|
|
|
|
params.cancel_btn.click(function(){
|
|
|
|
|
nh_reset_form(params);
|
|
|
|
|
toggleAndSettingWordsVal(params.div_form, params.textarea);
|
|
|
|
|
});
|
|
|
|
|
params.submit_btn.click(function(){
|
|
|
|
|
params.form.submit();
|
|
|
|
|
});
|
|
|
|
|
params.textarea.data('init',1);
|
|
|
|
|
}
|
|
|
|
|
params.cancel_btn.click();
|
|
|
|
|
toggleAndSettingWordsVal(params.div_form, params.textarea);
|
|
|
|
|
setTimeout(function(){
|
|
|
|
|
if(!params.div_form.is(':hidden')){
|
|
|
|
|
params.textarea.show();
|
|
|
|
|
params.textarea.focus();
|
|
|
|
|
params.textarea.hide();
|
|
|
|
|
// $("#nhjump").attr('href','#'+params.div_form.attr('id'));
|
|
|
|
|
// $("#nhjump")[0].click();
|
|
|
|
|
}
|
|
|
|
|
},300);
|
|
|
|
|
params.textarea.data('init',1);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("div[nhname='new_message']").each(function(){
|
|
|
|
@ -310,12 +242,95 @@
|
|
|
|
|
params.submit_btn.click(function(){
|
|
|
|
|
params.form.submit();
|
|
|
|
|
});
|
|
|
|
|
// $("a[nhname='cancel_btn']",params.div_form).click(function(){
|
|
|
|
|
// nh_reset_form(params);
|
|
|
|
|
// });
|
|
|
|
|
params.textarea.data('init',1);
|
|
|
|
|
$(this).show();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
function init_list_more_div(params){
|
|
|
|
|
var p=params;
|
|
|
|
|
p.exbtn.click(function(){
|
|
|
|
|
var isclose = p.container.data('isclose');
|
|
|
|
|
var hasmore = p.container.data('hasmore');
|
|
|
|
|
if(isclose == '1'){
|
|
|
|
|
$("div[nhname='rec']",p.container).show();
|
|
|
|
|
p.container.data('isclose','0');
|
|
|
|
|
change_status_4_list_more_div(params);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if(hasmore == '0'){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var url = p.container.data('url');
|
|
|
|
|
if($("div[nhname='rec']",p.container).length > 0){
|
|
|
|
|
var lastid = $("div[nhname='rec']",p.container).filter(':last').data('id');
|
|
|
|
|
url += "?lastid="+lastid;
|
|
|
|
|
}
|
|
|
|
|
$.ajax( {url:url,dataType:'text',success:function(data){
|
|
|
|
|
var html = $("<div>"+data+"</div>");
|
|
|
|
|
var lens = $("div[nhname='rec']",html).length;
|
|
|
|
|
if(lens < p.size){
|
|
|
|
|
p.container.data('hasmore','0');
|
|
|
|
|
}
|
|
|
|
|
if(lens>0){
|
|
|
|
|
var currpage = parseInt(p.container.data('currpage'))+1;
|
|
|
|
|
p.container.data('currpage',currpage);
|
|
|
|
|
p.container.append(html.html())
|
|
|
|
|
}
|
|
|
|
|
change_status_4_list_more_div(params,'get');
|
|
|
|
|
p.div.show();
|
|
|
|
|
}} );
|
|
|
|
|
});
|
|
|
|
|
p.clbtn.click(function(){
|
|
|
|
|
var i=0;
|
|
|
|
|
$("div[nhname='rec']",p.container).each(function(){
|
|
|
|
|
i++;
|
|
|
|
|
if(i> p.size){
|
|
|
|
|
$(this).hide();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
p.container.data('isclose','1');
|
|
|
|
|
change_status_4_list_more_div(params);
|
|
|
|
|
});
|
|
|
|
|
p.exbtn.click();
|
|
|
|
|
}
|
|
|
|
|
function change_status_4_list_more_div(params,opt){
|
|
|
|
|
var p=params;
|
|
|
|
|
if($("div[nhname='rec']",p.container).length == 0 && opt != 'get'){
|
|
|
|
|
p.exbtn.click();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var show_lens = $("div[nhname='rec']",p.container).length - $("div[nhname='rec']",p.container).filter(':hidden').length;
|
|
|
|
|
if( show_lens > p.size ){
|
|
|
|
|
p.clbtn.show();
|
|
|
|
|
}else{
|
|
|
|
|
p.clbtn.hide();
|
|
|
|
|
}
|
|
|
|
|
if( p.container.data('hasmore') == '1' || p.container.data('isclose')=='1' ){
|
|
|
|
|
p.exbtn.html('点击展开更多');
|
|
|
|
|
}else{
|
|
|
|
|
p.exbtn.html('没有更多了');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function init_list_more_div_params(div){
|
|
|
|
|
var params = {};
|
|
|
|
|
params.div = div;
|
|
|
|
|
params.container = $("div[nhname='container']",div);
|
|
|
|
|
params.exbtn = $("a[nhname='expand']",div);
|
|
|
|
|
params.clbtn = $("a[nhname='close']",div);
|
|
|
|
|
params.size = params.container.data('pagesize');
|
|
|
|
|
if( params.size == undefined ){
|
|
|
|
|
params.size = 8;
|
|
|
|
|
}
|
|
|
|
|
return params;
|
|
|
|
|
}
|
|
|
|
|
$(function(){
|
|
|
|
|
$("div[nhname='list_more_div']").each(function(){
|
|
|
|
|
var params = init_list_more_div_params($(this));
|
|
|
|
|
init_list_more_div(params)
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
</script>
|
|
|
|
|