parent
e9c7125822
commit
425e0dd89a
|
@ -115,31 +115,42 @@ class UsersController < ApplicationController
|
|||
@user_course_messages = @user.course_messages.reverse
|
||||
@user_forge_messages = @user.forge_messages.reverse
|
||||
@user_forum_messages = @user.forum_messages.reverse
|
||||
@user_course_messages_count = @user_course_messages.count
|
||||
@user_forge_messages_count = @user_forum_messages.count
|
||||
when 'homework'
|
||||
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "HomeworkCommon", @user).order("created_at desc")
|
||||
@user_forge_messages = nil
|
||||
@user_course_messages_count = @user_course_messages.count
|
||||
when 'course_message'
|
||||
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "Message", @user).order("created_at desc")
|
||||
@user_course_messages_count = @user_course_messages.count
|
||||
when 'forge_message'
|
||||
@user_forge_messages = ForgeMessage.where("forge_message_type =? and user_id =?", "Message", @user).order("created_at desc")
|
||||
when 'course_news'
|
||||
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "News", @user).order("created_at desc")
|
||||
@user_course_messages_count = @user_course_messages.count
|
||||
when 'forge_news'
|
||||
@user_forge_messages = ForgeMessage.where("forge_message_type =? and user_id =?", "News", @user).order("created_at desc")
|
||||
when 'poll'
|
||||
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "Poll", @user).order("created_at desc")
|
||||
@user_course_messages_count = @user_course_messages.count
|
||||
when 'works_reviewers'
|
||||
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "StudentWorksScore", @user).order("created_at desc")
|
||||
@user_course_messages_count = @user_course_messages.count
|
||||
when 'works_reply'
|
||||
@user_course_messages = CourseMessage.where("course_message_type =? and user_id =?", "JournalsForMessage", @user).order("created_at desc")
|
||||
@user_course_messages_count = @user_course_messages.count
|
||||
when 'issue'
|
||||
@user_forge_messages = ForgeMessage.where("forge_message_type =? and user_id =?", "Issue", @user).order("created_at desc")
|
||||
@user_course_messages = nil
|
||||
@user_forge_messages_count = @user_forge_messages.count
|
||||
when 'journal' # 缺陷状态更新、留言
|
||||
@user_forge_messages = ForgeMessage.where("forge_message_type =? and user_id =?", "Forum", @user).order("created_at desc")
|
||||
@user_course_messages = nil
|
||||
@user_forge_messages_count = @user_forge_messages.count
|
||||
when 'forum'
|
||||
@user_forum_messages = ForumMessage.where("memo_message_type =? and user_id =?", "Forum", @user).order("created_at desc")
|
||||
@user_forum_messages_count = @user_forum_messages.count
|
||||
else
|
||||
render_404
|
||||
return
|
||||
end
|
||||
respond_to do |format|
|
||||
format.html{render :layout=>'base_users_new'}
|
||||
|
|
|
@ -7,19 +7,31 @@
|
|||
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
|
||||
<ul class="newsType">
|
||||
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "全部",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user} %></a></li>
|
||||
<!--<li><a href="javascript:void(0);" class="resourcesGrey">@我</a></li>-->
|
||||
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "作业消息",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'homework'} %></a></li>
|
||||
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "课程讨论区",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'course_message'} %></a></li>
|
||||
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "课程通知",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'course_news'} %></a></li>
|
||||
<!--<li><a href="javascript:void(0);" class="resourcesGrey">指派给我</a></li>-->
|
||||
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "问卷调查",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'poll'} %></a></li>
|
||||
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "作品评阅",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'works_reviewers'} %></a></li>
|
||||
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "作品讨论",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'works_reply'} %></a></li>
|
||||
|
||||
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "指派给我",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'issue'} %></a></li>
|
||||
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "问题更新",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'issue_update'} %></a></li>
|
||||
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "项目讨论区",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'forge_message'} %></a></li>
|
||||
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "项目新闻",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'forge_news'} %></a></li>
|
||||
<%# 课程相关消息 %>
|
||||
<% unless @user_course_messages.nil? %>
|
||||
<% unless @user_course_messages_count > 0 %>
|
||||
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "作业消息",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'homework'} %></a></li>
|
||||
<% end %>
|
||||
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "课程讨论区",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'course_message'} %></a></li>
|
||||
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "发布了课程通知",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'course_news'} %></a></li>
|
||||
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "问卷调查",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'poll'} %></a></li>
|
||||
<% unless @user_course_messages_count > 0 %>
|
||||
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "作品评阅",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'works_reviewers'} %></a></li>
|
||||
<% end %>
|
||||
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "作品讨论",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'works_reply'} %></a></li>
|
||||
<% end %>
|
||||
<%# 项目相关消息 %>
|
||||
<% unless @user_forge_messages.nil? %>
|
||||
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "指派给我",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'issue'} %></a></li>
|
||||
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "更新了问题",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'issue_update'} %></a></li>
|
||||
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "项目讨论区",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'forge_message'} %></a></li>
|
||||
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "发布了新闻",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'forge_news'} %></a></li>
|
||||
<% end %>
|
||||
<%# 公共贴吧 %>
|
||||
<% unless @user_forum_messages.nil? %>
|
||||
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "发布了帖子",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'forum'} %></a></li>
|
||||
<% end %>
|
||||
<%# 用户留言 %>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -82,7 +94,7 @@
|
|||
<li class="homepageNewsPublisher fl"><a href="javascript:void(0);" class="<%=ucm.viewed == 0?"newsBlack":"newsBlue"%>"><%= ucm.course_message.user %></a></li>
|
||||
<li class="<%= ucm.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">作品评阅</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ucm.course_message.comment, nil,:class=>"#{ucm.viewed==0?"newsBlack":"newsGrey"}" %></a></li>
|
||||
<%= link_to ucm.course_message.comment, student_work_path(ucm.course_message.id),:class=>"#{ucm.viewed==0?"newsBlack":"newsGrey"}" %> %></a></li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -92,7 +104,7 @@
|
|||
<li class="homepageNewsPublisher fl"><a href="javascript:void(0);" class="<%=ucm.viewed == 0?"newsBlack":"newsBlue"%>"><%= ucm.course_message.user %></a></li>
|
||||
<li class="<%= ucm.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">作品讨论</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ucm.course_message.notes, nil,:class=>"#{ucm.viewed==0?"newsBlack":"newsGrey"}" %></a></li>
|
||||
<%= link_to ucm.course_message.notes, student_work_path(ucm.course_message.id),:class=>"#{ucm.viewed==0?"newsBlack":"newsGrey"}" %></a></li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_on).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -167,6 +179,8 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% unless @user_forum_messages.nil? %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="flash notice">暂无消息!</div>
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in New Issue