Merge remote-tracking branch 'origin/sw_new_course' into sw_new_course
This commit is contained in:
commit
4ee571e586
|
@ -305,10 +305,11 @@ class UsersController < ApplicationController
|
|||
|
||||
#用户作业列表
|
||||
def user_homeworks
|
||||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||
user_course_ids = "(" + @user.courses.visible.map{|course| course.id}.join(",") + ")"
|
||||
homework_commons = HomeworkCommon.where("course_id in #{user_course_ids}").order("created_at desc")
|
||||
@homework_commons = paginateHelper homework_commons,10
|
||||
@homework_commons = HomeworkCommon.where("course_id in #{user_course_ids}").order("created_at desc").limit(10).offset(@page * 10)
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html {render :layout => 'new_base_user'}
|
||||
end
|
||||
end
|
||||
|
@ -551,12 +552,33 @@ class UsersController < ApplicationController
|
|||
end
|
||||
|
||||
def show
|
||||
@page = (params[:page] || -1).to_i + 1
|
||||
user_project_ids = "(" + @user.projects.visible.map{|project| project.id}.join(",") + ")"
|
||||
user_course_ids = "(" + @user.courses.visible.map{|course| course.id}.join(",") + ")"
|
||||
@user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids}) or (container_type = 'Course' and container_id in #{user_course_ids})").order('created_at desc').limit(10).offset(@page * 10)
|
||||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||
@type = params[:type]
|
||||
user_project_ids = @user.projects.visible.empty? ? "(-1)" : "(" + @user.projects.visible.map{|project| project.id}.join(",") + ")"
|
||||
user_course_ids = @user.courses.visible.empty? ? "(-1)" : "(" + @user.courses.visible.map{|course| course.id}.join(",") + ")"
|
||||
if @type
|
||||
case @type
|
||||
when "course_homework"
|
||||
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'HomeworkCommon'").order('created_at desc').limit(10).offset(@page * 10)
|
||||
when "course_news"
|
||||
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'News'").order('created_at desc').limit(10).offset(@page * 10)
|
||||
when "course_message"
|
||||
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Message'").order('created_at desc').limit(10).offset(@page * 10)
|
||||
when "project_issue"
|
||||
@user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Issue'").order('created_at desc').limit(10).offset(@page * 10)
|
||||
when "project_message"
|
||||
@user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Message'").order('created_at desc').limit(10).offset(@page * 10)
|
||||
end
|
||||
else
|
||||
course_types = "('Message','News','HomeworkCommon')"
|
||||
project_types = "('Message','Issue')"
|
||||
@user_activities = UserActivity.where("(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}").order('created_at desc').limit(10).offset(@page * 10)
|
||||
end
|
||||
# @user_activities = paginateHelper @user_activities,500
|
||||
render :layout=>'new_base_user'
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html {render :layout => 'new_base_user'}
|
||||
end
|
||||
end
|
||||
|
||||
def show_old
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
<div class="resources mt15">
|
||||
<div class="homepagePostBrief" onmouseover="$('#act-<%=user_activity.id %>').css('visibility','visible')" onmouseout="$('.homepagePostSetting').css('visibility','hidden')">
|
||||
<div class="homepagePostPortrait">
|
||||
<!-- <a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="90" height="90" alt="用户头像"/></a>-->
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo">
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
TO
|
||||
<%= link_to activity.course.name.to_s+"(课程名称)", course_path(activity.container_id), :class => "newsBlue ml15", :style=>"word-break:break-all" %>
|
||||
<!--<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a>-->
|
||||
</div>
|
||||
<div class="homepagePostTitle">
|
||||
<a href="javascript:void(0);" class="postGrey"><%=activity.filename.to_s(附件名称)%></a>
|
||||
</div>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostDeadline">时间:<%= format_date(activity.created_on) %></div>
|
||||
</div>
|
||||
<div class="homepagePostIntro">(附件描述)<%=activity.description.to_s%></div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity.id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,29 @@
|
|||
<div class="resources mt15">
|
||||
<div class="homepagePostBrief" onmouseover="$('#act-<%=user_activity.id %>').css('visibility','visible')" onmouseout="$('.homepagePostSetting').css('visibility','hidden')">
|
||||
<div class="homepagePostPortrait">
|
||||
<a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="90" height="90" alt="用户头像"/></a></div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo"><a href="javascript:void(0);" class="newsBlue mr15">尹教授</a> TO
|
||||
<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a></div>
|
||||
<div class="homepagePostTitle">
|
||||
<a href="javascript:void(0);" class="postGrey">ckeditor值设置的默认在光标聚焦控件后应自动消失的处理(课程创建)</a></div>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostSubmit"><a href="javascript:void(0);" class="c_blue">提交(10)</a></div>
|
||||
<div class="homepagePostDeadline">截止时间:2015-08-20</div>
|
||||
</div>
|
||||
<div class="homepagePostIntro">(作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;</div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity.id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,29 @@
|
|||
<div class="resources mt15">
|
||||
<div class="homepagePostBrief" onmouseover="$('#act-<%=user_activity.id %>').css('visibility','visible')" onmouseout="$('.homepagePostSetting').css('visibility','hidden')">
|
||||
<div class="homepagePostPortrait">
|
||||
<a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="90" height="90" alt="用户头像"/></a></div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo"><a href="javascript:void(0);" class="newsBlue mr15">尹教授</a> TO
|
||||
<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a></div>
|
||||
<div class="homepagePostTitle">
|
||||
<a href="javascript:void(0);" class="postGrey">ckeditor值设置的默认在光标聚焦控件后应自动消失的处理(留言)</a></div>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostSubmit"><a href="javascript:void(0);" class="c_blue">提交(10)</a></div>
|
||||
<div class="homepagePostDeadline">截止时间:2015-08-20</div>
|
||||
</div>
|
||||
<div class="homepagePostIntro">(作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;</div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity.id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,39 @@
|
|||
<div class="resources mt15">
|
||||
<div class="homepagePostBrief" onmouseover="$('#act-<%=user_activity.id %>').css('visibility','visible')" onmouseout="$('.homepagePostSetting').css('visibility','hidden')">
|
||||
<div class="homepagePostPortrait">
|
||||
<!-- <a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="90" height="90" alt="用户头像"/></a>-->
|
||||
<%= link_to image_tag(url_to_avatar(activity.user), :width => "90", :height => "90"), user_path(activity.user_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo">
|
||||
<% if activity.try(:user).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:user).try(:realname), user_path(activity.user_id), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
TO
|
||||
<%= link_to Course.find(activity.polls_group_id).name.to_s+"(课程名称)", course_path(activity.polls_group_id), :class => "newsBlue ml15", :style=>"word-break:break-all" %>
|
||||
<!--<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a>-->
|
||||
</div>
|
||||
<div class="homepagePostTitle">
|
||||
<a href="javascript:void(0);" class="postGrey"><%=activity.polls_name.to_s%>(问卷名称)</a>
|
||||
</div>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostDeadline">时间:<%= format_date(activity.created_at) %></div>
|
||||
</div>
|
||||
<div class="homepagePostIntro">(问卷描述)<%=activity.polls_description.to_s%></div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity.id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,29 @@
|
|||
<div class="resources mt15">
|
||||
<div class="homepagePostBrief" onmouseover="$('#act-<%=user_activity.id %>').css('visibility','visible')" onmouseout="$('.homepagePostSetting').css('visibility','hidden')">
|
||||
<div class="homepagePostPortrait">
|
||||
<a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="90" height="90" alt="用户头像"/></a></div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo"><a href="javascript:void(0);" class="newsBlue mr15">尹教授</a> TO
|
||||
<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a></div>
|
||||
<div class="homepagePostTitle">
|
||||
<a href="javascript:void(0);" class="postGrey">ckeditor值设置的默认在光标聚焦控件后应自动消失的处理(项目附件)</a></div>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostSubmit"><a href="javascript:void(0);" class="c_blue">提交(10)</a></div>
|
||||
<div class="homepagePostDeadline">截止时间:2015-08-20</div>
|
||||
</div>
|
||||
<div class="homepagePostIntro">(作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;</div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity.id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,29 @@
|
|||
<div class="resources mt15">
|
||||
<div class="homepagePostBrief" onmouseover="$('#act-<%=user_activity.id %>').css('visibility','visible')" onmouseout="$('.homepagePostSetting').css('visibility','hidden')">
|
||||
<div class="homepagePostPortrait">
|
||||
<a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="90" height="90" alt="用户头像"/></a></div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo"><a href="javascript:void(0);" class="newsBlue mr15">尹教授</a> TO
|
||||
<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a></div>
|
||||
<div class="homepagePostTitle">
|
||||
<a href="javascript:void(0);" class="postGrey">ckeditor值设置的默认在光标聚焦控件后应自动消失的处理(项目创建)</a></div>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostSubmit"><a href="javascript:void(0);" class="c_blue">提交(10)</a></div>
|
||||
<div class="homepagePostDeadline">截止时间:2015-08-20</div>
|
||||
</div>
|
||||
<div class="homepagePostIntro">(作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;</div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity.id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,29 @@
|
|||
<div class="resources mt15">
|
||||
<div class="homepagePostBrief" onmouseover="$('#act-<%=user_activity.id %>').css('visibility','visible')" onmouseout="$('.homepagePostSetting').css('visibility','hidden')">
|
||||
<div class="homepagePostPortrait">
|
||||
<a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="90" height="90" alt="用户头像"/></a></div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo"><a href="javascript:void(0);" class="newsBlue mr15">尹教授</a> TO
|
||||
<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a></div>
|
||||
<div class="homepagePostTitle">
|
||||
<a href="javascript:void(0);" class="postGrey">ckeditor值设置的默认在光标聚焦控件后应自动消失的处理(文档名称)</a></div>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostSubmit"><a href="javascript:void(0);" class="c_blue">提交(10)</a></div>
|
||||
<div class="homepagePostDeadline">截止时间:2015-08-20</div>
|
||||
</div>
|
||||
<div class="homepagePostIntro">(作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;</div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity.id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,29 @@
|
|||
<div class="resources mt15">
|
||||
<div class="homepagePostBrief" onmouseover="$('#act-<%=user_activity.id %>').css('visibility','visible')" onmouseout="$('.homepagePostSetting').css('visibility','hidden')">
|
||||
<div class="homepagePostPortrait">
|
||||
<a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="90" height="90" alt="用户头像"/></a></div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo"><a href="javascript:void(0);" class="newsBlue mr15">尹教授</a> TO
|
||||
<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a></div>
|
||||
<div class="homepagePostTitle">
|
||||
<a href="javascript:void(0);" class="postGrey">ckeditor值设置的默认在光标聚焦控件后应自动消失的处理(项目日志)</a></div>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostSubmit"><a href="javascript:void(0);" class="c_blue">提交(10)</a></div>
|
||||
<div class="homepagePostDeadline">截止时间:2015-08-20</div>
|
||||
</div>
|
||||
<div class="homepagePostIntro">(作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;</div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity.id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,29 @@
|
|||
<div class="resources mt15">
|
||||
<div class="homepagePostBrief" onmouseover="$('#act-<%=user_activity.id %>').css('visibility','visible')" onmouseout="$('.homepagePostSetting').css('visibility','hidden')">
|
||||
<div class="homepagePostPortrait">
|
||||
<a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="90" height="90" alt="用户头像"/></a></div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo"><a href="javascript:void(0);" class="newsBlue mr15">尹教授</a> TO
|
||||
<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a></div>
|
||||
<div class="homepagePostTitle">
|
||||
<a href="javascript:void(0);" class="postGrey">ckeditor值设置的默认在光标聚焦控件后应自动消失的处理(项目新闻)</a></div>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostSubmit"><a href="javascript:void(0);" class="c_blue">提交(10)</a></div>
|
||||
<div class="homepagePostDeadline">截止时间:2015-08-20</div>
|
||||
</div>
|
||||
<div class="homepagePostIntro">(作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;</div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity.id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,44 @@
|
|||
<% user_activities.each do |user_activity|
|
||||
unless user_activities.nil? %>
|
||||
<% act= user_activity.act unless user_activity.act_type == "ProjectCreateInfo" %>
|
||||
<% case user_activity.container_type.to_s %>
|
||||
<% when 'Course' %>
|
||||
<% if act %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'HomeworkCommon' %>
|
||||
<%= render :partial => 'course_homework', :locals => {:activity => act,:user_activity =>user_activity} %>
|
||||
<% when 'News' %>
|
||||
<%= render :partial => 'course_news', :locals => {:activity => act,:user_activity =>user_activity} %>
|
||||
<% when 'Message'%>
|
||||
<%= render :partial => 'course_message', :locals => {:activity => act,:user_activity =>user_activity} %>
|
||||
<%# when 'Course'%>
|
||||
<%#= render :partial => 'course_create', :locals => {:activity => act,:user_activity =>user_activity} %>
|
||||
<%# when 'Attachment' %>
|
||||
<%#= render :partial => 'course_attachment', :locals => {:activity => act, :user_activity => user_activity} %>
|
||||
<%# when 'JournalsForMessage' %>
|
||||
<%#= render :partial => 'course_journalsformessage', :locals => {:activity => act, :user_activity => user_activity} %>
|
||||
<%# when 'Poll' %>
|
||||
<%#= render :partial => 'course_poll', :locals => {:activity => act, :user_activity => user_activity} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% when 'Project' %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'Issue' %>
|
||||
<%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity =>user_activity} %>
|
||||
<% when 'Message' %>
|
||||
<%= render :partial => 'project_message', :locals => {:activity => act,:user_activity =>user_activity} %>
|
||||
<%# when 'Journal' %>
|
||||
<%#= render :partial => 'project_journal', :locals => {:activity => act,:user_activity =>user_activity} %>
|
||||
<%# when 'News' %>
|
||||
<%#= render :partial => 'project_news', :locals => {:activity => act,:user_activity =>user_activity} %>
|
||||
<%# when 'Document' %>
|
||||
<%#= render :partial => 'project_document', :locals => {:activity => act,:user_activity =>user_activity} %>
|
||||
<%# when 'Attachment' %>
|
||||
<%#= render :partial => 'project_attachment', :locals => {:activity => act,:user_activity =>user_activity} %>
|
||||
<%# when 'ProjectCreateInfo' %>
|
||||
<%#= render :partial => 'project_create', :locals => {:activity => act,:user_activity =>user_activity} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<input type="hidden" value="<%= page%>" id="show_more_activities" />
|
|
@ -0,0 +1,55 @@
|
|||
<% homework_commons.each do |homework_common|%>
|
||||
<% is_teacher = User.current.allowed_to?(:as_teacher,homework_common.course) %>
|
||||
<div class="HomeWork mb10">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%=link_to image_tag(url_to_avatar(homework_common.user),width:"90px", height: "90px"), user_activities_path(homework_common.user.id)%>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo">
|
||||
<%= link_to homework_common.user.show_name, user_activities_path(homework_common.user_id), :class => "newsBlue mr15"%>
|
||||
TO
|
||||
<%= link_to homework_common.course.name, course_path(homework_common.course_id), :class => "newsBlue ml15"%>
|
||||
</div>
|
||||
<div class="homepagePostTitle">
|
||||
<%= link_to homework_common.name,student_work_index_path(:homework => homework_common.id),:class => "postGrey"%>
|
||||
</div>
|
||||
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostSubmit">
|
||||
<%= user_for_homework_common homework_common,is_teacher %>
|
||||
</div>
|
||||
<div class="homepagePostDeadline">
|
||||
<%= l(:label_end_time)%>:<%= homework_common.end_time%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepagePostIntro upload_img break_word">
|
||||
<%= homework_common.description.html_safe %>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => homework_common.attachments} %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% if is_teacher%>
|
||||
<div class="homepagePostSetting">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li>
|
||||
<%= link_to l(:button_edit),edit_homework_common_path(homework_common), :class => "postOptionLink"%>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to(l(:label_bid_respond_delete), homework_common_path(homework_common),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div><!----HomeWork end-->
|
||||
<% end%>
|
||||
|
||||
<input type="hidden" value="<%= page%>" id="user_show_more_homework" />
|
|
@ -1,3 +1,20 @@
|
|||
<script type="text/javascript">
|
||||
var scrollHandler = function(){
|
||||
if ($(window).scrollTop() == $(document).height() - $(window).height()) {
|
||||
$.get(
|
||||
'<%= user_activities_path(@user.id)%>',
|
||||
{ page : $("#show_more_activities").val(),
|
||||
type: $("#user_activities_type").val()},
|
||||
function (data) {
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
$(window).scroll(scrollHandler);
|
||||
</script>
|
||||
|
||||
<input type="hidden" value="<%= @type%>" id="user_activities_type">
|
||||
<div class="resources">
|
||||
<div class="homepageRightBanner">
|
||||
<div class="NewsBannerName">最新动态</div>
|
||||
|
@ -7,17 +24,22 @@
|
|||
<li>
|
||||
<ul class="homepagePostTypeHomework fl">
|
||||
<li class="f14">课程动态</li>
|
||||
<li><a href="javascript:void(0);" class="homepagePostTypeAssignment postTypeGrey">作业动态</a></li>
|
||||
<li><a href="javascript:void(0);" class="homepagePostTypeNotice postTypeGrey">通知动态</a></li>
|
||||
<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></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 => "homepagePostTypeAssignment postTypeGrey"%>
|
||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeNotice postTypeGrey">通知动态</a></li>-->
|
||||
<li><%= link_to "论坛动态", {:controller => "users", :action => "show", :type => "course_message"}, :class => "homepagePostTypeAssignment postTypeGrey"%>
|
||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
|
||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>-->
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<ul class="homepagePostTypeProject fl">
|
||||
<li class="f14">项目动态</li>
|
||||
<li><a href="javascript:void(0);" class="homepagePostTypeQuestion postTypeGrey">问题动态</a></li>
|
||||
<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>
|
||||
<li><%= link_to "问题动态", {:controller => "users", :action => "show", :type => "project_issue"}, :class => "homepagePostTypeAssignment postTypeGrey"%>
|
||||
<li><%= link_to "论坛动态", {:controller => "users", :action => "show", :type => "project_message"}, :class => "homepagePostTypeAssignment 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>
|
||||
</ul>
|
||||
|
@ -25,30 +47,5 @@
|
|||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<% @user_activities.each do |user_activity|
|
||||
unless @user_activities.nil? %>
|
||||
<% act= user_activity.act %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'CourseActivity' %>
|
||||
<% if act %>
|
||||
<% activity= act.course_act %>
|
||||
<% case act.course_act_type.to_s %>
|
||||
<% when 'HomeworkCommon' %>
|
||||
<%= render :partial => 'course_homework', :locals => {:activity => activity,:user_activity =>user_activity} %>
|
||||
<% when 'News' %>
|
||||
<%= render :partial => 'course_news', :locals => {:activity => activity,:user_activity =>user_activity} %>
|
||||
<% when 'Message'%>
|
||||
<%= render :partial => 'course_message', :locals => {:activity => activity,:user_activity =>user_activity} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% when 'ForgeActivity' %>
|
||||
<% activity= act.forge_act unless act.forge_act_type == "ProjectCreateInfo" %>
|
||||
<% case act.forge_act_type.to_s %>
|
||||
<% when 'Issue' %>
|
||||
<%= render :partial => 'project_issue', :locals => {:activity => activity,:user_activity =>user_activity} %>
|
||||
<% when 'Message' %>
|
||||
<%= render :partial => 'project_message', :locals => {:activity => activity,:user_activity =>user_activity} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities,:page => @page} %>
|
|
@ -0,0 +1,4 @@
|
|||
$("#show_more_activities").replaceWith("<%= escape_javascript( render :partial => 'users/user_activities',:locals => {:user_activities => @user_activities, :page => @page} )%>");
|
||||
<% if @user_activities.count < 10%>
|
||||
$(window).off("scroll", scrollHandler);
|
||||
<% end%>
|
|
@ -1,3 +1,18 @@
|
|||
<script type="text/javascript">
|
||||
var scrollHandler = function(){
|
||||
if ($(window).scrollTop() == $(document).height() - $(window).height()) {
|
||||
$.get(
|
||||
'<%= user_homeworks_user_path(User.current.id)%>',
|
||||
{ page : $("#user_show_more_homework").val()},
|
||||
function (data) {
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
$(window).scroll(scrollHandler);
|
||||
</script>
|
||||
|
||||
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
|
||||
<!-- 老师身份才可以发布作业 -->
|
||||
<div class="HomeWork mb10">
|
||||
|
@ -42,56 +57,4 @@
|
|||
</div><!----HomeWork end-->
|
||||
<% end%>
|
||||
|
||||
<% @homework_commons.each do |homework_common|%>
|
||||
<% is_teacher = User.current.allowed_to?(:as_teacher,homework_common.course) %>
|
||||
<div class="HomeWork mb10">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%=link_to image_tag(url_to_avatar(homework_common.user),width:"90px", height: "90px"), user_activities_path(homework_common.user.id)%>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo">
|
||||
<%= link_to homework_common.user.show_name, user_activities_path(homework_common.user_id), :class => "newsBlue mr15"%>
|
||||
TO
|
||||
<%= link_to homework_common.course.name, course_path(homework_common.course_id), :class => "newsBlue ml15"%>
|
||||
</div>
|
||||
<div class="homepagePostTitle">
|
||||
<%= link_to homework_common.name,student_work_index_path(:homework => homework_common.id),:class => "postGrey"%>
|
||||
</div>
|
||||
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostSubmit">
|
||||
<%= user_for_homework_common homework_common,is_teacher %>
|
||||
</div>
|
||||
<div class="homepagePostDeadline">
|
||||
<%= l(:label_end_time)%>:<%= homework_common.end_time%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepagePostIntro upload_img break_word">
|
||||
<%= homework_common.description.html_safe %>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => homework_common.attachments} %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% if is_teacher%>
|
||||
<div class="homepagePostSetting">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li>
|
||||
<%= link_to l(:button_edit),edit_homework_common_path(homework_common), :class => "postOptionLink"%>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to(l(:label_bid_respond_delete), homework_common_path(homework_common),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div><!----HomeWork end-->
|
||||
<% end%>
|
||||
<%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => @homework_commons,:page => 0} %>
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
$("#user_show_more_homework").replaceWith("<%= escape_javascript( render :partial => 'users/user_homework_list',:locals => {:homework_commons => @homework_commons, :page => @page} )%>");
|
||||
<% if @homework_commons.count < 10%>
|
||||
$(window).off("scroll", scrollHandler);
|
||||
<% end%>
|
|
@ -474,13 +474,6 @@ ActiveRecord::Schema.define(:version => 20150820025358) do
|
|||
|
||||
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
|
||||
|
||||
create_table "discuss_demos", :force => true do |t|
|
||||
t.string "title"
|
||||
t.text "body"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "documents", :force => true do |t|
|
||||
t.integer "project_id", :default => 0, :null => false
|
||||
t.integer "category_id", :default => 0, :null => false
|
||||
|
@ -903,6 +896,7 @@ ActiveRecord::Schema.define(:version => 20150820025358) do
|
|||
t.datetime "created_on"
|
||||
t.integer "comments_count", :default => 0, :null => false
|
||||
t.integer "course_id"
|
||||
t.datetime "updated_on"
|
||||
end
|
||||
|
||||
add_index "news", ["author_id"], :name => "index_news_on_author_id"
|
||||
|
|
|
@ -578,7 +578,7 @@ a.postOptionLink:hover {color:#ffffff; background-color:#15bccf;}
|
|||
.homepagePostReplyDes {float:left; width:595px; margin-left:15px;}
|
||||
.homepagePostReplyPublisher {font-size:12px; color:#484848; margin-bottom:12px;}
|
||||
.homepagePostReplyContent {font-size:12px; color:#484848; margin-bottom:12px;}
|
||||
.homepagePostProjectState {width:42px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;}
|
||||
.homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;}
|
||||
.homepagePostAssignTo {float:left; font-size:14px; color:#15bccf; height:30px; line-height:30px; vertical-align:middle;}
|
||||
.homepagePostFileAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/homepage_icon.png) -85px -150px no-repeat; padding-left:35px; font-size:14px; margin-right:25px;}
|
||||
.homepagePostImageAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/homepage_icon.png) -86px -195px no-repeat; padding-left:35px; font-size:14px; margin-right:25px;}
|
||||
|
|
Loading…
Reference in New Issue