未读消息弹窗漏了一条消息
This commit is contained in:
parent
4a12b56223
commit
44334913ee
|
@ -5,18 +5,20 @@
|
|||
<ul class="shadowbox_news_list">
|
||||
<% messages.each do |ma| %>
|
||||
<% if ma.class == SystemMessage %>
|
||||
<li><a href="<%=user_system_messages_path(User.current) %>" target="_blank" title="Trustie平台 发布新消息:<%= ma.subject.blank? ? (ma.content.nil? ? ma.description.html_safe : ma.content.html_safe) : ma.subject%>"><span class="shadowbox_news_user">Trustie平台 </span>发布新消息:<%= ma.subject.blank? ? (ma.content.nil? ? ma.description.html_safe : ma.content.html_safe) : ma.subject%></a></li>
|
||||
<li><a href="<%=user_system_messages_path(User.current) %>" target="_blank" title="Trustie平台 发布新消息:<%= ma.subject.blank? ? (ma.content.nil? ? ma.description.html_safe : ma.content.html_safe) : ma.subject%>"><span class="shadowbox_news_user">Trustie平台 </span>发布新消息:<%= ma.subject.blank? ? (ma.content.nil? ? ma.description.html_safe : ma.content.html_safe) : ma.subject%></a></li>
|
||||
<% elsif ma.class == CourseMessage %>
|
||||
<% if ma.course_message_type == "News" %>
|
||||
<li><a href="<%=news_path(ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.author.show_name %> 发布了通知:<%= ma.course_message.title%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span>发布了通知:<%= ma.course_message.title%></a></li>
|
||||
<li><a href="<%=news_path(ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.author.show_name %> 发布了通知:<%= ma.course_message.title%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span>发布了通知:<%= ma.course_message.title%></a></li>
|
||||
<% elsif ma.course_message_type == "Comment" %>
|
||||
<li><a href="<%=news_path(ma.course_message.commented.id) %>" target="_blank" title="<%=ma.course_message.author.show_name %> 评论了通知:<%=ma.course_message.commented.title%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span>评论了通知:<%= ma.course_message.commented.title%></a></li>
|
||||
<li><a href="<%=news_path(ma.course_message.commented.id) %>" target="_blank" title="<%=ma.course_message.author.show_name %> 评论了通知:<%=ma.course_message.commented.title%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span>评论了通知:<%= ma.course_message.commented.title%></a></li>
|
||||
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status.nil? %>
|
||||
<li><a href="<%= (!User.current.allowed_to?(:as_teacher, ma.course_message.course) && cur_user_works_for_homework(ma.course_message).nil?) ? new_student_work_path(:homework => ma.course_message.id) : student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布了课程作业:作业标题:<%= ma.course_message.name%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布了课程作业:作业标题:<%= ma.course_message.name%></a></li>
|
||||
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status == 1 %>
|
||||
<li><a href="<%= student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布的作业:作业标题:<%= ma.course_message.name%>的截止日期快到了"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布的作业:作业标题:<%= ma.course_message.name%>的截止日期快到了</a></li>
|
||||
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status == 2 %>
|
||||
<li><a href="<%= student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 启动了作业匿评:作业标题:<%= ma.course_message.name%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>启动了作业匿评:作业标题:<%= ma.course_message.name%></a></li>
|
||||
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status == 3 %>
|
||||
<li><a href="<%= student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 关闭了作业匿评:作业标题:<%= ma.course_message.name%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>关闭了作业匿评:作业标题:<%= ma.course_message.name%></a></li>
|
||||
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status == 4 %>
|
||||
<li><a href="<%= student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 启动作业匿评失败:<%= ma.course_message.name%>(失败原因:提交作品的人数低于2人)"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>启动作业匿评失败:<%= ma.course_message.name%>(失败原因:提交作品的人数低于2人)</a></li>
|
||||
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status == 5 %>
|
||||
|
@ -34,106 +36,106 @@
|
|||
<% href = 'javascript:void(0)' %>
|
||||
<% end %>
|
||||
<li><a href="<%= href %>" target="_blank" title="<%=ma.course_message.user.show_name %> 申请引用资源:<%= ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>申请引用资源:<%= ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)%></a></li>
|
||||
<% elsif ma.course_message_type == "ApplyResource" && ma.status == 1 %>
|
||||
<% if ma.course_message.container_type == "Course" %>
|
||||
<% href = course_files_path(ma.course_message.container_id) %>
|
||||
<% elsif ma.course_message.container_type == "Project" %>
|
||||
<% href = project_files_path(ma.course_message.container_id) %>
|
||||
<% elsif ma.course_message.container_type == "OrgSubfield" %>
|
||||
<% href = org_subfield_files_path(ma.course_message.container_id) %>
|
||||
<% else %>
|
||||
<% href = 'javascript:void(0)' %>
|
||||
<% end %>
|
||||
<li><a href="<%= href %>" target="_blank" title="<%=User.find(ma.course_message.apply_user_id).show_name %> <%= ma.apply_result == 2 ? '同意' : '拒绝'%>引用资源:<%= ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)%>"><span class="shadowbox_news_user"><%=User.find(ma.course_message.apply_user_id).show_name %> </span><%= ma.apply_result == 2 ? '同意' : '拒绝'%>引用资源:<%= ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)%></a></li>
|
||||
<% elsif ma.course_message_type == "Poll" %>
|
||||
<li><a href="<%= poll_path(ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> 发布了问卷:<%= ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name %>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>发布了问卷:<%= ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name%></a></li>
|
||||
<% elsif ma.course_message_type == "Message" %>
|
||||
<% content = ma.course_message.parent_id.nil? ? ma.course_message.subject : ma.course_message.content.html_safe %>
|
||||
<% href = course_boards_path(ma.course_message.course, :parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id, :topic_id => ma.course_message.id) %>
|
||||
<li><a href="<%= href %>" target="_blank" title="<%=ma.course_message.author.show_name %> <%= ma.course_message.parent_id.nil? ? "发布了课程帖子:" : "评论了课程帖子:" %><%= content%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span><%= ma.course_message.parent_id.nil? ? "发布了课程帖子:" : "评论了课程帖子:" %><%= content%></a></li>
|
||||
<% elsif ma.course_message_type == "StudentWorksScore" %>
|
||||
<li><a href="<%= student_work_index_path(:homework => ma.course_message.student_work.homework_common_id) %>" target="_blank" title="<%=ma.course_message.reviewer_role == 3 ? '匿名用户' : ma.course_message.user.show_name+"老师" %> <%= ma.status == 0 ? "评阅了您的作品:" : "重新评阅了您的作品:" %><%= ma.content.html_safe if !ma.content.nil?%>"><span class="shadowbox_news_user"><%=ma.course_message.reviewer_role == 3 ? '匿名用户' : ma.course_message.user.show_name+"老师" %> </span><%= ma.status == 0 ? "评阅了您的作品:" : "重新评阅了您的作品:" %><%= ma.content.html_safe if !ma.content.nil?%></a></li>
|
||||
<% elsif ma.course_message_type == "JournalsForMessage" %>
|
||||
<% if ma.course_message.jour_type == 'Course' %>
|
||||
<li><a href="<%= course_feedback_path(ma.course_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> 在课程中留言了:<%= ma.course_message.notes.html_safe%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>在课程中留言了:<%= ma.course_message.notes.html_safe%></a></li>
|
||||
<% elsif ma.course_message.jour_type == 'HomeworkCommon' %>
|
||||
<li><a href="<%= homework_common_index_url_in_org(ma.course_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> <%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= ma.course_message.notes.html_safe%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span><%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= ma.course_message.notes.html_safe%></a></li>
|
||||
<% else %>
|
||||
<li><a href="<%= student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id,:show_work_id => ma.course_message.jour.student_work_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %><%=ma.course_message.user.allowed_to?(:as_teacher, ma.course) ? '老师' : '同学' %> 回复了作品评论:<%= ma.course_message.notes%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %><%=ma.course_message.user.allowed_to?(:as_teacher, ma.course) ? '老师' : '同学' %> </span>回复了作品评论:<%= ma.course_message.notes%></a></li>
|
||||
<% end %>
|
||||
<% elsif ma.course_message_type == "StudentWork" && !ma.course_message.homework_common.nil? && !User.current.allowed_to?(:as_teacher, ma.course_message.homework_common.course) %>
|
||||
<li><a href="<%=student_work_index_path(:homework => ma.course_message.homework_common_id) %>" target="_blank" title="<%=ma.course_message.homework_common.user.show_name %>老师 发布的作业:<%=ma.course_message.homework_common.name %>,由于迟交作业,您及您的作品都不能参与该作业的匿评"><span class="shadowbox_news_user"><%=ma.course_message.homework_common.user.show_name %>老师 </span>发布的作业:<%=ma.course_message.homework_common.name %>,由于迟交作业,您及您的作品都不能参与该作业的匿评</a></li>
|
||||
<% elsif ma.course_message_type == "StudentWork" && ma.status == 1 %>
|
||||
<li><a href="<%=student_work_index_path(:homework => ma.course_message.homework_common_id, :show_work_id => ma.course_message_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>同学 重新提交了作品:<%=ma.course_message.name %>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>同学 </span>重新提交了作品:<%=ma.course_message.name %></a></li>
|
||||
<% elsif ma.course_message_type == "StudentWork" && ma.status == 2 %>
|
||||
<li><a href="<%=student_work_index_path(:homework => ma.course_message.homework_common_id, :show_work_id => ma.course_message_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>同学 追加新附件了:作业标题:<%=ma.course_message.homework_common.name %>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>同学 </span>追加新附件了:作业标题:<%=ma.course_message.homework_common.name %></a></li>
|
||||
<% elsif ma.course_message_type == "Course" %>
|
||||
<li><a href="<%=course_path(ma.course_message) %>" target="_blank" title="系统提示 您成功创建了课程:课程名称:<%=ma.course_message.name %>"><span class="shadowbox_news_user">系统提示 </span>您成功创建了课程:课程名称:<%=ma.course_message.name %></a></li>
|
||||
<% elsif ma.course_message_type == "JoinCourseRequest" %>
|
||||
<% content = User.find(ma.course_message_id).name+"申请成为课程\""+"#{Course.find(ma.course_id).name}"+"\"的"+"#{ma.content == '9' ? "教师" : "教辅"}" %>
|
||||
<li><a href="<%=user_path(User.find(ma.course_message_id), :course_id => ma.course_id) %>" target="_blank" title="系统提示 您有了新的课程成员申请:<%=content %>"><span class="shadowbox_news_user">系统提示 </span>您有了新的课程成员申请:<%=content %></a></li>
|
||||
<% elsif ma.course_message_type == "CourseRequestDealResult" %>
|
||||
<% content = ma.status == 1 ? '您申请成为课程"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'申请已通过' : '您申请成为课程"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'的申请被拒绝' %>
|
||||
<li><a href="<%=course_path(Course.find(ma.course_id)) %>" target="_blank" title="系统提示 课程申请进度反馈:<%=content %>"><span class="shadowbox_news_user">系统提示 </span>课程申请进度反馈:<%=content %></a></li>
|
||||
<% elsif ma.course_message_type == "JoinCourse" and ma.status == 0 %>
|
||||
<li><a href="<%=course_member_path(ma.course) %>" target="_blank" title="<%=User.find(ma.course_message_id).show_name %> 将您加入了课程:<%=ma.course.name %>"><span class="shadowbox_news_user"><%=User.find(ma.course_message_id).show_name %> </span>将您加入了课程:<%=ma.course.name %></a></li>
|
||||
<% elsif ma.course_message_type == "JoinCourse" and ma.status == 1 %>
|
||||
<li><a href="<%=user_path(ma.course_message_id) %>" target="_blank" title="系统提示 您增加了新的课程成员:<%=User.find(ma.course_message_id).login+"("+User.find(ma.course_message_id).show_name+")" %>"><span class="shadowbox_news_user">系统提示 </span>您增加了新的课程成员:<%=User.find(ma.course_message_id).login+"("+User.find(ma.course_message_id).show_name+")" %></a></li>
|
||||
<% elsif ma.course_message_type == "RemoveFromCourse" %>
|
||||
<li><a href="<%=member_course_path(ma.course) %>" target="_blank" title="<%=User.find(ma.course_message_id).show_name %> 将您移出了课程:<%=ma.course.name %>"><span class="shadowbox_news_user"><%=User.find(ma.course_message_id).show_name %> </span>将您移出了课程:<%=ma.course.name %></a></li>
|
||||
<% elsif ma.course_message_type == "Exercise" && ma.status == 2 %>
|
||||
<li><a href="<%=exercise_path(:id => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布了课程测验:测验题目:<%=ma.course_message.exercise_name %>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布了课程测验:测验题目:<%=ma.course_message.exercise_name %></a></li>
|
||||
<% elsif ma.course_message_type == "Exercise" && ma.status == 3 %>
|
||||
<li><a href="<%=exercise_path(:id => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布的测验:<%=ma.course_message.exercise_name %> 截止时间快到了"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布的测验:<%=ma.course_message.exercise_name %> 截止时间快到了</a></li>
|
||||
<% end %>
|
||||
<% elsif ma.class == ForgeMessage %>
|
||||
<% if ma.forge_message_type == "AppliedProject" %>
|
||||
<li><a href="<%=settings_project_path(:id => ma.project, :tab => "members") %>" target="_blank" title="<%=ma.forge_message.user.show_name %> 申请加入项目:<%= ma.project.name%>"><span class="shadowbox_news_user"><%=ma.forge_message.user.show_name %> </span>申请加入项目:<%= ma.project.name%></a></li>
|
||||
<% elsif ma.forge_message_type == "JoinProject" %>
|
||||
<li><a href="<%=project_member_path(ma.project) %>" target="_blank" title="<%=User.find(ma.forge_message_id).show_name %> 将您加入了项目:<%= ma.project.name%>"><span class="shadowbox_news_user"><%=User.find(ma.forge_message_id).show_name %> </span>将您加入了项目:<%= ma.project.name%></a></li>
|
||||
<% elsif ma.forge_message_type == "RemoveFromProject" %>
|
||||
<li><a href="<%=member_project_path(ma.project) %>" target="_blank" title="<%=User.find(ma.forge_message_id).show_name %> 将您移出了项目:<%= ma.project.name%>"><span class="shadowbox_news_user"><%=User.find(ma.forge_message_id).show_name %> </span>将您移出了项目:<%= ma.project.name%></a></li>
|
||||
<% elsif ma.forge_message_type == "RemoveFromProject" %>
|
||||
<li><a href="<%=project_path(ma.project) %>" target="_blank" title="<%=User.find(ma.forge_message_id).show_name %> 邀请你加入项目:<%= ma.project.name%>"><span class="shadowbox_news_user"><%=User.find(ma.forge_message_id).show_name %> </span>邀请你加入项目:<%= ma.project.name%></a></li>
|
||||
<% elsif ma.forge_message_type == "Issue" && ma.status == 1 %>
|
||||
<li><a href="<%=issue_path(:id => ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.tracker_id == 5 ? "发布的周报:":"指派给你的问题:"%><%= ma.forge_message.subject%> 截止时间快到了!"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.tracker_id == 5 ? "发布的周报:":"指派给你的问题:"%><%= ma.forge_message.subject%> 截止时间快到了!</a></li>
|
||||
<% elsif ma.forge_message_type == "Issue" && ma.status != 1 %>
|
||||
<li><a href="<%=issue_path(:id => ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.tracker_id == 5 ? "发布了周报:":"指派了问题给你:"%><%= ma.forge_message.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.tracker_id == 5 ? "发布了周报:":"指派了问题给你:"%><%= ma.forge_message.subject%></a></li>
|
||||
<% elsif ma.forge_message_type == "Journal" %>
|
||||
<li><a href="<%=issue_path(:id => ma.forge_message.journalized_id) %>" target="_blank" title="<%=ma.forge_message.user.show_name %> 更新了问题状态:<%= ma.forge_message.journalized.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.user.show_name %> </span>更新了问题状态:<%= ma.forge_message.journalized.subject%></a></li>
|
||||
<% elsif ma.forge_message_type == "Message" %>
|
||||
<li><a href="<%=project_boards_path(ma.forge_message.project,:parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id,:topic_id => ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %><%= ma.forge_message.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %><%= ma.forge_message.subject%></a></li>
|
||||
<% elsif ma.forge_message_type == "News" %>
|
||||
<li><a href="<%=news_path(ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> 发布了新闻:<%= ma.forge_message.title.html_safe%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span>发布了新闻:<%= ma.forge_message.title.html_safe%></a></li>
|
||||
<% elsif ma.forge_message_type == "Comment" %>
|
||||
<li><a href="<%=news_path(ma.forge_message.commented.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> 评论了新闻:<%= ma.forge_message.commented.title%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span>评论了新闻:<%= ma.forge_message.commented.title%></a></li>
|
||||
<% end %>
|
||||
<% elsif ma.class == MemoMessage %>
|
||||
<% if ma.memo_type == "Memo" %>
|
||||
<li><a href="<%=forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id) %>" target="_blank" title="<%=ma.memo.author.show_name %> <%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %><%= ma.memo.parent_id.nil? ? ma.memo.subject : ma.memo.content.html_safe%>"><span class="shadowbox_news_user"><%=ma.memo.author.show_name %> </span><%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %><%= ma.memo.parent_id.nil? ? ma.memo.subject : ma.memo.content.html_safe%></a></li>
|
||||
<% end %>
|
||||
<% elsif ma.class == UserFeedbackMessage %>
|
||||
<% if ma.journals_for_message_type == "JournalsForMessage" %>
|
||||
<li><a href="<%=feedback_path(ma.journals_for_message.jour_id) %>" target="_blank" title="<%=ma.journals_for_message.user.show_name %> <%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %><%= ma.journals_for_message.notes.gsub("<p>","").gsub("</p>","").gsub("<br />","").html_safe%>"><span class="shadowbox_news_user"><%=ma.journals_for_message.user.show_name %> </span><%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %><%= ma.journals_for_message.notes.gsub("<p>","").gsub("</p>","").gsub("<br />","").html_safe%></a></li>
|
||||
<% end %>
|
||||
<% elsif ma.class == OrgMessage %>
|
||||
<% if ma.message_type == 'ApplySubdomain' %>
|
||||
<li><a href="<%=feedback_path(ma.journals_for_message.jour_id) %>" target="_blank" title="<%=ma.organization.name %> 申请子域名:<%= (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count == 0 || (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count > 0 && Secdomain.where("sub_type=2 and pid=?", ma.organization.id).first.subname != ma.content)) ? "同意申请":"申请已批准"%>"><span class="shadowbox_news_user"><%=ma.organization.name %> </span>申请子域名:<%= (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count == 0 || (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count > 0 && Secdomain.where("sub_type=2 and pid=?", ma.organization.id).first.subname != ma.content)) ? "同意申请":"申请已批准"%></a></li>
|
||||
<% elsif ma.message_type == 'AgreeApplySubdomain' %>
|
||||
<li><a href="javascript:void(0)" target="_blank" title="系统提示 管理员同意了您的子域名申请:<%= ma.content%>"><span class="shadowbox_news_user">系统提示 </span>管理员同意了您的子域名申请:<%= ma.content%></a></li>
|
||||
<% end %>
|
||||
<% elsif AtMessage === ma && ma.at_valid? %>
|
||||
<% if ma.at_message_type == "Message" && !ma.at_message.course.nil? %>
|
||||
<% href = course_boards_path(ma.at_message.course,:parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id) %>
|
||||
<li><a href="<%=href %>" target="_blank" title="<%=ma.author.show_name %> 提到了你:<%= ma.subject.html_safe%>"><span class="shadowbox_news_user"><%=ma.author.show_name %> </span>提到了你:<%= ma.subject.html_safe%></a></li>
|
||||
<% elsif ma.at_message_type == "Message" && !ma.at_message.project.nil? %>
|
||||
<% href = project_boards_path(ma.at_message.project,:parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id) %>
|
||||
<li><a href="<%=href %>" target="_blank" title="<%=ma.author.show_name %> 提到了你:<%= ma.subject.html_safe%>"><span class="shadowbox_news_user"><%=ma.author.show_name %> </span>提到了你:<%= ma.subject.html_safe%></a></li>
|
||||
<% elsif ma.course_message_type == "ApplyResource" && ma.status == 1 %>
|
||||
<% if ma.course_message.container_type == "Course" %>
|
||||
<% href = course_files_path(ma.course_message.container_id) %>
|
||||
<% elsif ma.course_message.container_type == "Project" %>
|
||||
<% href = project_files_path(ma.course_message.container_id) %>
|
||||
<% elsif ma.course_message.container_type == "OrgSubfield" %>
|
||||
<% href = org_subfield_files_path(ma.course_message.container_id) %>
|
||||
<% else %>
|
||||
<% content = '<span class="shadowbox_news_user">'+ma.author.show_name+' </span>提到了你:'+ma.subject.html_safe %>
|
||||
<li><%=link_to content.html_safe, ma.url, :title => ma.author.show_name+' 提到了你:'+ma.subject.html_safe, :target => '_blank' %></li>
|
||||
<% href = 'javascript:void(0)' %>
|
||||
<% end %>
|
||||
<li><a href="<%= href %>" target="_blank" title="<%=User.find(ma.course_message.apply_user_id).show_name %> <%= ma.apply_result == 2 ? '同意' : '拒绝'%>引用资源:<%= ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)%>"><span class="shadowbox_news_user"><%=User.find(ma.course_message.apply_user_id).show_name %> </span><%= ma.apply_result == 2 ? '同意' : '拒绝'%>引用资源:<%= ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)%></a></li>
|
||||
<% elsif ma.course_message_type == "Poll" %>
|
||||
<li><a href="<%= poll_path(ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> 发布了问卷:<%= ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name %>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>发布了问卷:<%= ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name%></a></li>
|
||||
<% elsif ma.course_message_type == "Message" %>
|
||||
<% content = ma.course_message.parent_id.nil? ? ma.course_message.subject : ma.course_message.content.html_safe %>
|
||||
<% href = course_boards_path(ma.course_message.course, :parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id, :topic_id => ma.course_message.id) %>
|
||||
<li><a href="<%= href %>" target="_blank" title="<%=ma.course_message.author.show_name %> <%= ma.course_message.parent_id.nil? ? "发布了课程帖子:" : "评论了课程帖子:" %><%= content%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span><%= ma.course_message.parent_id.nil? ? "发布了课程帖子:" : "评论了课程帖子:" %><%= content%></a></li>
|
||||
<% elsif ma.course_message_type == "StudentWorksScore" %>
|
||||
<li><a href="<%= student_work_index_path(:homework => ma.course_message.student_work.homework_common_id) %>" target="_blank" title="<%=ma.course_message.reviewer_role == 3 ? '匿名用户' : ma.course_message.user.show_name+"老师" %> <%= ma.status == 0 ? "评阅了您的作品:" : "重新评阅了您的作品:" %><%= ma.content.html_safe if !ma.content.nil?%>"><span class="shadowbox_news_user"><%=ma.course_message.reviewer_role == 3 ? '匿名用户' : ma.course_message.user.show_name+"老师" %> </span><%= ma.status == 0 ? "评阅了您的作品:" : "重新评阅了您的作品:" %><%= ma.content.html_safe if !ma.content.nil?%></a></li>
|
||||
<% elsif ma.course_message_type == "JournalsForMessage" %>
|
||||
<% if ma.course_message.jour_type == 'Course' %>
|
||||
<li><a href="<%= course_feedback_path(ma.course_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> 在课程中留言了:<%= ma.course_message.notes.html_safe%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>在课程中留言了:<%= ma.course_message.notes.html_safe%></a></li>
|
||||
<% elsif ma.course_message.jour_type == 'HomeworkCommon' %>
|
||||
<li><a href="<%= homework_common_index_url_in_org(ma.course_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> <%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= ma.course_message.notes.html_safe%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span><%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= ma.course_message.notes.html_safe%></a></li>
|
||||
<% else %>
|
||||
<li><a href="<%= student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id,:show_work_id => ma.course_message.jour.student_work_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %><%=ma.course_message.user.allowed_to?(:as_teacher, ma.course) ? '老师' : '同学' %> 回复了作品评论:<%= ma.course_message.notes%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %><%=ma.course_message.user.allowed_to?(:as_teacher, ma.course) ? '老师' : '同学' %> </span>回复了作品评论:<%= ma.course_message.notes%></a></li>
|
||||
<% end %>
|
||||
<% elsif ma.course_message_type == "StudentWork" && !ma.course_message.homework_common.nil? && !User.current.allowed_to?(:as_teacher, ma.course_message.homework_common.course) %>
|
||||
<li><a href="<%=student_work_index_path(:homework => ma.course_message.homework_common_id) %>" target="_blank" title="<%=ma.course_message.homework_common.user.show_name %>老师 发布的作业:<%=ma.course_message.homework_common.name %>,由于迟交作业,您及您的作品都不能参与该作业的匿评"><span class="shadowbox_news_user"><%=ma.course_message.homework_common.user.show_name %>老师 </span>发布的作业:<%=ma.course_message.homework_common.name %>,由于迟交作业,您及您的作品都不能参与该作业的匿评</a></li>
|
||||
<% elsif ma.course_message_type == "StudentWork" && ma.status == 1 %>
|
||||
<li><a href="<%=student_work_index_path(:homework => ma.course_message.homework_common_id, :show_work_id => ma.course_message_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>同学 重新提交了作品:<%=ma.course_message.name %>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>同学 </span>重新提交了作品:<%=ma.course_message.name %></a></li>
|
||||
<% elsif ma.course_message_type == "StudentWork" && ma.status == 2 %>
|
||||
<li><a href="<%=student_work_index_path(:homework => ma.course_message.homework_common_id, :show_work_id => ma.course_message_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>同学 追加新附件了:作业标题:<%=ma.course_message.homework_common.name %>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>同学 </span>追加新附件了:作业标题:<%=ma.course_message.homework_common.name %></a></li>
|
||||
<% elsif ma.course_message_type == "Course" %>
|
||||
<li><a href="<%=course_path(ma.course_message) %>" target="_blank" title="系统提示 您成功创建了课程:课程名称:<%=ma.course_message.name %>"><span class="shadowbox_news_user">系统提示 </span>您成功创建了课程:课程名称:<%=ma.course_message.name %></a></li>
|
||||
<% elsif ma.course_message_type == "JoinCourseRequest" %>
|
||||
<% content = User.find(ma.course_message_id).name+"申请成为课程\""+"#{Course.find(ma.course_id).name}"+"\"的"+"#{ma.content == '9' ? "教师" : "教辅"}" %>
|
||||
<li><a href="<%=user_path(User.find(ma.course_message_id), :course_id => ma.course_id) %>" target="_blank" title="系统提示 您有了新的课程成员申请:<%=content %>"><span class="shadowbox_news_user">系统提示 </span>您有了新的课程成员申请:<%=content %></a></li>
|
||||
<% elsif ma.course_message_type == "CourseRequestDealResult" %>
|
||||
<% content = ma.status == 1 ? '您申请成为课程"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'申请已通过' : '您申请成为课程"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'的申请被拒绝' %>
|
||||
<li><a href="<%=course_path(Course.find(ma.course_id)) %>" target="_blank" title="系统提示 课程申请进度反馈:<%=content %>"><span class="shadowbox_news_user">系统提示 </span>课程申请进度反馈:<%=content %></a></li>
|
||||
<% elsif ma.course_message_type == "JoinCourse" and ma.status == 0 %>
|
||||
<li><a href="<%=course_member_path(ma.course) %>" target="_blank" title="<%=User.find(ma.course_message_id).show_name %> 将您加入了课程:<%=ma.course.name %>"><span class="shadowbox_news_user"><%=User.find(ma.course_message_id).show_name %> </span>将您加入了课程:<%=ma.course.name %></a></li>
|
||||
<% elsif ma.course_message_type == "JoinCourse" and ma.status == 1 %>
|
||||
<li><a href="<%=user_path(ma.course_message_id) %>" target="_blank" title="系统提示 您增加了新的课程成员:<%=User.find(ma.course_message_id).login+"("+User.find(ma.course_message_id).show_name+")" %>"><span class="shadowbox_news_user">系统提示 </span>您增加了新的课程成员:<%=User.find(ma.course_message_id).login+"("+User.find(ma.course_message_id).show_name+")" %></a></li>
|
||||
<% elsif ma.course_message_type == "RemoveFromCourse" %>
|
||||
<li><a href="<%=member_course_path(ma.course) %>" target="_blank" title="<%=User.find(ma.course_message_id).show_name %> 将您移出了课程:<%=ma.course.name %>"><span class="shadowbox_news_user"><%=User.find(ma.course_message_id).show_name %> </span>将您移出了课程:<%=ma.course.name %></a></li>
|
||||
<% elsif ma.course_message_type == "Exercise" && ma.status == 2 %>
|
||||
<li><a href="<%=exercise_path(:id => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布了课程测验:测验题目:<%=ma.course_message.exercise_name %>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布了课程测验:测验题目:<%=ma.course_message.exercise_name %></a></li>
|
||||
<% elsif ma.course_message_type == "Exercise" && ma.status == 3 %>
|
||||
<li><a href="<%=exercise_path(:id => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布的测验:<%=ma.course_message.exercise_name %> 截止时间快到了"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布的测验:<%=ma.course_message.exercise_name %> 截止时间快到了</a></li>
|
||||
<% end %>
|
||||
<% elsif ma.class == ForgeMessage %>
|
||||
<% if ma.forge_message_type == "AppliedProject" %>
|
||||
<li><a href="<%=settings_project_path(:id => ma.project, :tab => "members") %>" target="_blank" title="<%=ma.forge_message.user.show_name %> 申请加入项目:<%= ma.project.name%>"><span class="shadowbox_news_user"><%=ma.forge_message.user.show_name %> </span>申请加入项目:<%= ma.project.name%></a></li>
|
||||
<% elsif ma.forge_message_type == "JoinProject" %>
|
||||
<li><a href="<%=project_member_path(ma.project) %>" target="_blank" title="<%=User.find(ma.forge_message_id).show_name %> 将您加入了项目:<%= ma.project.name%>"><span class="shadowbox_news_user"><%=User.find(ma.forge_message_id).show_name %> </span>将您加入了项目:<%= ma.project.name%></a></li>
|
||||
<% elsif ma.forge_message_type == "RemoveFromProject" %>
|
||||
<li><a href="<%=member_project_path(ma.project) %>" target="_blank" title="<%=User.find(ma.forge_message_id).show_name %> 将您移出了项目:<%= ma.project.name%>"><span class="shadowbox_news_user"><%=User.find(ma.forge_message_id).show_name %> </span>将您移出了项目:<%= ma.project.name%></a></li>
|
||||
<% elsif ma.forge_message_type == "RemoveFromProject" %>
|
||||
<li><a href="<%=project_path(ma.project) %>" target="_blank" title="<%=User.find(ma.forge_message_id).show_name %> 邀请你加入项目:<%= ma.project.name%>"><span class="shadowbox_news_user"><%=User.find(ma.forge_message_id).show_name %> </span>邀请你加入项目:<%= ma.project.name%></a></li>
|
||||
<% elsif ma.forge_message_type == "Issue" && ma.status == 1 %>
|
||||
<li><a href="<%=issue_path(:id => ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.tracker_id == 5 ? "发布的周报:":"指派给你的问题:"%><%= ma.forge_message.subject%> 截止时间快到了!"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.tracker_id == 5 ? "发布的周报:":"指派给你的问题:"%><%= ma.forge_message.subject%> 截止时间快到了!</a></li>
|
||||
<% elsif ma.forge_message_type == "Issue" && ma.status != 1 %>
|
||||
<li><a href="<%=issue_path(:id => ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.tracker_id == 5 ? "发布了周报:":"指派了问题给你:"%><%= ma.forge_message.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.tracker_id == 5 ? "发布了周报:":"指派了问题给你:"%><%= ma.forge_message.subject%></a></li>
|
||||
<% elsif ma.forge_message_type == "Journal" %>
|
||||
<li><a href="<%=issue_path(:id => ma.forge_message.journalized_id) %>" target="_blank" title="<%=ma.forge_message.user.show_name %> 更新了问题状态:<%= ma.forge_message.journalized.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.user.show_name %> </span>更新了问题状态:<%= ma.forge_message.journalized.subject%></a></li>
|
||||
<% elsif ma.forge_message_type == "Message" %>
|
||||
<li><a href="<%=project_boards_path(ma.forge_message.project,:parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id,:topic_id => ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> <%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %><%= ma.forge_message.subject%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %><%= ma.forge_message.subject%></a></li>
|
||||
<% elsif ma.forge_message_type == "News" %>
|
||||
<li><a href="<%=news_path(ma.forge_message.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> 发布了新闻:<%= ma.forge_message.title.html_safe%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span>发布了新闻:<%= ma.forge_message.title.html_safe%></a></li>
|
||||
<% elsif ma.forge_message_type == "Comment" %>
|
||||
<li><a href="<%=news_path(ma.forge_message.commented.id) %>" target="_blank" title="<%=ma.forge_message.author.show_name %> 评论了新闻:<%= ma.forge_message.commented.title%>"><span class="shadowbox_news_user"><%=ma.forge_message.author.show_name %> </span>评论了新闻:<%= ma.forge_message.commented.title%></a></li>
|
||||
<% end %>
|
||||
<% elsif ma.class == MemoMessage %>
|
||||
<% if ma.memo_type == "Memo" %>
|
||||
<li><a href="<%=forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id) %>" target="_blank" title="<%=ma.memo.author.show_name %> <%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %><%= ma.memo.parent_id.nil? ? ma.memo.subject : ma.memo.content.html_safe%>"><span class="shadowbox_news_user"><%=ma.memo.author.show_name %> </span><%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %><%= ma.memo.parent_id.nil? ? ma.memo.subject : ma.memo.content.html_safe%></a></li>
|
||||
<% end %>
|
||||
<% elsif ma.class == UserFeedbackMessage %>
|
||||
<% if ma.journals_for_message_type == "JournalsForMessage" %>
|
||||
<li><a href="<%=feedback_path(ma.journals_for_message.jour_id) %>" target="_blank" title="<%=ma.journals_for_message.user.show_name %> <%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %><%= ma.journals_for_message.notes.gsub("<p>","").gsub("</p>","").gsub("<br />","").html_safe%>"><span class="shadowbox_news_user"><%=ma.journals_for_message.user.show_name %> </span><%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %><%= ma.journals_for_message.notes.gsub("<p>","").gsub("</p>","").gsub("<br />","").html_safe%></a></li>
|
||||
<% end %>
|
||||
<% elsif ma.class == OrgMessage %>
|
||||
<% if ma.message_type == 'ApplySubdomain' %>
|
||||
<li><a href="<%=feedback_path(ma.journals_for_message.jour_id) %>" target="_blank" title="<%=ma.organization.name %> 申请子域名:<%= (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count == 0 || (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count > 0 && Secdomain.where("sub_type=2 and pid=?", ma.organization.id).first.subname != ma.content)) ? "同意申请":"申请已批准"%>"><span class="shadowbox_news_user"><%=ma.organization.name %> </span>申请子域名:<%= (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count == 0 || (Secdomain.where("sub_type=2 and pid=?", ma.organization.id).count > 0 && Secdomain.where("sub_type=2 and pid=?", ma.organization.id).first.subname != ma.content)) ? "同意申请":"申请已批准"%></a></li>
|
||||
<% elsif ma.message_type == 'AgreeApplySubdomain' %>
|
||||
<li><a href="javascript:void(0)" target="_blank" title="系统提示 管理员同意了您的子域名申请:<%= ma.content%>"><span class="shadowbox_news_user">系统提示 </span>管理员同意了您的子域名申请:<%= ma.content%></a></li>
|
||||
<% end %>
|
||||
<% elsif AtMessage === ma && ma.at_valid? %>
|
||||
<% if ma.at_message_type == "Message" && !ma.at_message.course.nil? %>
|
||||
<% href = course_boards_path(ma.at_message.course,:parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id) %>
|
||||
<li><a href="<%=href %>" target="_blank" title="<%=ma.author.show_name %> 提到了你:<%= ma.subject.html_safe%>"><span class="shadowbox_news_user"><%=ma.author.show_name %> </span>提到了你:<%= ma.subject.html_safe%></a></li>
|
||||
<% elsif ma.at_message_type == "Message" && !ma.at_message.project.nil? %>
|
||||
<% href = project_boards_path(ma.at_message.project,:parent_id => ma.at_message.parent_id ? ma.at_message.parent_id : ma.at_message.id, :topic_id => ma.at_message.id) %>
|
||||
<li><a href="<%=href %>" target="_blank" title="<%=ma.author.show_name %> 提到了你:<%= ma.subject.html_safe%>"><span class="shadowbox_news_user"><%=ma.author.show_name %> </span>提到了你:<%= ma.subject.html_safe%></a></li>
|
||||
<% else %>
|
||||
<% content = '<span class="shadowbox_news_user">'+ma.author.show_name+' </span>提到了你:'+ma.subject.html_safe %>
|
||||
<li><%=link_to content.html_safe, ma.url, :title => ma.author.show_name+' 提到了你:'+ma.subject.html_safe, :target => '_blank' %></li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
<a onclick = "show_more();" id = "show_more_messages" style="display: none; cursor: pointer;" class = "shadowbox_news_all">展开更多</a>
|
||||
|
|
Loading…
Reference in New Issue