课程留言更新

This commit is contained in:
ouyangxuhua 2015-09-16 12:38:01 +08:00
parent 5155e8794f
commit e463be04c3
2 changed files with 6 additions and 1 deletions

View File

@ -627,6 +627,11 @@ class CoursesController < ApplicationController
end
def feedback
@course.journals_for_messages.each do |messages|
query = messages.course_messages.where("user_id = ?", User.current.id)
query.update_all(:viewed => true);
end
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course)))
page = params[:page]
# Find the page of the requested reply

View File

@ -177,7 +177,7 @@
<a href="javascript:void(0);"><%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a>
</li>
<li class="homepageNewsPubType fl"><%= link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">发布了课程新闻</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">发布了课程留言</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.course_message.notes, course_feedback_path(:id => ma.course_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{ma.course_message.notes}" %></a>