个人主页的消息页面

This commit is contained in:
daiao 2016-12-07 15:13:51 +08:00
parent e6763c6d0c
commit 69d9228808
9 changed files with 245 additions and 180 deletions

View File

@ -1807,96 +1807,110 @@ class UsersController < ApplicationController
end
def show
#更新用户申请成为课程老师或教辅消息的状态
if params[:course_id] != nil
join_course_messages = CourseMessage.where("course_id =? and course_message_type =? and user_id =? and course_message_id =? and viewed =?",
params[:course_id], 'JoinCourseRequest', User.current.id, @user.id, false)
join_course_messages.update_all(:viewed => true)
end
shield_project_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Project'").map(&:shield_id)
shield_course_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Course'").map(&:shield_id)
@page = params[:page] ? params[:page].to_i + 1 : 0
user_project_ids = (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")"
user_course_ids = (@user.favorite_courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (@user.favorite_courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).join(",") + ")"
course_types = "('Message','News','HomeworkCommon','Poll','Course','JournalsForMessage')"
project_types = "('Message','Issue','Project')"
principal_types = "JournalsForMessage"
container_type = ''
act_type = ''
# 用户项目数
@my_project_count = user_project_count
# 用户的课程数
@my_course_count = user_course_count
# 用户发布的issue数
@issues_author_is_self_count = issues_author_is_self_count
# 用户收到的issue数
@issues_assigned_is_self_count = issues_assigned_is_self_count
if params[:type].present?
case params[:type]
when "course_homework"
container_type = 'Course'
act_type = 'HomeworkCommon'
when "course_news"
container_type = 'Course'
act_type = 'News'
when "course_message"
container_type = 'Course'
act_type = 'Message'
when "course_poll"
container_type = 'Course'
act_type = 'Poll'
when "course_journals"
container_type = 'Course'
act_type = 'JournalsForMessage'
when "project_issue"
container_type = 'Project'
act_type = 'Issue'
when "project_message"
container_type = 'Project'
act_type = 'Message'
when "user_journals"
container_type = 'Principal'
act_type = 'JournalsForMessage'
when "current_user"
container_type = 'Principal'
act_type = 'Principal'
when "all"
container_type = 'all'
act_type = 'all'
if is_current_user
# 自己的主页显示消息
# 初始化/更新 点击按钮时间, 24小时内显示系统消息
update_onclick_time
# 全部设为已读
if params[:viewed] == "all"
update_message_viewed(@user)
end
end
if container_type != '' && container_type != 'all'
if container_type == 'Course'
sql = "container_type = '#{container_type}' and container_id in #{user_course_ids} and act_type = '#{act_type}'"
elsif container_type == 'Project'
sql = "container_type = '#{container_type}' and container_id in #{user_project_ids} and act_type = '#{act_type}'"
elsif container_type == 'Principal' && act_type == 'JournalsForMessage'
sql = "container_type = '#{container_type}' and act_type= '#{act_type}' and container_id = #{@user.id}"
elsif container_type == 'Principal' && act_type == 'Principal'
sql = "user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))"
end
if User.current != @user
sql += " and user_id = #{@user.id}"
# 系统消息为管理员发送,我的消息中包含有系统消息
@message_alls = []
messages = MessageAll.where("(user_id =? and message_type !=?) or message_type =?" ,@user.id, "SystemMessage", "SystemMessage").includes(:message).order("created_at desc")
messages.each do |message_all|
mess = message_all.message
unless (message_all.message_type == 'CourseMessage' && mess && mess.course && mess.course.is_delete == 1)
@message_alls << mess
end
end
@message_count = @message_alls.count
@message_alls = paginateHelper @message_alls, 20
else
if User.current != @user
blog_ids = "("+@user.blog.id.to_s+")"
# 看别人的主页显示动态
#更新用户申请成为课程老师或教辅消息的状态
if params[:course_id] != nil
join_course_messages = CourseMessage.where("course_id =? and course_message_type =? and user_id =? and course_message_id =? and viewed =?",
params[:course_id], 'JoinCourseRequest', User.current.id, @user.id, false)
join_course_messages.update_all(:viewed => true)
end
shield_project_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Project'").map(&:shield_id)
shield_course_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Course'").map(&:shield_id)
@page = params[:page] ? params[:page].to_i + 1 : 0
user_project_ids = (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")"
user_course_ids = (@user.favorite_courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (@user.favorite_courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).join(",") + ")"
course_types = "('Message','News','HomeworkCommon','Poll','Course','JournalsForMessage')"
project_types = "('Message','Issue','Project')"
principal_types = "JournalsForMessage"
container_type = ''
act_type = ''
# 他的动态
sql = "user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))"
if params[:type].present?
case params[:type]
when "course_homework"
container_type = 'Course'
act_type = 'HomeworkCommon'
when "course_news"
container_type = 'Course'
act_type = 'News'
when "course_message"
container_type = 'Course'
act_type = 'Message'
when "course_poll"
container_type = 'Course'
act_type = 'Poll'
when "course_journals"
container_type = 'Course'
act_type = 'JournalsForMessage'
when "project_issue"
container_type = 'Project'
act_type = 'Issue'
when "project_message"
container_type = 'Project'
act_type = 'Message'
when "user_journals"
container_type = 'Principal'
act_type = 'JournalsForMessage'
when "current_user"
container_type = 'Principal'
act_type = 'Principal'
when "all"
container_type = 'all'
act_type = 'all'
end
end
if container_type != '' && container_type != 'all'
if container_type == 'Course'
sql = "container_type = '#{container_type}' and container_id in #{user_course_ids} and act_type = '#{act_type}'"
elsif container_type == 'Project'
sql = "container_type = '#{container_type}' and container_id in #{user_project_ids} and act_type = '#{act_type}'"
elsif container_type == 'Principal' && act_type == 'JournalsForMessage'
sql = "container_type = '#{container_type}' and act_type= '#{act_type}' and container_id = #{@user.id}"
elsif container_type == 'Principal' && act_type == 'Principal'
sql = "user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))"
end
if User.current != @user
sql += " and user_id = #{@user.id}"
end
else
blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
end
sql = "(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
"or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
"or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
"or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})"
if container_type != 'all' && User.current != @user
sql = "user_id = #{@user.id} and(" + sql + ")"
if User.current != @user
blog_ids = "("+@user.blog.id.to_s+")"
else
blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")"
end
sql = "(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" +
"or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+
"or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
"or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})"
if container_type != 'all' && User.current != @user
sql = "user_id = #{@user.id} and(" + sql + ")"
end
end
@user_activities_count = UserActivity.where("#{sql}").order('updated_at desc').count
@user_activities = UserActivity.where("#{sql}").order('updated_at desc').limit(10).offset(@page * 10)
@type = params[:type]
end
@user_activities = UserActivity.where("#{sql}").order('updated_at desc').limit(10).offset(@page * 10)
@type = params[:type]
respond_to do |format|
format.js
format.html {render :layout => 'new_base_user'}

View File

@ -192,6 +192,10 @@ module UsersHelper
end
end
def is_current_user
is_current_user = (User.current == @user)
end
def applied_project_tip_header applied_message
case applied_message.status
when 4

View File

@ -5,14 +5,14 @@
<li><%= link_to '个人主页', homepage_user_path(@user), :class => "user_editinfo", :target => '_blank' %></li>
<li class="cl"></li>
<% else%>
<li style="width: 119px; float: left; border-right: 1px solid #ddd;">
<% if target.base_homepage.nil? %>
<!-- <li style="width: 119px; float: left; border-right: 1px solid #ddd;">
<%# if target.base_homepage.nil? %>
<a href="javascript:void(0)" class ="user_editinfo" style="color: #cccccc" title="该用户暂未设置主页">主页</a>
<% else %>
<%=link_to "主页", homepage_user_path(@user.login), :class => 'user_editinfo', :target => '_blank' %>
<% end %>
</li>
<li style="width: 118px; float: left;">
<%# else %>
<%#=link_to "主页", homepage_user_path(@user.login), :class => 'user_editinfo', :target => '_blank' %>
<%# end %>
</li>-->
<li>
<%if(target.watched_by?(User.current))%>
<%= link_to "取消关注",watch_path(:object_type=> 'user',:object_id=>target.id,:target_id=>target.id),:class => "user_editinfo", :method => "delete",:remote => "true", :title => "取消关注"%>
<% else %>

View File

@ -158,14 +158,15 @@
<%= render :partial => 'layouts/user_watch_btn', :locals => {:target => @user} %>
</div>
</div>
<div class="home-user-leftnav">
<h3 >课程社区</h3>
<% if hidden_unproject_infos %>
<ul>
<li class="home-user-leftnav-li icons-class clear">
<%= link_to "课程<span class='issues_nav_tag ml140'>#{user_course_count}</span>".html_safe, {:controller => "users", :action => "user_courselist", :id => @user}, :id => "user_course_list", :class => "fl" %>
<!-- <div class="user_navmore_box" >
<% if is_current_user %>
<div class="home-user-leftnav">
<h3 >课程社区</h3>
<% if hidden_unproject_infos %>
<ul>
<li class="home-user-leftnav-li icons-class clear">
<%= link_to user_course_count > 0 ? "课程<span class='issues_nav_tag ml140'>#{user_course_count}</span>".html_safe : "课程",
{:controller => "users", :action => "user_courselist", :id => @user}, :id => "user_course_list", :class => "fl" %>
<!-- <div class="user_navmore_box" >
<ul>
<li class="user_navmore_icons">
<ul class="user_navmore_txt02" >
@ -184,27 +185,27 @@
</li>
</ul>
</div>-->
</li>
<% if @user == User.current %>
<li class="home-user-leftnav-li icons-homework clear">
<%=link_to '我的作业', my_homeworks_user_path(@user), :target => "_blank", :class => "fl" %>
</li>
<% end %>
<li class="home-user-leftnav-li icons-doc clear">
<%= link_to "题库", user_homeworks_user_path(User.current), :target => "_blank", :class => "fl" %>
</li>
<li class="home-user-leftnav-li icons-download clear">
<%= link_to "资源库", user_resource_user_path(User.current, :type => 1), :target => "_blank", :class => "fl" %>
</li>
</ul>
</div>
<% end %>
<div class="home-user-leftnav">
<h3 >项目社区</h3>
<ul>
<li class="home-user-leftnav-li icons-project clear">
<%= link_to "项目<span class='issues_nav_tag ml140'>#{user_project_count}</span>".html_safe, {:controller => "users", :action => "user_projectlist", :id => @user}, :id => 'user_project_list', :class => "fl" %>
<!-- <div class="user_navmore_box" >
</li>
<li class="home-user-leftnav-li icons-homework clear">
<%=link_to '我的作业', my_homeworks_user_path(@user), :target => "_blank", :class => "fl" %>
</li>
<li class="home-user-leftnav-li icons-doc clear">
<%= link_to "题库", user_homeworks_user_path(User.current), :target => "_blank", :class => "fl" %>
</li>
<li class="home-user-leftnav-li icons-download clear">
<%= link_to "资源库", user_resource_user_path(User.current, :type => 1), :target => "_blank", :class => "fl" %>
</li>
</ul>
<% end %>
</div>
<div class="home-user-leftnav">
<h3 >项目社区</h3>
<ul>
<li class="home-user-leftnav-li icons-project clear">
<%= link_to user_project_count > 0 ? "项目<span class='issues_nav_tag ml140'>#{user_project_count}</span>".html_safe : "项目",
{:controller => "users", :action => "user_projectlist", :id => @user}, :id => 'user_project_list', :class => "fl" %>
<!-- <div class="user_navmore_box" >
<ul>
<li class="user_navmore_icons">
<ul class="user_navmore_txt02">
@ -222,15 +223,34 @@
</li>
</ul>
</div>-->
</li>
<li class="home-user-leftnav-li icons-issue clear">
<%= link_to "我发布的issue<span class='issues_nav_tag ml80'>#{issues_author_is_self_count}</span>".html_safe, user_issues_user_path(@user), :class => "fl" %>
</li>
<li class="home-user-leftnav-li icons-issue clear">
<%= link_to "我收到的issue<span class='issues_nav_tag ml80'>#{issues_assigned_is_self_count}</span>".html_safe, user_issues_user_path(@user), :class => "fl" %>
</li>
</ul>
</div>
</li>
<li class="home-user-leftnav-li icons-issue clear">
<%= link_to issues_author_is_self_count > 0 ? "我发布的issue<span class='issues_nav_tag ml80'>#{issues_author_is_self_count}</span>".html_safe : "我发布的issue",
user_issues_user_path(@user), :class => "fl" %>
</li>
<li class="home-user-leftnav-li icons-issue clear">
<%= link_to issues_assigned_is_self_count > 0 ? "我收到的issue<span class='issues_nav_tag ml80'>#{issues_assigned_is_self_count}</span>".html_safe : "我收到的issue",
user_issues_user_path(@user), :class => "fl" %>
</li>
</ul>
</div>
<% else %>
<div class="home-user-leftnav">
<h3 >Ta在确实
<span class="fr mr5" style="font-size:12px;color: #7f7f7f;"><%= time_tag(@user.created_on).html_safe %></span>
</h3>
<ul>
<li class="home-user-leftnav-li icons-class clear">
<%= link_to user_course_count > 0 ? "课程<span class='issues_nav_tag ml140'>#{user_course_count}</span>".html_safe : "课程",
{:controller => "users", :action => "user_courselist", :id => @user}, :id => "user_course_list", :class => "fl" %>
</li>
<li class="home-user-leftnav-li icons-project clear">
<%= link_to user_project_count > 0 ? "项目<span class='issues_nav_tag ml140'>#{user_project_count}</span>".html_safe : "项目",
{:controller => "users", :action => "user_projectlist", :id => @user}, :id => 'user_project_list', :class => "fl" %>
</li>
</ul>
</div>
<% end %>
<div class="user_leftnav ">
<ul class="users_accordion mb10">
<li id="user_10" class="user_icons_mes">

View File

@ -1,7 +1,7 @@
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %></div></a></li>
<li class="homepageNewsPubType fl">
<span class="newsBlue homepageNewsPublisher">系统提示</span>
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">您有了新的班级成员申请:</span>
<span class="homepageNewsType fl">您有了新的班级成员申请:</span>
</li>
<li class="<%=(ma.status == 0 || ma.status.nil?) ? 'homepageHomeworkContent2' : 'homepageHomeworkContent' %> fl">
<a href="javascript:void(0);" class="newsGrey">
@ -22,7 +22,8 @@
<div class="ml60"><%= Course.find(ma.course_id).description.html_safe if Course.find(ma.course_id).description %></div>
<p>申请职位:<%=ma.content && ma.content.include?('9') ? "教师" : "助教"%></p>
</div>
<li class="<%=(ma.status == 0 || ma.status.nil?) ? 'homepageHomeworkContentWarn2' : 'homepageHomeworkContentWarn' %> fl">
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
<li class="<%=(ma.status == 0 || ma.status.nil?) ? 'homepageHomeworkContentWarn2' : 'homepageHomeworkContentWarn' %> fr">
<span id="deal_info_<%=ma.id%>">
<% if ma.status == 0 || ma.status.nil?%>
<%= link_to '同意',dealwith_apply_request_user_path(User.current,:agree=>'Y',:msg_id=>ma.id),:remote=>'true',:class=>'linkBlue'%>
@ -35,4 +36,3 @@
<%end %>
</span>
</li>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>

View File

@ -22,6 +22,6 @@
<%= render :partial => 'users/user_message_applied', :locals => {:ma => ma} %>
<% 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 class="pages" style="width: auto;display: table;margin-left: auto;margin-right: auto; padding-top: 10px">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true %>
</ul>

View File

@ -0,0 +1,4 @@
<div class="pro_new_info mt50" style="width:748px;height:405px;">
<div class="icons_tishi"><img src="/images/new_project/icons_smile.png" width="110" height="110" alt=""></div>
<p class="sy_tab_con_p ">该用户无公开动态~</p>
</div>

View File

@ -1,51 +1,74 @@
<script src="/javascripts/i18n/jquery.ui.datepicker-zh-CN.js" type="text/javascript"></script>
<input type="hidden" value="<%= @type%>" name="type" id="user_activities_type">
<div class="homepageRightBanner">
<div class="NewsBannerName">最新动态</div>
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="homepagePostType">
<li>
<ul class="homepagePostTypeHomework fl">
<% if hidden_unproject_infos %>
<li class="f14">班级动态</li>
<li><%= link_to "作业动态", {:controller => "users", :action => "show", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%>
<!--<a href="javascript:void(0);" class="homepagePostTypeAssignment postTypeGrey">作业动态</a>--></li>
<li><%= link_to "通知动态", {:controller => "users", :action => "show", :type => "course_news"}, :class => "homepagePostTypeNotice postTypeGrey"%>
<!--<li><a href="javascript:void(0);" class="homepagePostTypeNotice postTypeGrey">通知动态</a></li>-->
<li><%= link_to "论坛动态", {:controller => "users", :action => "show", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
<li><%= link_to "问卷动态", {:controller => "users", :action => "show", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%>
<li><%= link_to "班级留言", {:controller => "users", :action => "show", :type => "course_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
<!--<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>-->
<% end %>
</ul>
</li>
<li>
<ul class="homepagePostTypeProject fl">
<li class="f14">项目动态</li>
<li><%= link_to "问题动态", {:controller => "users", :action => "show", :type => "project_issue"}, :class => "homepagePostTypeQuestion postTypeGrey"%>
<li><%= link_to "论坛动态", {:controller => "users", :action => "show", :type => "project_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuestion postTypeGrey">问题动态</a></li>
<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
</ul>
</li>
<li>
<ul class="homepagePostTypeProject fl">
<li class="f14">更多</li>
<li class="mt-4"><%= link_to "个人留言", {:controller => "users", :action => "show", :type => "user_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
<li class="mt-4"><%= link_to @user == User.current ? "我的动态" : "他的动态", {:controller => "users", :action => "show", :type => "current_user"}, :class =>"homepagePostTypeMine postTypeGrey"%>
<li class="mt-4"><%= link_to "全部动态", {:controller => "users", :action => "show", :type => "all"}, :class =>"homepagePostTypeAll postTypeGrey"%>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<% if is_current_user %>
<div class="homepageRightBanner">
<div class="NewsBannerName">
消息动态
</div>
<span class="fr" style="margin-top:5px;">
共 <span style="color: red;"><%= @message_count %></span> 个消息
</span>
</div>
<div class="resources" id="users_setting">
<div>
<%= render :partial => 'users/new_user_message', :locals => { :message_alls => @message_alls } %>
</div>
</div>
<!--显示个人主页-->
<% else %>
<div class="homepageRightBanner">
<div class="NewsBannerName">Ta的动态</div>
<!-- <ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="homepagePostType">
<li>
<ul class="homepagePostTypeHomework fl">
<%# if hidden_unproject_infos %>
<li class="f14">班级动态</li>
<li><%#= link_to "作业动态", {:controller => "users", :action => "show", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%>
&lt;!&ndash;<a href="javascript:void(0);" class="homepagePostTypeAssignment postTypeGrey">作业动态</a>&ndash;&gt;</li>
<li><%#= link_to "通知动态", {:controller => "users", :action => "show", :type => "course_news"}, :class => "homepagePostTypeNotice postTypeGrey"%>
&lt;!&ndash;<li><a href="javascript:void(0);" class="homepagePostTypeNotice postTypeGrey">通知动态</a></li>&ndash;&gt;
<li><%#= link_to "论坛动态", {:controller => "users", :action => "show", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
<li><%#= link_to "问卷动态", {:controller => "users", :action => "show", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%>
<li><%#= link_to "班级留言", {:controller => "users", :action => "show", :type => "course_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
&lt;!&ndash;<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>&ndash;&gt;
&lt;!&ndash;<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>&ndash;&gt;
<%# end %>
</ul>
</li>
<li>
<ul class="homepagePostTypeProject fl">
<li class="f14">项目动态</li>
<li><%#= link_to "问题动态", {:controller => "users", :action => "show", :type => "project_issue"}, :class => "homepagePostTypeQuestion postTypeGrey"%>
<li><%#= link_to "论坛动态", {:controller => "users", :action => "show", :type => "project_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
&lt;!&ndash;<li><a href="javascript:void(0);" class="homepagePostTypeQuestion postTypeGrey">问题动态</a></li>
<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>&ndash;&gt;
</ul>
</li>
<li>
<ul class="homepagePostTypeProject fl">
<li class="f14">更多</li>
<li class="mt-4"><%#= link_to "个人留言", {:controller => "users", :action => "show", :type => "user_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
<li class="mt-4"><%#= link_to @user == User.current ? "我的动态" : "他的动态", {:controller => "users", :action => "show", :type => "current_user"}, :class =>"homepagePostTypeMine postTypeGrey"%>
<li class="mt-4"><%#= link_to "全部动态", {:controller => "users", :action => "show", :type => "all"}, :class =>"homepagePostTypeAll postTypeGrey"%>
</ul>
</li>
</ul>
</li>
</ul>-->
</div>
<!--显示个人主页-->
<%# if @user.blog.homepage_id and BlogComment.where("id=?", @user.blog.homepage_id).count > 0 %>
<%# homepage = BlogComment.find(@user.blog.homepage_id) %>
<%#= render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id} %>
<%# end %>
<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities,:page => 0,:type => @type, :user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id)} %>
<% if @user_activities_count > 0 %>
<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities, :page => 0, :type => @type, :user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id)} %>
<% else %>
<div class="mb10">
<%= render :partial => 'users/no_data' %>
</div>
<% end %>
<% end %>

View File

@ -104,8 +104,8 @@ div#menu ul ul ul li a{ width:185px; overflow:hidden; white-space: nowrap; text-
.homepageSystenMessageContent a:link{color:#1b1818;}
.homepageHomeworkContentWarn {width:110px; max-width:365px; margin-right:10px; font-size:14px; color:red; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; }
.homepageHomeworkContent {width:235px; max-width:365px; margin-right:10px; font-size:14px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; }
.homepageHomeworkContentWarn2 {width:60px; max-width:365px; margin-right:10px; font-size:12px; color:red; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; }
.homepageHomeworkContent2 {width:285px; max-width:365px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; }
.homepageHomeworkContentWarn2 {width:70px; max-width:365px; margin-right:10px; font-size:14px; color:red; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; }
.homepageHomeworkContent2 {width:285px; max-width:365px; margin-right:10px; font-size:14px; 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;}
.loadMore {font-size:14px;width:748px; text-align:center; display:block; border:1px solid #dddddd; background-color:#ffffff; float:right;padding:5px 0; letter-spacing: 1px;}