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

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

@ -23,8 +23,10 @@ class JournalsForMessage < ActiveRecord::Base
end end
def act_as_activity def act_as_activity
if self.jour_type == 'Principal' if self.jour_type == 'Principal'
self.acts << Activity.new(:user_id => self.user_id) 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 end
end end

View File

@ -20,6 +20,7 @@
<% @activity.each do |e| %> <% @activity.each do |e| %>
<% act = e.act %> <% act = e.act %>
<% unless act.nil? %> <% 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;"> <table width="660" border="0" align="left" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr> <tr>
<!-- fq --> <!-- fq -->
@ -28,26 +29,26 @@
<table width="580" border="0" class "info-break"> <table width="580" border="0" class "info-break">
<% case e.act_type %> <% case e.act_type %>
<% when 'JournalsForMessage' %> <% when 'JournalsForMessage' %>
<% if User.current.login == @user.login %> <% if User.current.login == @user.login %>
<% if e.user_id == act.jour.id %> <% 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 %> <% 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 %>
<% end %>
<% else %> <% 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> <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>
<% end %> <% end %>
<!-- end --> <!-- end -->
<tr> <tr>
<td colspan="2" width="580" > <td colspan="2" width="580" >
<p class="font_description"> <p class="font_description">
<%=link_to act.notes, user_path(e.user_id) %> <%=textilizable act.notes %>
</p></td> </p></td>
</tr> </tr>
<tr> <tr>
<td> <td>
<div style="display: inline-block; float: right; margin-top: 0px"></div> <div style="display: inline-block; float: right; margin-top: 0px"></div>
<% when 'Bid' %> <% when 'Bid' %>
<tr> <tr>
<% if act.reward_type ==3 %> <% if act.reward_type ==3 %>