消息首页报500

This commit is contained in:
cxt 2017-02-22 12:26:56 +08:00
parent 7f7491c670
commit da4aaca1ea
2 changed files with 4 additions and 4 deletions

View File

@ -132,7 +132,7 @@
role_str = "参赛者"
end
end %>
<li><a href="<%=contest_path(ma.contest_id) %>" target="_blank" title='<%= user.show_name%> <%= user.user_extensions.school_id.blank? ? "" : "来自"+user.user_extensions.school.name+"" %>申请以"<%= role_str%>"的身份加入竞赛:<%=Contest.find(ma.contest_id).name %> <%= User.find(ma.contest_message_id).show_name %><%= ma.status == 1 ? "已同意" : "已拒绝"%>'><span class="shadowbox_news_user"><%= user.show_name%> </span><%= user.user_extensions.school_id.blank? ? "" : "来自"+user.user_extensions.school.name+"" %>申请以"<%= role_str%>"的身份加入竞赛:<%=Contest.find(ma.contest_id).name %> <%= User.find(ma.contest_message_id).show_name %><%= ma.status == 1 ? "已同意" : "已拒绝"%></a></li>
<li><a href="<%=contest_path(ma.contest_id) %>" target="_blank" title='<%= user.show_name%> <%= user.user_extensions.school_id.blank? || user.user_extensions.school.nil? ? "" : "来自"+user.user_extensions.school.name+"" %>申请以"<%= role_str%>"的身份加入竞赛:<%=Contest.find(ma.contest_id).name %> <%= User.find(ma.contest_message_id).show_name %><%= ma.status == 1 ? "已同意" : "已拒绝"%>'><span class="shadowbox_news_user"><%= user.show_name%> </span><%= user.user_extensions.school_id.blank? || user.user_extensions.school.nil? ? "" : "来自"+user.user_extensions.school.name+"" %>申请以"<%= role_str%>"的身份加入竞赛:<%=Contest.find(ma.contest_id).name %> <%= User.find(ma.contest_message_id).show_name %><%= ma.status == 1 ? "已同意" : "已拒绝"%></a></li>
<% elsif ma.contest_message_type == "JoinContest" and ma.status == 0 %>
<li><a href="<%=contest_path(ma.contest) %>" target="_blank" title="<%=User.find(ma.contest_message_id).show_name %> 将您加入了竞赛:<%= ma.contest.name%>"><span class="shadowbox_news_user"><%=User.find(ma.contest_message_id).show_name %> </span>将您加入了竞赛:<%= ma.contest.name%></a></li>
<% elsif ma.contest_message_type == "JoinContest" and ma.status == 1 %>
@ -177,8 +177,8 @@
<% applied_contest = ma.applied %>
<% contest = Contest.find applied_contest.contest_id %>
<% message_user = User.find(applied_contest.user_id) %>
<% content = '<span class="shadowbox_news_user">'+message_user.show_name+' </span>'+(message_user.user_extensions.school_id.blank? ? "" : "来自")+message_user.user_extensions.school.name+""+'申请以"'+ get_role_str(ma.role) + '"的身份加入竞赛:' + contest.name%>
<%= link_to content.html_safe, contest_path(contest.id), :title => "#{message_user.show_name} #{message_user.user_extensions.school_id.blank? ? '' : '来自'+message_user.user_extensions.school.name}申请以'#{get_role_str(ma.role)}'的身份加入竞赛:#{contest.name}", :target => '_blank' %>
<% content = '<span class="shadowbox_news_user">'+message_user.show_name+' </span>'+(message_user.user_extensions.school_id.blank? || message_user.user_extensions.school.nil? ? "" : "来自"+message_user.user_extensions.school.name+"")+'申请以"'+ get_role_str(ma.role) + '"的身份加入竞赛:' + contest.name%>
<%= link_to content.html_safe, contest_path(contest.id), :title => "#{message_user.show_name} #{message_user.user_extensions.school_id.blank? || message_user.user_extensions.school.nil? ? '' : '来自'+message_user.user_extensions.school.name+""}申请以'#{get_role_str(ma.role)}'的身份加入竞赛:#{contest.name}", :target => '_blank' %>
</li>
<% end %>
<% elsif ma.class == ForgeMessage %>

View File

@ -13,7 +13,7 @@
:class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
</span>
<span class="homepageNewsType fl">
<%= message_user.user_extensions.school_id.blank? ? "" : "来自"+message_user.user_extensions.school.name+"" %>
<%= message_user.user_extensions.school_id.blank? || message_user.user_extensions.school.nil? ? "" : "来自"+message_user.user_extensions.school.name+"" %>
申请以"<%= get_role_str ma.role %>"的身份加入竞赛:
</span>
</li>