commit
518bad811c
|
@ -185,7 +185,7 @@ class BlogCommentsController < ApplicationController
|
|||
if params[:course_id] #如果呆了course_id过来了,那么这是要跳到课程大纲去的
|
||||
redirect_to syllabus_course_path(:id=>params[:course_id])
|
||||
else
|
||||
redirect_to user_blog_blog_comment_path(:user_id => @article.author_id, :blog_id => @article.blog_id, :id => @article)
|
||||
redirect_to user_blog_blog_comment_path( @article.author, :blog_id => @article.blog_id, :id => @article)
|
||||
end
|
||||
|
||||
}
|
||||
|
|
|
@ -580,6 +580,8 @@ class UsersController < ApplicationController
|
|||
org_querys = OrgMessage.where("user_id=? and viewed=0", user)
|
||||
at_querys = AtMessage.where("user_id=? and viewed=0", user)
|
||||
contest_querys = ContestMessage.where(:user_id => user, :viewed => 0)
|
||||
blog_querys = BlogMessage.where(:user_id => user, :viewed => 0)
|
||||
applied_querys = AppliedMessage.where("user_id=? and viewed =?", user, 0)
|
||||
course_querys.update_all(:viewed => true) unless course_querys.nil?
|
||||
forge_querys.update_all(:viewed => true) unless forge_querys.nil?
|
||||
user_querys.update_all(:viewed => true) unless user_querys.nil?
|
||||
|
@ -587,7 +589,8 @@ class UsersController < ApplicationController
|
|||
org_querys.update_all(:viewed => true) unless org_querys.nil?
|
||||
at_querys.update_all(:viewed => true) unless at_querys.nil?
|
||||
contest_querys.update_all(:viewed => true) unless contest_querys.nil?
|
||||
|
||||
blog_querys.update_all(:viewed => true) unless blog_querys.nil?
|
||||
applied_querys.update_all(:viewed => true) unless applied_querys.nil?
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -2008,7 +2011,7 @@ class UsersController < ApplicationController
|
|||
def show
|
||||
if User.current == @user
|
||||
# 全部设为已读
|
||||
if params[:viewed] == "all"
|
||||
if params[:viewed] == "set_viewed"
|
||||
update_message_viewed(@user)
|
||||
end
|
||||
# 自己的主页显示消息
|
||||
|
|
|
@ -308,7 +308,9 @@ module UsersHelper
|
|||
user_memo_count = MemoMessage.where("user_id =? and viewed =?", user, 0).count
|
||||
at_count = user.at_messages.where(viewed: false).count
|
||||
contest_count = ContestMessage.where(:user_id => user, :viewed => 0).count
|
||||
messages_count = course_count + forge_count + user_feedback_count + user_memo_count + at_count + org_count + contest_count
|
||||
applied_count = AppliedMessage.where("user_id=? and viewed =?", user, 0).count
|
||||
blog_count = BlogMessage.where(:user_id => user, :viewed => 0).count
|
||||
messages_count = course_count + forge_count + user_feedback_count + user_memo_count + at_count + org_count + contest_count + blog_count + applied_count
|
||||
end
|
||||
|
||||
def user_mail_notification_options(user)
|
||||
|
|
|
@ -6,6 +6,7 @@ class BlogComment < ActiveRecord::Base
|
|||
include Redmine::SafeAttributes
|
||||
belongs_to :blog
|
||||
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
|
||||
has_many :blog_messages, :class_name => 'BlogMessage', :as => :blog_message, :dependent => :destroy
|
||||
|
||||
acts_as_tree :counter_cache => :comments_count, :order => "#{BlogComment.table_name}.sticky desc ,#{BlogComment.table_name}.created_on ASC"
|
||||
acts_as_attachable
|
||||
|
|
|
@ -48,7 +48,6 @@ class Message < ActiveRecord::Base
|
|||
has_many :forge_messages, :class_name => 'ForgeMessage', :as => :forge_message, :dependent => :destroy
|
||||
has_many :contest_messages, :class_name =>'ContestMessage', :as => :contest_message, :dependent => :destroy
|
||||
has_many :at_messages, as: :at_message, dependent: :destroy
|
||||
has_many :blog_messages, :class_name => 'BlogMessage', :as => :blog_message, :dependent => :destroy
|
||||
|
||||
has_many :ActivityNotifies,:as => :activity, :dependent => :destroy
|
||||
|
||||
|
|
|
@ -407,7 +407,8 @@ class User < Principal
|
|||
at_count = AtMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time).count
|
||||
org_count = OrgMessage.where("user_id=? and viewed =? and created_at >?", user.id,0, onclick_time).count
|
||||
applied_count = AppliedMessage.where("user_id=? and viewed =? and created_at >?", user.id, 0, onclick_time).count
|
||||
messages_count = course_count + contest_count + forge_count + user_feedback_count + user_memo_count + system_messages_count + at_count + org_count + applied_count
|
||||
blog_message_count = BlogMessage.where("user_id=? and viewed=? and created_at >?", user.id, 0, onclick_time).count
|
||||
messages_count = course_count + contest_count + forge_count + user_feedback_count + user_memo_count + system_messages_count + at_count + org_count + applied_count + blog_message_count
|
||||
end
|
||||
|
||||
# 查询指派给我的缺陷记录
|
||||
|
|
|
@ -101,7 +101,7 @@
|
|||
<% end %>
|
||||
<%#= link_to User.current.count_new_message, user_message_path(User.current), :class => "homepageNewsIcon" %>
|
||||
<div class="shadowbox_news undis" id="user_messages_list">
|
||||
<%=render :partial => 'layouts/message_loading' %>
|
||||
<%= render :partial => 'layouts/message_loading' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -5,29 +5,29 @@
|
|||
<%= link_to "拒绝", refused_allow_to_join_project_project_memberships_path(:project_id => ma.project_id, :applied_message_id => ma.id),
|
||||
:remote => true, :method => :get, :class => "link-blue",:style => "font-size: 14px;" %>
|
||||
<% elsif ma.status == 2 %>
|
||||
<span class="fontGrey3" style="font-size:14px;">已处理</span>
|
||||
<span style="font-size:14px;">已处理</span>
|
||||
<% elsif ma.status == 4 %>
|
||||
<% operator_message = AppliedMessage.where("applied_id=? and user_id=? and status = 4", ma.applied_id, ma.user_id).first %>
|
||||
<% operator = User.find(operator_message.applied_user_id).show_name %>
|
||||
<span class="fontGrey3" style="font-size:14px" title="<%= operator %>已拒绝">
|
||||
<span style="font-size:14px" title="<%= operator %>已拒绝">
|
||||
<%= operator %>已拒绝
|
||||
</span>
|
||||
<% elsif ma.status == 5 %>
|
||||
<% operator_message = AppliedMessage.where("applied_id=? and user_id=? and status = 4", ma.applied_id, ma.applied_user_id).first %>
|
||||
<% operator = User.find(operator_message.applied_user_id).show_name %>
|
||||
<span class="fontGrey3" style="font-size:14px" title="<%= operator %>已拒绝">
|
||||
<span style="font-size:14px" title="<%= operator %>已拒绝">
|
||||
<%= operator %>已拒绝
|
||||
</span>
|
||||
<% elsif ma.status == 6 %>
|
||||
<% operator_message = AppliedMessage.where("applied_id=? and user_id=? and status = 6", ma.applied_id, ma.user_id).first %>
|
||||
<% operator = User.find(operator_message.applied_user_id).show_name %>
|
||||
<span class="fontGrey3" style="font-size:14px" title="<%= operator %>已同意">
|
||||
<span style="font-size:14px" title="<%= operator %>已同意">
|
||||
<%= operator %>已同意
|
||||
</span>
|
||||
<% elsif ma.status == 7 %>
|
||||
<% operator_message = AppliedMessage.where("applied_id=? and user_id=? and status = 6", ma.applied_id, ma.applied_user_id).first %>
|
||||
<% operator = User.find(operator_message.applied_user_id).show_name %>
|
||||
<span class="fontGrey3" style="font-size:14px" title="<%= operator %>已同意">
|
||||
<span style="font-size:14px" title="<%= operator %>已同意">
|
||||
<%= operator %>已同意
|
||||
</span>
|
||||
<% end %>
|
|
@ -782,8 +782,8 @@
|
|||
<span class="homepageNewsType fl">您增加了新的班级成员:</span>
|
||||
</li>
|
||||
<li class="messageInformationContents">
|
||||
<%= link_to User.find(ma.course_message_id).login+"("+(User.find(ma.course_message_id).realname ? User.find(ma.course_message_id).realname : User.find(ma.course_message_id).login) +")",
|
||||
{:controller => 'courses', :action => 'settings', :id => ma.course_id, :tab=>'member'},
|
||||
<%= link_to User.find(ma.course_message_id).login + "(" + (User.find(ma.course_message_id).show_name) +")",
|
||||
{:controller => 'courses', :action => 'settings', :id => ma.course_id, :tab => 'member'},
|
||||
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:target => '_blank' %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<% count = unviewed_message(@user) %>
|
||||
<span class="fr" style="margin-top:5px;">
|
||||
<% unless (count == 0 || User.current != @user) %>
|
||||
<%= link_to "全部设为已读", user_path(User.current, :viewed => 'all'), :class => "fl mr10" %>
|
||||
<%= link_to "全部设为已读", user_path(User.current, :viewed => 'set_viewed'), :class => "fl mr10" %>
|
||||
<% end %>
|
||||
<span class="fl">共 <span style="color: red;"><%= @message_count %></span> 个消息</span>
|
||||
</span>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<% if @user_activity_id.to_i != @root.id %>
|
||||
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/user_blog_post_reply', :locals => {:activity => @root,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% else %>
|
||||
window.location.href = "<%=user_blog_blog_comment_path(:user_id => @root.author_id,:blog_id=>@root.blog_id,:id=>@root.id) %>";
|
||||
window.location.href = "<%=user_blog_blog_comment_path(:user_id => @root.author,:blog_id => @root.blog_id,:id => @root.id) %>";
|
||||
<% end %>
|
||||
<% elsif @type == 'News' || params[:type] == 'Comment' %>
|
||||
<% if @user_activity_id.to_i != @root.id %>
|
||||
|
|
Loading…
Reference in New Issue