课程留言动态加入个人动态
This commit is contained in:
parent
f90b25b230
commit
aa1cbcdf87
|
@ -1223,7 +1223,7 @@ class UsersController < ApplicationController
|
||||||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||||
user_project_ids = (@user.projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")"
|
user_project_ids = (@user.projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")"
|
||||||
user_course_ids = (@user.courses.visible.map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (@user.courses.visible.map{|course| course.id}-shield_course_ids).join(",") + ")"
|
user_course_ids = (@user.courses.visible.map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (@user.courses.visible.map{|course| course.id}-shield_course_ids).join(",") + ")"
|
||||||
course_types = "('Message','News','HomeworkCommon','Poll','Course')"
|
course_types = "('Message','News','HomeworkCommon','Poll','Course','JournalsForMessage')"
|
||||||
project_types = "('Message','Issue','ProjectCreateInfo')"
|
project_types = "('Message','Issue','ProjectCreateInfo')"
|
||||||
principal_types = "JournalsForMessage"
|
principal_types = "JournalsForMessage"
|
||||||
if params[:type].present?
|
if params[:type].present?
|
||||||
|
@ -1236,6 +1236,8 @@ class UsersController < ApplicationController
|
||||||
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Message'").order('updated_at desc').limit(10).offset(@page * 10)
|
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Message'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||||
when "course_poll"
|
when "course_poll"
|
||||||
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Poll'").order('updated_at desc').limit(10).offset(@page * 10)
|
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Poll'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||||
|
when "course_journals"
|
||||||
|
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'JournalsForMessage'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||||
when "project_issue"
|
when "project_issue"
|
||||||
@user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Issue'").order('updated_at desc').limit(10).offset(@page * 10)
|
@user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Issue'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||||
when "project_message"
|
when "project_message"
|
||||||
|
|
|
@ -69,7 +69,9 @@
|
||||||
<% when 'Poll' %>
|
<% when 'Poll' %>
|
||||||
<%= render :partial => 'course_poll', :locals => {:activity => act, :user_activity_id => user_activity.id} %>
|
<%= render :partial => 'course_poll', :locals => {:activity => act, :user_activity_id => user_activity.id} %>
|
||||||
<% when 'Course'%>
|
<% when 'Course'%>
|
||||||
<%= render :partial => 'users/course_create', :locals => {:activity => act, :user_activity_id => act.id} %>
|
<%= render :partial => 'users/course_create', :locals => {:activity => act, :user_activity_id => user_activity.id} %>
|
||||||
|
<% when 'JournalsForMessage'%>
|
||||||
|
<%= render :partial => 'users/course_journalsformessage', :locals => {:activity => act, :user_activity_id => user_activity.id} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% when 'Project' %>
|
<% when 'Project' %>
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeNotice postTypeGrey">通知动态</a></li>-->
|
<!--<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_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_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="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
|
||||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>-->
|
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>-->
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -30,7 +31,7 @@
|
||||||
<li>
|
<li>
|
||||||
<ul class="homepagePostTypeProject fl">
|
<ul class="homepagePostTypeProject fl">
|
||||||
<li class="f14">更多</li>
|
<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 "个人留言", {:controller => "users", :action => "show", :type => "user_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
|
||||||
<li class="mt-4"><%= link_to "我的动态", {:controller => "users", :action => "show", :type => "current_user"}, :class =>"homepagePostTypeMine postTypeGrey"%>
|
<li class="mt-4"><%= link_to "我的动态", {:controller => "users", :action => "show", :type => "current_user"}, :class =>"homepagePostTypeMine postTypeGrey"%>
|
||||||
<li class="mt-4"><%= link_to "全部动态", {:controller => "users", :action => "show", :type => nil}, :class =>"homepagePostTypeAll postTypeGrey"%>
|
<li class="mt-4"><%= link_to "全部动态", {:controller => "users", :action => "show", :type => nil}, :class =>"homepagePostTypeAll postTypeGrey"%>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in New Issue