From eeb57401d931f0e3430c707c11b2c16828c61c64 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 1 Dec 2016 14:40:58 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B6=88=E6=81=AF=E5=88=97?=
=?UTF-8?q?=E8=A1=A8=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/users/_user_message_course.html.erb | 12 ++++++------
app/views/users/_user_message_forge.html.erb | 4 ++--
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb
index c8c4925fe..87d448944 100644
--- a/app/views/users/_user_message_course.html.erb
+++ b/app/views/users/_user_message_course.html.erb
@@ -7,7 +7,7 @@
- <%=link_to ma.course_message.author.show_name, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
+ <%=link_to ma.course_message.author.try(:show_name), user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
">发布了通知:
@@ -275,7 +275,7 @@
- <%= link_to ma.course_message.user.show_name,
+ <%= link_to ma.course_message.user.try(:show_name),
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<%= ma.apply_result == 1 ? '同意' : '拒绝'%>引用作业:
@@ -304,7 +304,7 @@
- <%=link_to ma.course_message.user.show_name, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
+ <%=link_to ma.course_message.user.try(:show_name), user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
">发布了问卷:
@@ -327,7 +327,7 @@
- <%=link_to ma.course_message.author.show_name, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
+ <%=link_to ma.course_message.author.try(:show_name), user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
">
<%= ma.course_message.parent_id.nil? ? "发布了班级帖子:" : "评论了班级帖子:" %>
<% if ma.course_message.parent_id.nil? %>
@@ -423,7 +423,7 @@
- <%= link_to ma.course_message.user.show_name, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
+ <%= link_to ma.course_message.user.try(:show_name), user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
">在班级中留言了:
@@ -447,7 +447,7 @@
- <%= link_to ma.course_message.user.show_name, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
+ <%= link_to ma.course_message.user.try(:show_name), user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
">
<% if ma.course_message.m_parent_id.nil? %>
回复了您的作业:
diff --git a/app/views/users/_user_message_forge.html.erb b/app/views/users/_user_message_forge.html.erb
index 4a3d73ead..38d610aea 100644
--- a/app/views/users/_user_message_forge.html.erb
+++ b/app/views/users/_user_message_forge.html.erb
@@ -162,7 +162,7 @@
<% if ma.forge_message_type == "Message" %>
- <%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author), :target => '_blank' %>
- - <%=link_to ma.forge_message.author.show_name, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
+
- <%=link_to ma.forge_message.author.try(:show_name), user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
"><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %>
-
<%= link_to ma.forge_message.subject, board_message_path(ma.forge_message.board_id, ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id), :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
@@ -181,7 +181,7 @@
-
- <%=link_to ma.forge_message.author.show_name, user_path(ma.forge_message.author),
+ <%=link_to ma.forge_message.author.try(:show_name), user_path(ma.forge_message.author),
:class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
">评论了新闻: