diff --git a/app/models/user.rb b/app/models/user.rb
index 8b5951687..63811cd58 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -269,7 +269,8 @@ class User < Principal
forge_count = ForgeMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count
user_feedback_count = UserFeedbackMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count
user_memo_count = MemoMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count
- messages_count = course_count + forge_count + user_feedback_count + user_memo_count
+ system_messages_count = SystemMessage.where("created_at >?", User.current.onclick_time.onclick_time).count
+ messages_count = course_count + forge_count + user_feedback_count + user_memo_count + system_messages_count
end
# 查询指派给我的缺陷记录
diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb
index ec2e4b748..b70eabd5c 100644
--- a/app/views/users/user_messages.html.erb
+++ b/app/views/users/user_messages.html.erb
@@ -6,8 +6,6 @@
<%= link_to "全部",user_message_path(User.current), :class => "resourcesGrey" %>
<%= link_to "未读消息", user_message_path(User.current, :type => 'unviewed'), :class => "resourcesGrey" %>
<%= link_to "用户申请", user_message_path(User.current, :type => 'apply'), :class => "resourcesGrey" %>
- <%# 系统消息 %>
- <%= link_to "系统消息", user_message_path(User.current, :type => 'system_message'), :class => "resourcesGrey" %>
<%# 课程相关消息 %>
<%= link_to "作业消息", user_message_path(User.current, :type => 'homework'), :class => "resourcesGrey" %>
<%= link_to "课程讨论",user_message_path(User.current, :type => 'course_message'), :class => "resourcesGrey" %>
@@ -26,6 +24,8 @@
<%= link_to "贴吧帖子", user_message_path(User.current, :type => 'forum'), :class => "resourcesGrey" %>
<%# 系统贴吧 %>
<%= link_to "用户留言",user_message_path(User.current, :type => 'user_feedback'), :class => "resourcesGrey" %>
+ <%# 系统消息 %>
+ <%= link_to "系统消息", user_message_path(User.current, :type => 'system_message'), :class => "resourcesGrey" %>
@@ -104,6 +104,23 @@
<%= time_tag(ma.created_at).html_safe %>
<% end %>
+ <% if ma.course_message_type == "HomeworkCommon" && ma.status == 1 %>
+
+ - <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
+ - <%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>">发布的作业:
+ <% if ma.viewed == 0 %>
+ -
+ <%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{ma.course_message.name}" %>
+
+ - 截止时间快到了!
+ <% else %>
+ -
+ <%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{ma.course_message.name}" %>
+
+ <% end %>
+ - <%= time_tag(ma.created_at).html_safe %>
+
+ <% end %>
<% if ma.course_message_type == "Poll" %>
- <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css
index f8000f674..a233b6577 100644
--- a/public/stylesheets/new_user.css
+++ b/public/stylesheets/new_user.css
@@ -514,6 +514,9 @@ a.homepageMenuText {color:#484848; font-size:16px; margin-left:20px;}
.homepageNewsType {width:110px; padding-left: 5px; font-size:12px; color:#888888; display:block;}
.homepageNewsPubType {width:220px; font-size:12px; color:#888888; display: block;}
.homepageNewsContent {width:365px; max-width:365px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; }
+.homepageHomeworkContentWarn {width:110px; max-width:365px; margin-right:10px; font-size:12px; color:red; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; }
+.homepageHomeworkContent {width:245px; max-width:365px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; }
+
.homepageNewsTime {width:75px; font-size:12px; color:#888888; display:block; text-align:right;}
a.homepageWhite {color:#ffffff;}
a.homepageWhite:hover {color:#a1ebff}