修复blog消息和小铃铛中的bug

This commit is contained in:
huang 2017-01-19 17:46:18 +08:00
parent 5a961c8ee7
commit 113d7e9fc1
2 changed files with 25 additions and 22 deletions

View File

@ -209,8 +209,8 @@
<% end %>
<% elsif ma.class == BlogMessage %>
<% if ma.blog_message_type == "BlogComment" %>
<% user_id = User.find(BlogComment.find(ma.blog_commont_id).blog.author_id) %>
<% blog_id = BlogComment.find(ma.blog_commont_id).root_id %>
<% user_id = User.find(BlogComment.find(ma.blog_message_id).blog.author_id) %>
<% blog_id = BlogComment.find(ma.blog_message_id).root_id %>
<li><a href="<%= user_blog_blog_comment_path(:user_id => user_id, :blog_id => ma.blog_id, :id => blog_id) %>" target="_blank" title="<%= User.find(ma.user_operator_id).show_name %> 回复了博客:<%= message_content(ma.content) %>"><span class="shadowbox_news_user"><%= User.find(ma.user_operator_id).show_name %> </span>回复了博客:<%= message_content(ma.content) %></a></li>
<% end %>
<% elsif ma.class == MemoMessage %>

View File

@ -1,20 +1,23 @@
<% if ma.blog_message_type == "BlogComment" %>
<ul class="homepageNewsList fl">
<div class="longMessageWidth">
<li class="homepageNewsPortrait fl">
<%= link_to image_tag(url_to_avatar(User.find(ma.user_operator_id)), :width => "30", :height => "30"), user_path(ma.user_operator_id), :target => '_blank' %>
</li>
<li class="homepageNewsPubType fl">
<%= link_to User.find(ma.user_operator_id).show_name, user_path(ma.user_operator_id), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="homepageNewsType fl">回复了博客:</span>
</li>
<li class="messageInformationContents">
<% user_id = User.find(BlogComment.find(ma.blog_commont_id).blog.author_id) %>
<% blog_id = BlogComment.find(ma.blog_commont_id).root_id %>
<%= link_to message_content(ma.content), user_blog_blog_comment_path(:user_id => user_id, :blog_id => ma.blog_id, :id => blog_id),
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
</li>
</div>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% ma.nil? ? local_assigns[:ma] : ma %>
<% if ma.class == BlogMessage %>
<% if ma.blog_message_type == "BlogComment" %>
<ul class="homepageNewsList fl">
<div class="longMessageWidth">
<li class="homepageNewsPortrait fl">
<%= link_to image_tag(url_to_avatar(User.find(ma.user_operator_id)), :width => "30", :height => "30"), user_path(ma.user_operator_id), :target => '_blank' %>
</li>
<li class="homepageNewsPubType fl">
<%= link_to User.find(ma.user_operator_id).show_name, user_path(ma.user_operator_id), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="homepageNewsType fl">回复了博客:</span>
</li>
<li class="messageInformationContents">
<% user_id = User.find(BlogComment.find(ma.blog_message_id).blog.author_id) %>
<% blog_id = BlogComment.find(ma.blog_message_id).root_id %>
<%= link_to message_content(ma.content), user_blog_blog_comment_path(:user_id => user_id, :blog_id => ma.blog_id, :id => blog_id),
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
</li>
</div>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% end %>