新增班级成员的消息通知,跳转至该班级的成员配置页面

This commit is contained in:
cxt 2016-07-18 11:19:56 +08:00
parent 05fe987a8b
commit a9ee1d10cd
2 changed files with 4 additions and 2 deletions

View File

@ -301,7 +301,6 @@ class CoursesController < ApplicationController
def member
## 有角色参数的才是课程,没有的就是项目
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course)))
@render_file = 'new_member_list'
@score_sort_by = "desc"
@sort_type = params[:sort_type] ? params[:sort_type] : "score"
@ -414,6 +413,9 @@ class CoursesController < ApplicationController
end
def settings
#添加成员消息状态
join_course_messages = CourseMessage.where("user_id =? and course_message_type =? and course_id =? and status = ? and viewed =?", User.current.id, 'JoinCourse', @course.id, 1, 0)
join_course_messages.update_all(:viewed => true)
if User.current.allowed_to?(:as_teacher,@course)
@select_tab = params[:tab]
@issue_custom_fields = IssueCustomField.sorted.all

View File

@ -653,7 +653,7 @@
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您增加了新的班级成员:</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to User.find(ma.course_message_id).login+"("+(User.find(ma.course_message_id).realname ? User.find(ma.course_message_id).realname : User.find(ma.course_message_id).login) +")", user_path(ma.course_message_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
<%= link_to User.find(ma.course_message_id).login+"("+(User.find(ma.course_message_id).realname ? User.find(ma.course_message_id).realname : User.find(ma.course_message_id).login) +")", {:controller => 'courses', :action => 'settings', :id => ma.course_id, :tab=>'member'}, :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
<!--:onmouseover => "message_titile_show($(this),event)",-->
<!--:onmouseout => "message_titile_hide($(this))" %>-->
</a>