修改了之前留言回复双重显示的问

This commit is contained in:
huangjingquan 2013-12-09 16:01:50 +08:00
parent 85351ee7e3
commit f99e5dcc64
2 changed files with 13 additions and 10 deletions

View File

@ -24,7 +24,9 @@ class JournalsForMessage < ActiveRecord::Base
def act_as_activity
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

View File

@ -20,6 +20,7 @@
<% @activity.each do |e| %>
<% act = e.act %>
<% unless act.nil? %>
<table width="660" border="0" align="left" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
<!-- fq -->
@ -30,10 +31,9 @@
<% when 'JournalsForMessage' %>
<% if User.current.login == @user.login %>
<% if e.user_id == act.jour.id %>
<tr><td colspan="2" valign="top"><strong><%= link_to("#{e.user.show_name}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter">给你留言了</td></tr>
<tr><td colspan="2" valign="top"><strong><%= link_to("#{e.user.show_name}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter">有了留言</td></tr>
<% else %>
<tr><td colspan="2" valign="top" class="font_lighter"><strong><%= link_to("#{e.user.show_name}", user_path(e.user_id)) %> 给 <%= link_to("#{act.jour.show_name}", user_path(act.jour.id)) %> 留言了</strong>&nbsp;<span class="font_lighter"></td></tr>
<tr><td colspan="2" valign="top" class="font_lighter"><strong><%= link_to("#{e.user.show_name}", user_path(e.user_id)) %> 给 <%= link_to("#{act.jour.show_name}", user_path(act.jour.id)) %> 留言了</strong>&nbsp;</td></tr>
<% end %>
<% else %>
<tr><td colspan="2" valign="top"><strong><%= link_to("#{@user.show_name}", user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter">有了新的动态</td></tr>
@ -42,12 +42,13 @@
<tr>
<td colspan="2" width="580" >
<p class="font_description">
<%=link_to act.notes, user_path(e.user_id) %>
<%=textilizable act.notes %>
</p></td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: right; margin-top: 0px"></div>
<% when 'Bid' %>
<tr>
<% if act.reward_type ==3 %>