Merge branch 'develop' into szzh
Conflicts: app/views/users/user_messages.html.erb
This commit is contained in:
commit
f1431b27fc
|
@ -106,18 +106,18 @@ class UsersController < ApplicationController
|
|||
return
|
||||
end
|
||||
# 当前用户查看消息,则设置消息为已读
|
||||
if params[:viewed] == "all"
|
||||
course_querys = @user.course_messages
|
||||
forge_querys = @user.forge_messages
|
||||
user_querys = @user.user_feedback_messages
|
||||
forum_querys = @user.memo_messages
|
||||
if User.current.id == @user.id
|
||||
course_querys.update_all(:viewed => true)
|
||||
forge_querys.update_all(:viewed => true)
|
||||
user_querys.update_all(:viewed => true)
|
||||
forum_querys.update_all(:viewed => true)
|
||||
end
|
||||
end
|
||||
#if params[:viewed] == "all"
|
||||
# course_querys = @user.course_messages
|
||||
# forge_querys = @user.forge_messages
|
||||
# user_querys = @user.user_feedback_messages
|
||||
# forum_querys = @user.memo_messages
|
||||
# if User.current.id == @user.id
|
||||
# course_querys.update_all(:viewed => true)
|
||||
# forge_querys.update_all(:viewed => true)
|
||||
# user_querys.update_all(:viewed => true)
|
||||
# forum_querys.update_all(:viewed => true)
|
||||
# end
|
||||
#end
|
||||
# @new_message_count = forge_querys.count + forum_querys.count + course_querys.count + user_querys.count
|
||||
case params[:type]
|
||||
when nil
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
<% activity= activity.parent ? activity.parent : activity%>
|
||||
<% replies_all_i = 0 %>
|
||||
<% if count > 0 %>
|
||||
<div class="homepagePostReplyContainer" id="reply_div_<%= user_activity_id %>">
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.children.reorder("created_on desc").each do |reply|%>
|
||||
<% replies_all_i=replies_all_i+1 %>
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
|
||||
<% replies_all_i = 0 %>
|
||||
<% if count > 0 %>
|
||||
<div class="homepagePostReplyContainer" id="reply_div_<%= user_activity_id %>">
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.comments.reorder("created_on desc").each do |comment| %>
|
||||
<% replies_all_i = replies_all_i + 1 %>
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
|
||||
<% replies_all_i = 0 %>
|
||||
<% if count > 0 %>
|
||||
<div class="homepagePostReplyContainer" id="reply_div_<%= user_activity_id %>">
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.journals.reorder("created_on desc").each do |reply| %>
|
||||
<% replies_all_i=replies_all_i + 1 %>
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
<% activity= activity.parent_id.nil? ? activity : activity.parent %>
|
||||
<% replies_all_i = 0 %>
|
||||
<% if count > 0 %>
|
||||
<div class="homepagePostReplyContainer" id="reply_div_<%= user_activity_id %>">
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.children.reorder("created_on desc").each do |reply| %>
|
||||
<% replies_all_i=replies_all_i+1 %>
|
||||
|
|
|
@ -37,4 +37,4 @@
|
|||
</ul>
|
||||
</div>
|
||||
|
||||
<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities,:page => 0,:type => @type} %>
|
||||
<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities,:page => 0,:type => @type} %>
|
||||
|
|
|
@ -29,14 +29,7 @@
|
|||
</div>
|
||||
<div class="resources mt10" id="users_setting">
|
||||
<div>
|
||||
<% if params[:type].nil? %>
|
||||
<div class="newsReadSetting">
|
||||
有 <span class="c_red"><%= User.current.count_new_message %></span> 条未读
|
||||
<% unless User.current.count_new_message == 0 %>
|
||||
<a href="javascript:void(0);" class="ml15"><%= link_to "全部设为已读", user_message_path(User.current, :viewed => 'all') %></a>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if @message_alls.count >0 %>
|
||||
<%# 课程消息 %>
|
||||
<% unless @message_alls.nil? %>
|
||||
|
|
Loading…
Reference in New Issue