<%= title_for_message(params[:type]) %>
<% if @message_alls.count >0 || @user_system_messages.count >0 %> <% if params[:type].nil? || params[:type] == "unviewed" %>
有 <%= unviewed_message(@user) %> 条未读 <% unless (unviewed_message(@user) == 0 || User.current != @user) %> <%= link_to "全部设为已读", user_message_path(User.current, :viewed => 'all') %> <% end %>
<% end %> <%# 系统消息 %> <% if params[:type] != 'system_messages' %> <% @user_system_messages.each do |usm| %> <% end %> <% end %> <% unless @message_alls.nil? %> <% @message_alls.each do |ma| %> <%# 课程消息 %> <% if ma.class == CourseMessage %> <% if ma.course_message_type == "News" %> <% end %> <% if ma.course_message_type == "Comment" %> <% end %> <% if ma.course_message_type == "HomeworkCommon" && ma.status.nil? %> <% end %> <% if ma.course_message_type == "HomeworkCommon" && ma.status == 1 %> <% end %> <% if ma.course_message_type == "HomeworkCommon" && ma.status == 2 %> <% end %> <% if ma.course_message_type == "HomeworkCommon" && ma.status == 3 %> <% end %> <% if ma.course_message_type == "Poll" %> <% end %> <% if ma.course_message_type == "Message" %> <% end %> <% if ma.course_message_type == "StudentWorksScore" %> <% end %> <% if ma.course_message_type == "JournalsForMessage" %> <% if ma.course_message.jour_type == 'Course' %> <% else %> <% end %> <% end %> <% end %> <% if ma.class == ForgeMessage %> <% if ma.forge_message_type == "AppliedProject" %> <% end %> <% if ma.forge_message_type == "ProjectInvite" %> <% inviter = User.find(ma.forge_message_id) %> <% end %> <% if ma.forge_message_type == "Issue" %> <% end %> <% if ma.forge_message_type == "Journal" %> <% end %> <% if ma.forge_message_type == "Message" %> <% end %> <% if ma.forge_message_type == "News" %> <% end %> <% if ma.forge_message_type == "Comment" %> <% end %> <% end %> <% if ma.class == MemoMessage %> <% if ma.memo_type == "Memo" %> <% end %> <% end %> <% if ma.class == UserFeedbackMessage %> <% if ma.journals_for_message_type == "JournalsForMessage" %> <% end %> <% end %> <% end %> <% end %> <% else %>
您目前还没有相关消息!
<% end %>