From 8b5a2ac1cb53847da11ce3e7b22c33b0215bea45 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 11 Jul 2016 16:59:37 +0800 Subject: [PATCH] message 500 --- .../quality_analysis_controller.rb | 2 +- app/views/quality_analysis/index.html.erb | 10 +--- app/views/users/_user_message_course.html.erb | 48 +++++++++---------- 3 files changed, 26 insertions(+), 34 deletions(-) diff --git a/app/controllers/quality_analysis_controller.rb b/app/controllers/quality_analysis_controller.rb index a7bf0ef73..ae752f6b9 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 %> <% end %> - <% if ma.course_message_type == "Comment" %> + <% if ma.course_message_type == "Comment" && ma.course_message %> <% end %> - <% if ma.course_message_type == "HomeworkCommon" && ma.status.nil?%> + <% if ma.course_message_type == "HomeworkCommon" && ma.status.nil? && ma.course_message %> <% 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 %> <% end %> - <% if ma.course_message_type == "ApplyResource" && ma.status == 0 %> + <% if ma.course_message_type == "ApplyResource" && ma.status == 0 && ma.course_message %> <% end %> - <% if ma.course_message_type == "ApplyResource" && ma.status == 1 %> + <% if ma.course_message_type == "ApplyResource" && ma.status == 1 && ma.course_message %> <% 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 %> <% 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' %>