From f99e5dcc641bc6c95d3c9efe19c68945f8ecbbe5 Mon Sep 17 00:00:00 2001 From: huangjingquan Date: Mon, 9 Dec 2013 16:01:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E7=95=99=E8=A8=80=E5=9B=9E=E5=A4=8D=E5=8F=8C=E9=87=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=9A=84=E9=97=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/journals_for_message.rb | 6 ++++-- app/views/users/show.html.erb | 17 +++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb index 754335263..d8781abb7 100644 --- a/app/models/journals_for_message.rb +++ b/app/models/journals_for_message.rb @@ -23,8 +23,10 @@ class JournalsForMessage < ActiveRecord::Base end def act_as_activity - if self.jour_type == 'Principal' - self.acts << Activity.new(:user_id => self.user_id) + if self.jour_type == 'Principal' + unless self.user_id == self.jour.id && self.user_id != self.reply_id + self.acts << Activity.new(:user_id => self.user_id) + end end end end diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 366fb8f2a..84e03c3c9 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -20,6 +20,7 @@ <% @activity.each do |e| %> <% act = e.act %> <% unless act.nil? %> + @@ -28,26 +29,26 @@
<% case e.act_type %> <% when 'JournalsForMessage' %> - <% if User.current.login == @user.login %> + <% if User.current.login == @user.login %> <% if e.user_id == act.jour.id %> - + <% else %> - - - <% end %> + + <% end %> <% else %> <% end %> <% if act.reward_type ==3 %>
<%= link_to("#{e.user.show_name}", user_path(e.user_id)) %> 给你留言了
<%= link_to("#{e.user.show_name}", user_path(e.user_id)) %> 有了留言
<%= link_to("#{e.user.show_name}", user_path(e.user_id)) %> 给 <%= link_to("#{act.jour.show_name}", user_path(act.jour.id)) %> 留言了 
<%= link_to("#{e.user.show_name}", user_path(e.user_id)) %> 给 <%= link_to("#{act.jour.show_name}", user_path(act.jour.id)) %> 留言了 
<%= link_to("#{@user.show_name}", user_path(e.user_id)) %> 有了新的动态
-

- <%=link_to act.notes, user_path(e.user_id) %> +

+ <%=textilizable act.notes %>

-
+
+ <% when 'Bid' %>