diff --git a/app/controllers/quality_analysis_controller.rb b/app/controllers/quality_analysis_controller.rb
index b567fb313..03ed7945a 100644
--- a/app/controllers/quality_analysis_controller.rb
+++ b/app/controllers/quality_analysis_controller.rb
@@ -114,7 +114,7 @@ class QualityAnalysisController < ApplicationController
end
end
rescue => e
- puts e
+ @message = e.message
end
respond_to do |format|
if @current_build_status == "success"
diff --git a/app/views/quality_analysis/index.html.erb b/app/views/quality_analysis/index.html.erb
index 7925f6120..06455cebe 100644
--- a/app/views/quality_analysis/index.html.erb
+++ b/app/views/quality_analysis/index.html.erb
@@ -1,14 +1,6 @@
<% if @name_flag %>
<%= render :partial => "result_list" %>
<% else %>
- <% if params[:current_build_status].nil? || params[:current_build_status] == "success" %>
- <%= render :partial => "show", :locals => {:branch => @branch} %>
- <% else %>
- <% if params[:build_console_result] %>
- 运行结果超时
- <% else %>
- <%= render :partial => "console_output" %>
- <% end %>
- <% end %>
+ <%= render :partial => "show", :locals => {:branch => @branch} %>
<% end %>
diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb
index 5702d61d1..93d55d162 100644
--- a/app/views/users/_user_message_course.html.erb
+++ b/app/views/users/_user_message_course.html.erb
@@ -1,5 +1,5 @@
<% if ma.class == CourseMessage %>
- <% if ma.course_message_type == "News" %>
+ <% if ma.course_message_type == "News" && ma.course_message %>
- <%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"),user_path(ma.course_message.author), :target => '_blank' %>
- <%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>">发布了通知:
@@ -19,7 +19,7 @@
- <%= time_tag(ma.created_at).html_safe %>
<% end %>
- <% if ma.course_message_type == "Comment" %>
+ <% if ma.course_message_type == "Comment" && ma.course_message %>
- <%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"), user_path(ma.course_message.author), :target => '_blank' %>
- <%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>">评论了通知:
@@ -39,7 +39,7 @@
- <%= time_tag(ma.created_at).html_safe %>
<% end %>
- <% if ma.course_message_type == "HomeworkCommon" && ma.status.nil?%>
+ <% if ma.course_message_type == "HomeworkCommon" && ma.status.nil? && ma.course_message %>
- <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user), :target => '_blank' %>
- <%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师", user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
@@ -98,7 +98,7 @@
- <%= time_tag(ma.created_at).html_safe %>
<% end %>
- <% if ma.course_message_type == "HomeworkCommon" && ma.status == 1 %>
+ <% if ma.course_message_type == "HomeworkCommon" && ma.status == 1 && ma.course_message %>
<% end %>
- <% if ma.course_message_type == "HomeworkCommon" && ma.status == 2 %>
+ <% if ma.course_message_type == "HomeworkCommon" && ma.status == 2 && ma.course_message %>
<% end %>
- <% if ma.course_message_type == "HomeworkCommon" && ma.status == 3 %>
+ <% if ma.course_message_type == "HomeworkCommon" && ma.status == 3 && ma.course_message %>
<% end %>
- <% if ma.course_message_type == "HomeworkCommon" && ma.status == 4 %>
+ <% if ma.course_message_type == "HomeworkCommon" && ma.status == 4 && ma.course_message %>
<% end %>
- <% if ma.course_message_type == "HomeworkCommon" && ma.status == 5 %>
+ <% if ma.course_message_type == "HomeworkCommon" && ma.status == 5 && ma.course_message %>
<%= render :partial => 'apply_homework_course_message', :locals => {:ma => ma} %>
<% end %>
- <% if ma.course_message_type == "ApplyResource" && ma.status == 0 %>
+ <% if ma.course_message_type == "ApplyResource" && ma.status == 0 && ma.course_message %>
<%= render :partial => 'apply_resource_course_message', :locals => {:ma => ma} %>
<% end %>
- <% if ma.course_message_type == "ApplyResource" && ma.status == 1 %>
+ <% if ma.course_message_type == "ApplyResource" && ma.status == 1 && ma.course_message %>
<%= render :partial => 'apply_resource_course_message_reply', :locals => {:ma => ma} %>
<% end %>
- <% if ma.course_message_type == "HomeworkCommon" && ma.status == 6 %>
+ <% if ma.course_message_type == "HomeworkCommon" && ma.status == 6 && ma.course_message %>
<% end %>
- <% if ma.course_message_type == "Poll" %>
+ <% if ma.course_message_type == "Poll" && ma.course_message %>
- <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user), :target => '_blank' %>
- <%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>">发布了问卷:
@@ -287,7 +287,7 @@
- <%= time_tag(ma.created_at).html_safe %>
<% end %>
- <% if ma.course_message_type == "Message" %>
+ <% if ma.course_message_type == "Message" && !ma.nil? && !ma.course_message.nil? %>
<% end %>
- <% if ma.course_message_type == "JournalsForMessage" %>
+ <% if ma.course_message_type == "JournalsForMessage" && ma.course_message %>
<% if ma.course_message.jour_type == 'Course' %>
<% if params[:type] != 'homework' %>
@@ -459,7 +459,7 @@
<% end %>
<% end %>
- <% if ma.course_message_type == "StudentWork" && !ma.course_message.homework_common.nil? && !User.current.allowed_to?(:as_teacher, ma.course_message.homework_common.course) %>
+ <% if ma.course_message_type == "StudentWork" && !ma.course_message.homework_common.nil? && !User.current.allowed_to?(:as_teacher, ma.course_message.homework_common.course) && ma.course_message %>
- <%= link_to image_tag(url_to_avatar(ma.course_message.homework_common.user), :width => "30", :height => "30"), user_path(ma.course_message.homework_common.user), :target => '_blank' %>
-
@@ -493,7 +493,7 @@
<% end %>
- <% if ma.course_message_type == "StudentWork" && ma.status == 1 %>
+ <% if ma.course_message_type == "StudentWork" && ma.status == 1 && ma.course_message %>
<% end %>
- <% if ma.course_message_type == "StudentWork" && ma.status == 2 %>
+ <% if ma.course_message_type == "StudentWork" && ma.status == 2 && ma.course_message %>
<% end %>
- <% if ma.course_message_type == "Course" %>
+ <% if ma.course_message_type == "Course" && ma.course_message %>
<% end %>
- <% if ma.course_message_type == "JoinCourseRequest" && !ma.nil? %>
+ <% if ma.course_message_type == "JoinCourseRequest" && !ma.nil? && ma.course_message %>
<%= render :partial => 'join_course_course_message', :locals => {:ma => ma} %>
@@ -607,7 +607,7 @@
<% end %>
- <% if ma.course_message_type == "JoinCourse" and ma.status == 0 %>
+ <% if ma.course_message_type == "JoinCourse" and ma.status == 0 && ma.course_message %>
-
<%=link_to image_tag(url_to_avatar(User.find(ma.course_message_id)), :width => "30", :height => "30"), user_path(ma.course_message_id), :target => '_blank' %>
@@ -641,7 +641,7 @@
<% end %>
- <% if ma.course_message_type == "JoinCourse" and ma.status == 1 %>
+ <% if ma.course_message_type == "JoinCourse" and ma.status == 1 && ma.course_message %>
-
<%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %>
@@ -675,7 +675,7 @@
<% end %>
- <% if ma.course_message_type == "RemoveFromCourse" %>
+ <% if ma.course_message_type == "RemoveFromCourse" && ma.course_message %>
-
<%=link_to image_tag(url_to_avatar(User.find(ma.course_message_id)), :width => "30", :height => "30"), user_path(ma.course_message_id), :target => '_blank' %>
@@ -710,7 +710,7 @@
<% end %>
- <% if ma.course_message_type == "Exercise" && ma.status == 2 %>
+ <% if ma.course_message_type == "Exercise" && ma.status == 2 && ma.course_message %>
- <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user), :target => '_blank' %>
-
@@ -747,7 +747,7 @@
<% end %>
- <% if ma.course_message_type == "Exercise" && ma.status == 3 %>
+ <% if ma.course_message_type == "Exercise" && ma.status == 3 && ma.course_message %>