Merge branch 'cxt_course' of https://git.trustie.net/jacknudt/trustieforge into cxt_course

cxt_course
Tim 9 years ago
commit 1a4865be09

@ -248,7 +248,7 @@ class User < Principal
before_save :update_hashed_password before_save :update_hashed_password
before_destroy :remove_references_before_destroy,:delete_user_ealasticsearch_index before_destroy :remove_references_before_destroy,:delete_user_ealasticsearch_index
# added by fq # added by fq
after_create :act_as_activity, :add_onclick_time, :act_as_principal_activity,:create_user_ealasticsearch_index after_create :act_as_activity, :add_onclick_time, :act_as_principal_activity,:create_user_ealasticsearch_index,:add_new_jour
# end # end
# 更新邮箱用户或用户名的同事,同步更新邀请信息 # 更新邮箱用户或用户名的同事,同步更新邀请信息
after_update :update_invite_list,:update_user_ealasticsearch_index after_update :update_invite_list,:update_user_ealasticsearch_index
@ -1145,6 +1145,22 @@ class User < Principal
end end
end end
#为新注册用户发送留言
def add_new_jour
if Message.where("id=19278").any? and Message.where("id=19291").any? and Message.where("id=19292").any?
lead_message1 = Message.find(19278)
notes1 = lead_message1.content
# lead_message2 = Message.find(19292)
# notes2 = lead_message2.content
# lead_message3 = Message.find(19291)
# notes3 = lead_message3.content
# # user_id 默认为课程使者创建
self.journals_for_messages << JournalsForMessage.new(:user_id => 1, :notes => notes1, :reply_id => 0, :status => true, :is_readed => false, :private => 0)
# self.journals_for_messages << JournalsForMessage.new(:user_id => 1, :notes => notes2, :reply_id => 0, :status => true, :is_readed => false, :private => 0)
# self.journals_for_messages << JournalsForMessage.new(:user_id => 1, :notes => notes3, :reply_id => 0, :status => true, :is_readed => false, :private => 0)
end
end
# 更新邮箱的同事更新invite_lists表中的邮箱信息 # 更新邮箱的同事更新invite_lists表中的邮箱信息
def update_invite_list def update_invite_list
invite_lists = InviteList.where("user_id =?",self.id).all invite_lists = InviteList.where("user_id =?",self.id).all

@ -112,21 +112,17 @@
}).mouseleave(function(){ }).mouseleave(function(){
onNotice = false; onNotice = false;
var obj = $("#user_messages_list"); var obj = $("#user_messages_list");
obj.timer = setTimeout(function(){ setTimeout(function(){
if(!onNotice && !onUserMessages) if(!onNotice && !onUserMessages) {
obj.hide(0); obj.hide();
obj.html("<%=escape_javascript(render :partial => 'layouts/message_loading') %>"); obj.html("<%=escape_javascript(render :partial => 'layouts/message_loading') %>");
}, 500); } }, 500);
}); });
$("#message_list_detail").mouseenter(function(event){
$("#user_messages_list").mouseenter(function(event){
event.stopPropagation(); event.stopPropagation();
onUserMessages = true; onUserMessages = true;
$(this).show();
}).mouseleave(function(){ }).mouseleave(function(){
onUserMessages = false; onUserMessages = false;
$(this).hide();
$(this).html("<%=escape_javascript(render :partial => 'layouts/message_loading') %>");
}); });
$("#navHomepageProfile").mouseenter(function(){ $("#navHomepageProfile").mouseenter(function(){

@ -1,6 +1,7 @@
<font></font> <font></font>
<div id="message_list_detail"> <div id="message_list_detail">
<h4 class="shadowbox_news_title">未读消息</h4> <h4 class="shadowbox_news_title">未读消息</h4>
<p style="display: none;" id="none_message" class="shadowbox_news_p text_c">无未读消息</p>
<ul class="shadowbox_news_list"> <ul class="shadowbox_news_list">
<% messages.each do |ma| %> <% messages.each do |ma| %>
<% if ma.class == SystemMessage %> <% if ma.class == SystemMessage %>
@ -135,8 +136,8 @@
<% end %> <% end %>
<% end %> <% end %>
</ul> </ul>
<a onclick = "show_more();" id = "show_more_messages" class = "shadowbox_news_all undis">展开更多</a> <a onclick = "show_more();" id = "show_more_messages" style="display: none; cursor: pointer;" class = "shadowbox_news_all">展开更多</a>
<%= link_to '查看全部', user_message_path(User.current),:id =>'show_all_messages', :class => "shadowbox_news_all undis", :target =>"_Blank" %> <%= link_to '查看全部', user_message_path(User.current),:id =>'show_all_messages', :class => "shadowbox_news_all", :style => "display:none", :target =>"_Blank" %>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
@ -149,7 +150,11 @@
$(".shadowbox_news_list li").eq(3).show(); $(".shadowbox_news_list li").eq(3).show();
$(".shadowbox_news_list li").eq(4).show(); $(".shadowbox_news_list li").eq(4).show();
$("#show_more_messages").show(); $("#show_more_messages").show();
} else { } else if ($(".shadowbox_news_list li").length == 0) {
$("#none_message").show();
$("#show_all_messages").show();
}
else {
$("#show_all_messages").show(); $("#show_all_messages").show();
} }
}); });

@ -300,7 +300,7 @@ K.options = {
'.text-align', '.color', '.background-color', '.font-size', '.font-family', '.font-weight', '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.font-weight',
'.font-style', '.text-decoration', '.vertical-align', '.background', '.border','.border-color', '.text-overflow','.overflow','.white-space' '.font-style', '.text-decoration', '.vertical-align', '.background', '.border','.border-color', '.text-overflow','.overflow','.white-space'
], ],
a : ['id', 'class', 'href', 'target', 'name'], a : ['id', 'class', 'href', 'target', 'name','data-method','data-remote','rel'],
embed : ['id', 'class', 'src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align', 'allowscriptaccess'], embed : ['id', 'class', 'src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align', 'allowscriptaccess'],
img : ['id', 'class', 'src', 'width', 'height', 'border', 'alt', 'title', 'align', '.width', '.height', '.border'], img : ['id', 'class', 'src', 'width', 'height', 'border', 'alt', 'title', 'align', '.width', '.height', '.border'],
'p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6' : [ 'p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6' : [

@ -1620,8 +1620,9 @@ ul.wlist li a:hover{ background:#15bccf; color:#fff; text-decoration:none;}
/*消息弹框*/ /*消息弹框*/
.shadowbox_news{ width:305px; background-color:#fff; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); position: absolute; left: -131px; top: 45px; z-index: 9999;} .shadowbox_news{ width:305px; background-color:#fff; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); position: absolute; left: -131px; top: 45px; z-index: 9999;}
.shadowbox_news_title{ height:40px; line-height:40px;padding-left:10px; font-size:12px; color:#333;border-bottom:1px solid #eee;} .shadowbox_news_title{ height:40px; line-height:40px;padding-left:10px; font-size:12px; color:#333;border-bottom:1px solid #eee;}
.shadowbox_news_p{ height:40px; line-height:40px; font-size:12px; color:#333;}
.shadowbox_news font{ border: 1px solid #dddddd; display: block; border-width: 8px; position: absolute; top: -15px;left: 140px; border-style:solid; border-color: transparent transparent #fff transparent;font-size: 0;line-height: 0; box-shadow:2px rgba(146, 153, 169, 0.5); } .shadowbox_news font{ border: 1px solid #dddddd; display: block; border-width: 8px; position: absolute; top: -15px;left: 140px; border-style:solid; border-color: transparent transparent #fff transparent;font-size: 0;line-height: 0; box-shadow:2px rgba(146, 153, 169, 0.5); }
.shadowbox_news_list{ max-height:200px; overflow:hidden;} .shadowbox_news_list{ max-height:400px; overflow:hidden;}
.shadowbox_news_list a{ color:#999;} .shadowbox_news_list a{ color:#999;}
.shadowbox_news_list li{ height:40px; border-bottom:1px dashed #ebebeb; line-height:40px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis; padding:0 10px;} .shadowbox_news_list li{ height:40px; border-bottom:1px dashed #ebebeb; line-height:40px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis; padding:0 10px;}
.shadowbox_news_list li:hover{ background-color:#eee;} .shadowbox_news_list li:hover{ background-color:#eee;}

@ -1155,8 +1155,9 @@ a.st_down{ display: block; width:8px; float:left; height:13px; background:url(..
/*消息弹框*/ /*消息弹框*/
.shadowbox_news{ width:305px; background-color:#fff; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); position: absolute; left: -131px; top: 45px; z-index: 9999;} .shadowbox_news{ width:305px; background-color:#fff; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); position: absolute; left: -131px; top: 45px; z-index: 9999;}
.shadowbox_news_title{ height:40px; line-height:40px;padding-left:10px; font-size:12px; color:#333;border-bottom:1px solid #eee;} .shadowbox_news_title{ height:40px; line-height:40px;padding-left:10px; font-size:12px; color:#333;border-bottom:1px solid #eee;}
.shadowbox_news_p{ height:40px; line-height:40px; font-size:12px; color:#333;}
.shadowbox_news font{ border: 1px solid #dddddd; display: block; border-width: 8px; position: absolute; top: -15px;left: 140px; border-style:solid; border-color: transparent transparent #fff transparent;font-size: 0;line-height: 0; box-shadow:2px rgba(146, 153, 169, 0.5); } .shadowbox_news font{ border: 1px solid #dddddd; display: block; border-width: 8px; position: absolute; top: -15px;left: 140px; border-style:solid; border-color: transparent transparent #fff transparent;font-size: 0;line-height: 0; box-shadow:2px rgba(146, 153, 169, 0.5); }
.shadowbox_news_list{ max-height:200px; overflow:hidden;} .shadowbox_news_list{ max-height:400px; overflow:hidden;}
.shadowbox_news_list a{ color:#999;} .shadowbox_news_list a{ color:#999;}
.shadowbox_news_list li{ height:40px; border-bottom:1px dashed #ebebeb; line-height:40px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis; padding:0 10px;} .shadowbox_news_list li{ height:40px; border-bottom:1px dashed #ebebeb; line-height:40px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis; padding:0 10px;}
.shadowbox_news_list li:hover{ background-color:#eee;} .shadowbox_news_list li:hover{ background-color:#eee;}

Loading…
Cancel
Save