diff --git a/app/views/users/_user_at_message.html.erb b/app/views/users/_user_at_message.html.erb index c4a257358..343741cd4 100644 --- a/app/views/users/_user_at_message.html.erb +++ b/app/views/users/_user_at_message.html.erb @@ -5,10 +5,22 @@ <%= ma.author.login %>提到了你:
  • - <%= link_to ma.subject.html_safe, course_boards_path(ma.at_message.course, :parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id), - :class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}", - :onmouseover =>"message_titile_show($(this),event)", - :onmouseout => "message_titile_hide($(this))" %>
  • + <% if ma.at_message_type == "Message" && !ma.at_message.course.nil? %> + <%= link_to ma.subject.html_safe, course_boards_path(ma.at_message.course, + :parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id), + :class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}", + :onmouseover =>"message_titile_show($(this),event)", + :onmouseout => "message_titile_hide($(this))" %> + <% elsif ma.at_message_type == "Message" && !ma.at_message.project.nil? %> + <%= link_to ma.subject.html_safe, project_boards_path(ma.at_message.project, + :parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id), + :class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}", + :onmouseover =>"message_titile_show($(this),event)", + :onmouseout => "message_titile_hide($(this))" %> + <% else %> + <%= link_to ma.subject.html_safe, ma.url, :class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}", :onmouseover =>"message_titile_show($(this),event)", :onmouseout => "message_titile_hide($(this))" %> + <% end %> +