修复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 %> <% end %>
<% elsif ma.class == BlogMessage %> <% elsif ma.class == BlogMessage %>
<% if ma.blog_message_type == "BlogComment" %> <% if ma.blog_message_type == "BlogComment" %>
<% user_id = User.find(BlogComment.find(ma.blog_commont_id).blog.author_id) %> <% user_id = User.find(BlogComment.find(ma.blog_message_id).blog.author_id) %>
<% blog_id = BlogComment.find(ma.blog_commont_id).root_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> <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 %> <% end %>
<% elsif ma.class == MemoMessage %> <% elsif ma.class == MemoMessage %>

View File

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