消息列表界面新样式

This commit is contained in:
huang 2015-08-28 17:05:27 +08:00
parent 331592d78a
commit e193cb0f2d
2 changed files with 231 additions and 243 deletions

View File

@ -1,251 +1,240 @@
<div class="resources">
<div class="homepageRightBanner">
<div class="NewsBannerName">消息</div>
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="newsType">
<li><%= link_to "全部",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user}, :class => "resourcesGrey" %></li>
<%# 课程相关消息 %>
<li><%= link_to "作业消息",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'homework'}, :class => "resourcesGrey" %></li>
<li><%= link_to "课程讨论区",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'course_message'}, :class => "resourcesGrey" %></li>
<li><%= link_to "课程通知",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'course_news'}, :class => "resourcesGrey" %></li>
<li><%= link_to "通知回复",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'course_news_reply'}, :class => "resourcesGrey" %></li>
<li><%= link_to "课程问卷",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'poll'}, :class => "resourcesGrey" %></a></li>
<li><%= link_to "作品评阅",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'works_reviewers'}, :class => "resourcesGrey" %></li>
<li><%= link_to "作品讨论",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'works_reply'}, :class => "resourcesGrey" %></li>
<%# 项目相关消息 %>
<li><%= link_to "指派问题",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'issue'}, :class => "resourcesGrey" %></li>
<li><%= link_to "问题更新",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'issue_update'}, :class => "resourcesGrey" %></li>
<li><%= link_to "项目讨论区",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'forge_message'}, :class => "resourcesGrey" %></li>
<li><%= link_to "项目新闻",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'forge_news'}, :class => "resourcesGrey" %></li>
<li><%= link_to "新闻回复",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'forge_news_reply'}, :class => "resourcesGrey" %></li>
<%# 项目相关消息 %>
<li><%= link_to "贴吧帖子",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'forum'}, :class => "resourcesGrey" %></li>
<%# 系统贴吧 %>
<li><%= link_to "用户留言",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'user_feedback'}, :class => "resourcesGrey" %></li>
<div class="resources">
<div class="homepageRightBanner">
<div class="NewsBannerName">消息</div>
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="newsType">
<li><%= link_to "全部",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user}, :class => "resourcesGrey" %></li>
<%# 课程相关消息 %>
<li><%= link_to "作业消息",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'homework'}, :class => "resourcesGrey" %></li>
<li><%= link_to "课程讨论区",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'course_message'}, :class => "resourcesGrey" %></li>
<li><%= link_to "课程通知",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'course_news'}, :class => "resourcesGrey" %></li>
<li><%= link_to "通知回复",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'course_news_reply'}, :class => "resourcesGrey" %></li>
<li><%= link_to "课程问卷",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'poll'}, :class => "resourcesGrey" %></a></li>
<li><%= link_to "作品评阅",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'works_reviewers'}, :class => "resourcesGrey" %></li>
<li><%= link_to "作品讨论",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'works_reply'}, :class => "resourcesGrey" %></li>
<%# 项目相关消息 %>
<li><%= link_to "指派问题",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'issue'}, :class => "resourcesGrey" %></li>
<li><%= link_to "问题更新",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'issue_update'}, :class => "resourcesGrey" %></li>
<li><%= link_to "项目讨论区",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'forge_message'}, :class => "resourcesGrey" %></li>
<li><%= link_to "项目新闻",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'forge_news'}, :class => "resourcesGrey" %></li>
<li><%= link_to "新闻回复",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'forge_news_reply'}, :class => "resourcesGrey" %></li>
<%# 项目相关消息 %>
<li><%= link_to "贴吧帖子",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'forum'}, :class => "resourcesGrey" %></li>
<%# 系统贴吧 %>
<li><%= link_to "用户留言",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'user_feedback'}, :class => "resourcesGrey" %></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="resources mt10" id="users_setting">
<div>
<% if @message_alls.count >0 %>
<%# 课程消息 %>
<% unless @message_alls.nil? %>
<% @message_alls.each do |ma| %>
<% if ma.class == CourseMessage %>
<% if ma.course_message_type == "News" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"),user_path(ma.course_message.author) %></a></li>
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了通知</span></li>
<li class="homepageNewsContent fl">
<%= link_to ma.course_message.title, {:controller => 'news', :action => 'show', :id => ma.course_message.id },
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:title => "#{ma.course_message.title}" %></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "Comment" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"), user_path(ma.course_message.author) %></a></li>
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">评论了通知</span></li>
<li class="homepageNewsContent fl">
<%= link_to ma.course_message.comments.html_safe, {:controller => 'news', :action => 'show', :id => ma.course_message.commented.id },
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:title => "#{ma.course_message.comments.html_safe}" %></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "HomeworkCommon" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><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.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %><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.name, student_work_index_path(:homework => ma.course_message.id),:class => "newsGrey", :title => "#{ma.course_message.name}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "Poll" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><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.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了问卷</span></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to format_activity_title(" #{ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name}"), poll_path(ma.course_message.id),
:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{ma.course_message.polls_name}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "Message" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"), user_path(ma.course_message.author) %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue" %></li>
<% if ma.course_message.parent_id.nil? %>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了课程帖子</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%=link_to ma.course_message.subject.html_safe, course_boards_path(ma.course_message.course,:parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id,
:topic_id => ma.course_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{ma.course_message.subject.html_safe}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
<% else %>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">评论了课程帖子</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%=link_to ma.course_message.subject.html_safe, course_boards_path(ma.course_message.course,:parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id,
:topic_id => ma.course_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{ma.course_message.subject.html_safe}" %> </a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
<% end %>
</ul>
<% end %>
<% if ma.course_message_type == "StudentWorksScore" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><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="homepageNewsPublisher fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue" %></li>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.status == 0 ? "评阅了作品" : "重新评阅了作品" %></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<% unless ma.content.nil? %>
<%= link_to ma.content.html_safe, student_work_index_path(:homework => ma.course_message.student_work.homework_common_id),:class=>"newsGrey",:title => "#{ma.content.html_safe}" %></a></li>
<% end %>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "JournalsForMessage" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><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.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %><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, student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id),:class=>"newsGrey",:title => "#{ma.course_message.notes}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
</ul>
<% end %>
</ul>
</li>
</ul>
</div>
</div>
<div class="resources mt10" id="users_setting">
<div>
<% if @message_alls.count >0 %>
<%# 课程消息 %>
<% unless @message_alls.nil? %>
<% @message_alls.each do |ma| %>
<% if ma.class == CourseMessage %>
<% if ma.course_message_type == "News" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"),user_path(ma.course_message.author) %></a></li>
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了通知:</span></li>
<li class="homepageNewsContent fl">
<%= link_to ma.course_message.title, {:controller => 'news', :action => 'show', :id => ma.course_message.id },
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:title => "#{ma.course_message.title}" %></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
</ul>
<% end %>
<!--项目消息-->
<% if ma.class == ForgeMessage %>
<% if ma.forge_message_type == "Issue" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %></a>
</li>
<li class="homepageNewsPublisher fl">
<%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue" %>
</li>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">指派了问题给你</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.forge_message.subject, issue_path(:id => ma.forge_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",:title => "#{ma.forge_message.subject}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ma.forge_message_type == "Journal" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.user), :width => "30", :height => "30"), user_path(ma.forge_message.user) %></a>
</li>
<li class="homepageNewsPublisher fl">
<%=link_to ma.forge_message.user, user_path(ma.forge_message.user), :class => "newsBlue" %>
</li>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">
更新了问题状态
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to get_issue_des_update(ma.forge_message).html_safe,
issue_path(:id => ma.forge_message.journalized_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:title => "#{get_issue_des_update(ma.forge_message).html_safe}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ma.forge_message_type == "Message" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue" %></li>
<% if ma.course_message_type == "Comment" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"), user_path(ma.course_message.author) %></a></li>
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">评论了通知:</span></li>
<li class="homepageNewsContent fl">
<%= link_to ma.course_message.comments.html_safe, {:controller => 'news', :action => 'show', :id => ma.course_message.commented.id },
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:title => "#{ma.course_message.comments.html_safe}" %></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "HomeworkCommon" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><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></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),:class => "newsGrey", :title => "#{ma.course_message.name}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "Poll" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><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></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to format_activity_title(" #{ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name}"), poll_path(ma.course_message.id),
:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{ma.course_message.polls_name}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "Message" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30"), user_path(ma.course_message.author) %></a></li>
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.course_message.parent_id.nil? ? "发布了课程帖子:" : "评论了课程帖子:" %></span></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%=link_to ma.course_message.subject.html_safe, course_boards_path(ma.course_message.course,:parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id,
:topic_id => ma.course_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{ma.course_message.subject.html_safe}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子" : "评论了项目帖子" %></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%=link_to ma.forge_message.subject.html_safe, project_boards_path(ma.forge_message.project,
:parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id,
:topic_id => ma.forge_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{ma.forge_message.subject.html_safe}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ma.forge_message_type == "News" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %></a>
</li>
<li class="homepageNewsPublisher fl">
<%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue" %>
</li>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了新闻</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ("#{ma.forge_message.title.html_safe}"), {:controller => 'news', :action => 'show', :id => ma.forge_message.id}, :class => "newsGrey", :title => "#{ma.forge_message.title.html_safe}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ma.forge_message_type == "Comment" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %></a></li>
<li class="homepageNewsPublisher fl"><%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue" %></li>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">评论了新闻</li>
<li class="homepageNewsContent fl">
<%= link_to "#{ma.forge_message.comments.html_safe}",
{:controller => 'news', :action => 'show', :id => ma.forge_message.commented.id },:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{ma.forge_message.comments.html_safe}"%></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.created_on).html_safe %> </li>
</ul>
<% end %>
</ul>
<% end %>
<!--公共贴吧-->
<% if ma.class == MemoMessage %>
<% if ma.memo_type == "Memo" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.memo.author), :width => "30", :height => "30"), user_path(ma.memo.author) %></a>
</li>
<li class="homepageNewsPublisher fl">
<%=link_to ma.memo.author, user_path(ma.memo.author), :class => "newsBlue" %>
</li>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>" ><%= ma.memo.parent_id.nil? ? "在贴吧发布帖子" : "回复了贴吧帖子" %></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.memo.subject, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id),:class => "newsGrey" , :title => "#{ma.memo.content.html_safe}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.memo.created_at).html_safe %> </li>
<% if ma.course_message_type == "StudentWorksScore" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><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" %>"><%= ma.status == 0 ? "评阅了作品:" : "重新评阅了作品:" %></span></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<% unless ma.content.nil? %>
<%= link_to ma.content.html_safe, student_work_index_path(:homework => ma.course_message.student_work.homework_common_id),:class=>"newsGrey",:title => "#{ma.content.html_safe}" %></a></li>
<% end %>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% end %>
<!--用户留言-->
<% if ma.class == UserFeedbackMessage %>
<% if ma.journals_for_message_type == "JournalsForMessage" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.journals_for_message.user), :width => "30", :height => "30"), user_path(ma.journals_for_message.user) %></a>
</li>
<li class="homepageNewsPublisher fl">
<%=link_to ma.journals_for_message.user, user_path(ma.journals_for_message.user), :class => "newsBlue" %>
</li>
<li class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.journals_for_message.reply_id == 0 ? "给你留言了" : "回复了你的留言" %></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.journals_for_message.notes.html_safe, feedback_path(ma.journals_for_message.jour_id), :class => "newsGrey", :title => "#{ma.journals_for_message.notes}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.journals_for_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ma.course_message_type == "JournalsForMessage" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><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></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.course_message.notes, student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id),:class=>"newsGrey",:title => "#{ma.course_message.notes}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.course_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% end %>
<!--项目消息-->
<% if ma.class == ForgeMessage %>
<% if ma.forge_message_type == "Issue" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %></a>
</li>
<li class="homepageNewsPubType fl">
<%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %>
<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.forge_message.subject, issue_path(:id => ma.forge_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",:title => "#{ma.forge_message.subject}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% if ma.forge_message_type == "Journal" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.user), :width => "30", :height => "30"), user_path(ma.forge_message.user) %></a>
</li>
<li class="homepageNewsPubType fl">
<%=link_to ma.forge_message.user, user_path(ma.forge_message.user), :class => "newsBlue homepageNewsPublisher" %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">
更新了问题状态:</span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to get_issue_des_update(ma.forge_message).html_safe,
issue_path(:id => ma.forge_message.journalized_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:title => "#{get_issue_des_update(ma.forge_message).html_safe}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ma.forge_message_type == "Message" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %></a></li>
<li class="homepageNewsPubType fl"><%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %></span></li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%=link_to ma.forge_message.subject.html_safe, project_boards_path(ma.forge_message.project,
:parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id,
:topic_id => ma.forge_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}",
:title => "#{ma.forge_message.subject.html_safe}" %></a></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ma.forge_message_type == "News" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %></a>
</li>
<li class="homepageNewsPubType fl">
<%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %>
<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.forge_message.title.html_safe}"), {:controller => 'news', :action => 'show', :id => ma.forge_message.id}, :class => "newsGrey", :title => "#{ma.forge_message.title.html_safe}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% if ma.forge_message_type == "Comment" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %></a></li>
<li class="homepageNewsPubType fl"><%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">评论了新闻:</span></li>
<li class="homepageNewsContent fl">
<%= link_to "#{ma.forge_message.comments.html_safe}",
{:controller => 'news', :action => 'show', :id => ma.forge_message.commented.id },:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{ma.forge_message.comments.html_safe}"%></li>
<li class="homepageNewsTime fl"><%= time_tag(ma.forge_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% end %>
<!--公共贴吧-->
<% if ma.class == MemoMessage %>
<% if ma.memo_type == "Memo" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.memo.author), :width => "30", :height => "30"), user_path(ma.memo.author) %></a>
</li>
<li class="homepageNewsPubType fl">
<%=link_to ma.memo.author, user_path(ma.memo.author), :class => "newsBlue homepageNewsPublisher" %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>" ><%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %></span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.memo.subject, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id),:class => "newsGrey" , :title => "#{ma.memo.content.html_safe}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.memo.created_at).html_safe %> </li>
</ul>
<% end %>
<% end %>
<!--用户留言-->
<% if ma.class == UserFeedbackMessage %>
<% if ma.journals_for_message_type == "JournalsForMessage" %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.journals_for_message.user), :width => "30", :height => "30"), user_path(ma.journals_for_message.user) %></a>
</li>
<li class="homepageNewsPubType fl">
<%=link_to ma.journals_for_message.user, user_path(ma.journals_for_message.user), :class => "newsBlue homepageNewsPublisher" %>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %></span>
</li>
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
<%= link_to ma.journals_for_message.notes.html_safe, feedback_path(ma.journals_for_message.jour_id), :class => "newsGrey", :title => "#{ma.journals_for_message.notes}" %></a>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.journals_for_message.created_on).html_safe %> </li>
</ul>
<% end %>
<% end %>
<ul class="wlist" style=" border:none; padding-top: 15px;">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
<% end %>
<!--项目消息-->
<% else %>
<div class="flash notice">您目前还没有相关消息!</div>
<ul class="wlist" style=" border:none; padding-top: 15px;">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
<% end %>
<div class="cl"></div>
</div>
</div>
<!--项目消息-->
<% else %>
<div class="flash notice">您目前还没有相关消息!</div>
<% end %>
<div class="cl"></div>
</div>
</div>

View File

@ -527,10 +527,10 @@ a.homepageMenuText {color:#484848; font-size:16px; margin-left:20px;}
.newsReadSetting {width:700px; background-color:#f6f6f6; border-bottom:1px solid #eeeeee; margin:10px auto; height:39px; line-height:39px; vertical-align:middle; font-size:14px; color:#7a7a7a; padding-left:10px;}
.homepageNewsList {width:710px; height:49px; line-height:49px; vertical-align:middle; border-bottom:1px dashed #eaeaea; margin-left:10px;}
.homepageNewsPortrait {width:40px; display:block; margin-top:7px;}
.homepageNewsPublisher {width:80px; max-width:80px; font-size:12px; color:#15bccf; display:block; padding-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; }
.homepageNewsType {width:90px; padding-left: 5px; font-size:12px; color:#888888; display:block;}
.homepageNewsPubType {width:175px; font-size:12px; color:#888888; display: block;}
.homepageNewsContent {width:395px; max-width:395px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; }
.homepageNewsPublisher { max-width:100px; font-size:12px; color:#15bccf; display:block; padding-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; }
.homepageNewsType {width:100px; padding-left: 5px; font-size:12px; color:#888888; display:block;}
.homepageNewsPubType {width:215px; font-size:12px; color:#888888; display: block;}
.homepageNewsContent {width:355px; max-width:395px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; }
.homepageNewsTime {width:75px; font-size:12px; color:#888888; display:block; text-align:right;}
a.homepageWhite {color:#ffffff;}
a.homepageWhite:hover {color:#a1ebff}
@ -917,7 +917,6 @@ img.ui-datepicker-trigger {
margin: 7px;
}
/*消息*/
.homepageNewsType {width:95px; font-size:12px; color:#888888; display:block;}
.homepageNewsTypeNotRead {width:95px; font-size:12px; color:#888888; display:block;}
.calendar_input{border-left:none !important;border-bottom: none!important; border-top: none!important; border-right: 1px solid #d9d9d9;}
.calendar_div{border: 1px solid #d9d9d9;}