|
|
|
@ -0,0 +1,233 @@
|
|
|
|
|
<div class="homepageRight">
|
|
|
|
|
<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><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"><%= link_to "作业消息",{:controller=> 'users', :action => 'user_messages_new', 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_new', 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_new', 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_new', id: User.current.id, host: Setting.host_user, :type => 'course_news_reply'} %></a></li>
|
|
|
|
|
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "课程问卷",{:controller=> 'users', :action => 'user_messages_new', 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_new', 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_new', 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_new', 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_new', 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_new', 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_new', id: User.current.id, host: Setting.host_user, :type => 'forge_news'} %></a></li>
|
|
|
|
|
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "新闻回复",{:controller=> 'users', :action => 'user_messages_new', id: User.current.id, host: Setting.host_user, :type => 'forge_news_reply'} %></a></li>
|
|
|
|
|
<%# 项目相关消息 %>
|
|
|
|
|
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "贴吧帖子",{:controller=> 'users', :action => 'user_messages_new', id: User.current.id, host: Setting.host_user, :type => 'forum'} %></a></li>
|
|
|
|
|
<%# 系统贴吧 %>
|
|
|
|
|
<li><a href="javascript:void(0);" class="resourcesGrey"><%= link_to "用户留言",{:controller=> 'users', :action => 'user_messages_new', id: User.current.id, host: Setting.host_user, :type => 'user_feedback'} %></a></li>
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
<% if params[:type].nil? %>
|
|
|
|
|
<div class="newsReadSetting">
|
|
|
|
|
有 <span class="c_red">8</span> 封未读<a href="javascript:void(0);" class="ml15">全部设为已读</a>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
<div>
|
|
|
|
|
<% if @new_message_count >0 %>
|
|
|
|
|
<%# 课程消息 %>
|
|
|
|
|
<% unless @user_message_all.nil? %>
|
|
|
|
|
<% @user_message_all.each do |uma| %>
|
|
|
|
|
<% if uma.message.course_message_type == "News" %>
|
|
|
|
|
<ul class="homepageNewsList fl">
|
|
|
|
|
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.course_message.author), :width => "30", :height => "30") %></a></li>
|
|
|
|
|
<li class="homepageNewsPublisher fl"><%=link_to uma.message.course_message.author, user_path(uma.message.course_message.author), :class => "newsBlue" %></li>
|
|
|
|
|
<li class="<%= ucm.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布通知</li>
|
|
|
|
|
<li class="homepageNewsContent fl">
|
|
|
|
|
<%= link_to uma.message.course_message.title, {:controller => 'news', :action => 'show', :id => uma.message.course_message.id },
|
|
|
|
|
:class =>"#{uma.message.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
|
|
|
|
:title => "#{uma.message.course_message.title}" %></li>
|
|
|
|
|
<li class="homepageNewsTime fl"><%= time_tag(uma.message.course_message.created_on).html_safe %> </li>
|
|
|
|
|
</ul>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if uma.message.course_message_type == "Comment" %>
|
|
|
|
|
<ul class="homepageNewsList fl">
|
|
|
|
|
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.course_message.author), :width => "30", :height => "30") %></a></li>
|
|
|
|
|
<li class="homepageNewsPublisher fl"><%=link_to uma.message.course_message.author, user_path(uma.message.course_message.author), :class => "newsBlue" %></li>
|
|
|
|
|
<li class="<%= ucm.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">回复了通知</li>
|
|
|
|
|
<li class="homepageNewsContent fl">
|
|
|
|
|
<%= link_to uma.message.course_message.comments.html_safe, {:controller => 'news', :action => 'show', :id => uma.message.course_message.commented.id },
|
|
|
|
|
:class =>"#{uma.message.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
|
|
|
|
:title => "#{uma.message.course_message.comments.html_safe}" %></li>
|
|
|
|
|
<li class="homepageNewsTime fl"><%= time_tag(uma.message.course_message.created_on).html_safe %> </li>
|
|
|
|
|
</ul>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if uma.message.course_message_type == "HomeworkCommon" %>
|
|
|
|
|
<ul class="homepageNewsList fl">
|
|
|
|
|
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.course_message.user), :width => "30", :height => "30") %></a></li>
|
|
|
|
|
<li class="homepageNewsPublisher fl"><%=link_to uma.message.course_message.user, user_path(uma.message.course_message.user), :class => "newsBlue" %></a></li>
|
|
|
|
|
<li class="homepageNewsType fl">发布作业</li>
|
|
|
|
|
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
|
|
|
|
<%= link_to uma.message.course_message.name, student_work_index_path(:homework => uma.message.course_message.id),:class => "newsGrey", :title => "#{uma.message.course_message.name}" %></a></li>
|
|
|
|
|
<li class="homepageNewsTime fl"><%= time_tag(uma.message.course_message.created_at).html_safe %> </li>
|
|
|
|
|
</ul>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if uma.message.course_message_type == "Poll" %>
|
|
|
|
|
<ul class="homepageNewsList fl">
|
|
|
|
|
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.course_message.user), :width => "30", :height => "30") %></a></li>
|
|
|
|
|
<li class="homepageNewsPublisher fl"><%=link_to uma.message.course_message.user, user_path(uma.message.course_message.user), :class => "newsBlue" %></a></li>
|
|
|
|
|
<li class="<%= uma.message.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布问卷</li>
|
|
|
|
|
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
|
|
|
|
<%= link_to format_activity_title(" #{uma.message.course_message.polls_name.nil? ? "未命名问卷" : uma.message.course_message.polls_name}"), poll_index_path(:polls_type => "Course", :polls_group_id => uma.message.course_id),
|
|
|
|
|
:class=>"#{uma.message.viewed==0?"newsBlack":"newsGrey"}",
|
|
|
|
|
:title => "#{uma.message.course_message.polls_name}" %></a></li>
|
|
|
|
|
<li class="homepageNewsTime fl"><%= time_tag(uma.message.course_message.created_at).html_safe %> </li>
|
|
|
|
|
</ul>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if uma.message.course_message_type == "Message" %>
|
|
|
|
|
<ul class="homepageNewsList fl">
|
|
|
|
|
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.course_message.author), :width => "30", :height => "30") %></a></li>
|
|
|
|
|
<li class="homepageNewsPublisher fl"><%=link_to uma.message.course_message.author, user_path(uma.message.course_message.author), :class => "newsBlue" %></li>
|
|
|
|
|
<% if uma.message.course_message.parent_id.nil? %>
|
|
|
|
|
<li class="<%= uma.message.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布帖子</li>
|
|
|
|
|
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
|
|
|
|
<%=link_to uma.message.course_message.subject.html_safe, course_boards_path(uma.message.course_message.course,:parent_id => uma.message.course_message.parent_id ? uma.message.course_message.parent_id : uma.message.course_message.id,
|
|
|
|
|
:topic_id => uma.message.course_message.id),:class=>"#{uma.message.viewed==0?"newsBlack":"newsGrey"}",
|
|
|
|
|
:title => "#{uma.message.course_message.subject.html_safe}" %></a></li>
|
|
|
|
|
<li class="homepageNewsTime fl"><%= time_tag(uma.message.course_message.created_on).html_safe %> </li>
|
|
|
|
|
<% else %>
|
|
|
|
|
<li class="<%= uma.message.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">回复帖子</li>
|
|
|
|
|
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
|
|
|
|
<%=link_to uma.message.course_message.subject.html_safe, course_boards_path(uma.message.course_message.course,:parent_id => uma.message.course_message.parent_id ? uma.message.course_message.parent_id : uma.message.course_message.id,
|
|
|
|
|
:topic_id => uma.message.course_message.id),:class=>"#{uma.message.viewed==0?"newsBlack":"newsGrey"}",
|
|
|
|
|
:title => "#{uma.message.course_message.subject.html_safe}" %> </a></li>
|
|
|
|
|
<li class="homepageNewsTime fl"><%= time_tag(uma.message.course_message.created_on).html_safe %> </li>
|
|
|
|
|
<% end %>
|
|
|
|
|
</ul>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if uma.message.course_message_type == "StudentWorksScore" %>
|
|
|
|
|
<ul class="homepageNewsList fl">
|
|
|
|
|
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.course_message.user), :width => "30", :height => "30") %></a></li>
|
|
|
|
|
<li class="homepageNewsPublisher fl"><%=link_to uma.message.course_message.user, user_path(uma.message.course_message.user), :class => "newsBlue" %></li>
|
|
|
|
|
<li class="homepageNewsType fl">评阅了作品</li>
|
|
|
|
|
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
|
|
|
|
<%= link_to "#{uma.message.course_message.comment.nil? ? "分数:"+uma.message.course_message.score.to_s : "分数:"+uma.message.course_message.score.to_s + "----" + "评语:" + uma.message.course_message.comment}", student_work_index_path(:homework => uma.message.course_message.student_work.homework_common_id),:class=>"newsGrey",:title => "#{uma.message.course_message.comment}" %></a></li>
|
|
|
|
|
<li class="homepageNewsTime fl"><%= time_tag(uma.message.course_message.created_at).html_safe %> </li>
|
|
|
|
|
</ul>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if uma.message.course_message_type == "JournalsForMessage" %>
|
|
|
|
|
<ul class="homepageNewsList fl">
|
|
|
|
|
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.course_message.user), :width => "30", :height => "30") %></a></li>
|
|
|
|
|
<li class="homepageNewsPublisher fl"><%=link_to uma.message.course_message.user, user_path(uma.message.course_message.user), :class => "newsBlue" %></li>
|
|
|
|
|
<li class="homepageNewsType fl">回复了作品</li>
|
|
|
|
|
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
|
|
|
|
<%= link_to uma.message.course_message.notes, student_work_index_path(:homework => uma.message.course_message.jour.student_work.homework_common_id),:class=>"newsGrey",:title => "#{uma.message.course_message.notes}" %></a></li>
|
|
|
|
|
<li class="homepageNewsTime fl"><%= time_tag(uma.message.course_message.created_on).html_safe %> </li>
|
|
|
|
|
</ul>
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<% if uma.message.forge_message_type == "Issue" %>
|
|
|
|
|
<ul class="homepageNewsList fl">
|
|
|
|
|
<li class="homepageNewsPortrait fl">
|
|
|
|
|
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.forge_message.author), :width => "30", :height => "30") %></a>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="homepageNewsPublisher fl">
|
|
|
|
|
<%=link_to uma.message.forge_message.author, user_path(uma.message.forge_message.author), :class => "newsBlue" %>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="<%= uma.message.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">指派问题给我</li>
|
|
|
|
|
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
|
|
|
|
<%= link_to uma.message.forge_message.subject.html_safe, issue_path(:id => uma.message.forge_message.id), :class => "#{uma.message.viewed == 0 ? "newsBlack" : "newsGrey"}",:title => "#{uma.message.forge_message.subject.html_safe}" %></a>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="homepageNewsTime fl"><%= time_tag(uma.message.forge_message.created_on).html_safe %> </li>
|
|
|
|
|
</ul>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if uma.message.forge_message_type == "Journal" %>
|
|
|
|
|
<ul class="homepageNewsList fl">
|
|
|
|
|
<li class="homepageNewsPortrait fl">
|
|
|
|
|
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.forge_message.user), :width => "30", :height => "30") %></a>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="homepageNewsPublisher fl">
|
|
|
|
|
<%=link_to uma.message.forge_message.user, user_path(uma.message.forge_message.user), :class => "newsBlue" %>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="<%= uma.message.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">
|
|
|
|
|
更新了问题
|
|
|
|
|
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
|
|
|
|
<%= link_to get_issue_des_update(uma.message.forge_message),
|
|
|
|
|
issue_path(:id => uma.message.forge_message.journalized_id), :class => "#{uma.message.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
|
|
|
|
:title => "#{get_issue_des_update(uma.message.forge_message)}" %></a>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="homepageNewsTime fl"><%= time_tag(uma.message.forge_message.created_on).html_safe %> </li>
|
|
|
|
|
</ul>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if uma.message.forge_message_type == "Message" %>
|
|
|
|
|
<ul class="homepageNewsList fl">
|
|
|
|
|
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.forge_message.author), :width => "30", :height => "30") %></a></li>
|
|
|
|
|
<li class="homepageNewsPublisher fl"><%=link_to uma.message.forge_message.author, user_path(uma.message.forge_message.author), :class => "newsBlue" %></li>
|
|
|
|
|
|
|
|
|
|
<li class="<%= uma.message.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= uma.message.forge_message.parent_id.nil? ? "发布帖子" : "回复帖子" %></li>
|
|
|
|
|
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
|
|
|
|
<%=link_to uma.message.forge_message.subject.html_safe, project_boards_path(uma.message.forge_message.project,
|
|
|
|
|
:parent_id => uma.message.forge_message.parent_id ? uma.message.forge_message.parent_id : uma.message.forge_message.id,
|
|
|
|
|
:topic_id => uma.message.forge_message.id),:class=>"#{uma.message.viewed==0?"newsBlack":"newsGrey"}",
|
|
|
|
|
:title => "#{uma.message.forge_message.subject.html_safe}" %></a></li>
|
|
|
|
|
<li class="homepageNewsTime fl"><%= time_tag(uma.message.forge_message.created_on).html_safe %> </li>
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if uma.message.forge_message_type == "News" %>
|
|
|
|
|
<ul class="homepageNewsList fl">
|
|
|
|
|
<li class="homepageNewsPortrait fl">
|
|
|
|
|
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.forge_message.author), :width => "30", :height => "30") %></a>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="homepageNewsPublisher fl">
|
|
|
|
|
<%=link_to uma.message.forge_message.author, user_path(uma.message.forge_message.author), :class => "newsBlue" %>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="homepageNewsType fl">发布新闻</li>
|
|
|
|
|
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
|
|
|
|
<%= link_to ("#{uma.message.forge_message.title.html_safe}"), {:controller => 'news', :action => 'show', :id => uma.message.forge_message.id}, :class => "newsGrey", :title => "#{uma.message.forge_message.title.html_safe}" %></a>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="homepageNewsTime fl"><%= time_tag(uma.message.forge_message.created_on).html_safe %> </li>
|
|
|
|
|
</ul>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if uma.message.forge_message_type == "Comment" %>
|
|
|
|
|
<ul class="homepageNewsList fl">
|
|
|
|
|
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%= image_tag(url_to_avatar(uma.message.forge_message.author), :width => "30", :height => "30") %></a></li>
|
|
|
|
|
<li class="homepageNewsPublisher fl"><%=link_to uma.message.forge_message.author, user_path(uma.message.forge_message.author), :class => "newsBlue" %></li>
|
|
|
|
|
<li class="homepageNewsType fl">回复了新闻</li>
|
|
|
|
|
<li class="homepageNewsContent fl">
|
|
|
|
|
<%= link_to "#{uma.message.forge_message.comments.html_safe}",
|
|
|
|
|
{:controller => 'news', :action => 'show', :id => uma.message.forge_message.commented.id },:class =>"#{uma.message.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{uma.message.forge_message.comments.html_safe}"%></li>
|
|
|
|
|
<li class="homepageNewsTime fl"><%= time_tag(uma.message.forge_message.created_on).html_safe %> </li>
|
|
|
|
|
</ul>
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
<% end %>
|
|
|
|
|
<!--项目消息-->
|
|
|
|
|
|
|
|
|
|
<%# 公共贴吧 %>
|
|
|
|
|
|
|
|
|
|
<%# 用户留言消息 %>
|
|
|
|
|
|
|
|
|
|
<% else %>
|
|
|
|
|
<div class="flash notice">暂无消息!</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|