修改消息中存在的页面bug
This commit is contained in:
parent
93f44287aa
commit
ff53840029
|
@ -109,7 +109,7 @@ class UsersController < ApplicationController
|
|||
# if User.current.id == @user.id
|
||||
# querys.update_all(:viewed => true)
|
||||
# end
|
||||
@new_message_count = ForgeMessage.all.count
|
||||
@new_message_count = @user.forge_messages.count + @user.memo_messages.count + @user.course_messages.count + @user.user_feedback_messages.count
|
||||
case params[:type]
|
||||
when nil
|
||||
@user_course_messages = @user.course_messages.reverse
|
||||
|
|
|
@ -79,7 +79,7 @@ class Memo < ActiveRecord::Base
|
|||
receivers << self.forum.creator
|
||||
end
|
||||
# 添加发帖人
|
||||
if self.author_id != self.parent.author_id
|
||||
if self.forum.creator_id != self.parent.author_id
|
||||
receivers << self.parent.author
|
||||
end
|
||||
end
|
||||
|
|
|
@ -8,54 +8,21 @@
|
|||
<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>
|
||||
<%# 课程相关消息 %>
|
||||
<% unless @user_course_messages.nil? %>
|
||||
<% if @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 %>
|
||||
<% if @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 => 'course_message'} %></a></li>
|
||||
<% end %>
|
||||
<% if @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 => 'course_news'} %></a></li>
|
||||
<% end %>
|
||||
<% if @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 => 'poll'} %></a></li>
|
||||
<% end %>
|
||||
<% if @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 %>
|
||||
<% if @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_reply'} %></a></li>
|
||||
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%# 项目相关消息 %>
|
||||
<% unless @user_forge_messages.nil? %>
|
||||
<% if @user_forge_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 => 'issue'} %></a></li>
|
||||
<% end %>
|
||||
<% if @user_forge_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 => 'issue_update'} %></a></li>
|
||||
<% end %>
|
||||
<% if @user_forge_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 => 'forge_message'} %></a></li>
|
||||
<% end %>
|
||||
<% if @user_forge_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 => 'forge_news'} %></a></li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%# 公共贴吧 %>
|
||||
<% unless @user_memo_messages.nil? %>
|
||||
<% if @user_memo_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 => 'forum'} %></a></li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%# 用户留言 %>
|
||||
<% unless @user_feedback_messages.nil? %>
|
||||
<% if @user_feedback_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 => 'user_feedback'} %></a></li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -79,10 +46,10 @@
|
|||
<% if ucm.course_message_type == "HomeworkCommon" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ucm.course_message.user), :width => "30", :height => "30") %></a></li>
|
||||
<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="homepageNewsPublisher fl"><a href="javascript:void(0);" class="newsBlue"><%= ucm.course_message.user %></a></li>
|
||||
<li class="homepageNewsType fl">发布作业</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ("#{ucm.course_message.name}"), student_work_index_path(:homework => ucm.course_message.id),:class => "#{ucm.viewed == 0?"newsBlack":"newsGrey"}" %></a></li>
|
||||
<%= link_to ("#{ucm.course_message.name}"), student_work_index_path(:homework => ucm.course_message.id),:class => "newsGrey" %></a></li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -116,20 +83,20 @@
|
|||
<% if ucm.course_message_type == "StudentWorksScore" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ucm.course_message.user), :width => "30", :height => "30") %></a></li>
|
||||
<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="homepageNewsPublisher fl"><a href="javascript:void(0);" class="newsBlue"><%= ucm.course_message.user %></a></li>
|
||||
<li class="homepageNewsType fl">评阅了作品</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ucm.course_message.comment, student_work_path(ucm.course_message.id),:class=>"#{ucm.viewed==0?"newsBlack":"newsGrey"}" %> %></a></li>
|
||||
<%= link_to ucm.course_message.comment, student_work_index_path(:homework => ucm.course_message.student_work.homework_common_id),:class=>"newsGrey" %></a></li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% if ucm.course_message_type == "JournalsForMessage" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(ucm.course_message.user), :width => "30", :height => "30") %></a></li>
|
||||
<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="homepageNewsPublisher fl"><a href="javascript:void(0);" class="newsBlue"><%= ucm.course_message.user %></a></li>
|
||||
<li class="homepageNewsType fl">回复了作品</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ucm.course_message.notes, student_work_path(ucm.course_message.id),:class=>"#{ucm.viewed==0?"newsBlack":"newsGrey"}" %></a></li>
|
||||
<%= link_to ucm.course_message.notes, student_work_index_path(:homework => ucm.course_message.jour.student_work.homework_common_id),:class=>"newsGrey" %></a></li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ucm.course_message.created_on).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -147,7 +114,7 @@
|
|||
<li class="homepageNewsPublisher fl">
|
||||
<a href="javascript:void(0);" class="<%= ufm.viewed == 0 ? "newsBlack" : "newsBlue" %>"><%= ufm.forge_message.author %></a>
|
||||
</li>
|
||||
<li class="<%= ufm.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">发了问题给我</li>
|
||||
<li class="<%= ufm.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">指派问题给我</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ("#{ufm.forge_message.subject}"), issue_path(:id => ufm.forge_message.id), :class => "#{ufm.viewed == 0 ? "newsBlack" : "newsGrey"}" %></a>
|
||||
</li>
|
||||
|
@ -193,11 +160,11 @@
|
|||
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(ufm.forge_message.author), :width => "30", :height => "30") %></a>
|
||||
</li>
|
||||
<li class="homepageNewsPublisher fl">
|
||||
<a href="javascript:void(0);" class="<%= ufm.viewed == 0 ? "newsBlack" : "newsBlue" %>"><%= ufm.forge_message.author %></a>
|
||||
<a href="javascript:void(0);" class="newsBlue"><%= ufm.forge_message.author %></a>
|
||||
</li>
|
||||
<li class="<%= ufm.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">发布了项目消息</li>
|
||||
<li class="homepageNewsType fl">发布了项目消息</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ("#{ufm.forge_message.title}"), {:controller => 'news', :action => 'show', :id => ufm.forge_message.id}, :class => "#{ufm.viewed == 0 ? "newsBlack" : "newsGrey"}" %></a>
|
||||
<%= link_to ("#{ufm.forge_message.title}"), {:controller => 'news', :action => 'show', :id => ufm.forge_message.id}, :class => "newsGrey" %></a>
|
||||
</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ufm.forge_message.created_on).html_safe %> </li>
|
||||
</ul>
|
||||
|
@ -207,7 +174,7 @@
|
|||
<%# 公共贴吧 %>
|
||||
<% unless @user_memo_messages.nil? %>
|
||||
<% @user_memo_messages.each do |urm| %>
|
||||
<% if urm.memo_type == "forum" %>
|
||||
<% if urm.memo_type == "Memo" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(urm.memo.author), :width => "30", :height => "30") %></a>
|
||||
|
@ -217,7 +184,7 @@
|
|||
</li>
|
||||
<li class="homepageNewsType fl" >回复了贴吧帖子</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to urm.memo.subject, forum_memo_path(urm.memo.forum_id, urm.memo.parent_id ? urm.memo.parent_id: urm.memo.id),:class => "newsGrey" %></a>
|
||||
<%= link_to urm.memo.content, forum_memo_path(urm.memo.forum_id, urm.memo.parent_id ? urm.memo.parent_id: urm.memo.id),:class => "newsGrey" %></a>
|
||||
</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(urm.memo.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
|
|
Loading…
Reference in New Issue