Merge branch 'develop' into yuanke
This commit is contained in:
commit
4c47dae88b
|
@ -71,18 +71,18 @@ class BlogCommentsController < ApplicationController
|
|||
@course.save
|
||||
redirect_to course_path(:id=>params[:course_id])
|
||||
else
|
||||
@article.children.delete
|
||||
@article.delete
|
||||
@article.children.destroy
|
||||
@article.destroy
|
||||
redirect_to user_blogs_path(:user_id=>User.current)
|
||||
end
|
||||
|
||||
else#如果是回复被删,
|
||||
if params[:course_id] #如果带了course_id过来了,那么这是要跳到课程大纲去的
|
||||
@article.delete
|
||||
@article.destroy
|
||||
redirect_to syllabus_course_path(:id=>params[:course_id])
|
||||
else
|
||||
root = @article.root
|
||||
@article.delete
|
||||
@article.destroy
|
||||
redirect_to user_blog_blog_comment_path(:user_id=>root.author_id,:blog_id=>root.blog_id,:id=>root.id)
|
||||
end
|
||||
|
||||
|
|
|
@ -70,31 +70,16 @@ class BoardsController < ApplicationController
|
|||
def show
|
||||
# 讨论区消息状态更新(已读和未读)
|
||||
if @project
|
||||
query_forge_messages = @board.messages
|
||||
query_forge_messages.each do |query_forge_message|
|
||||
query = query_forge_message.forge_messages
|
||||
query.each do |forge_message|
|
||||
if User.current.id == forge_message.user_id
|
||||
forge_message.update_attributes(:viewed => true)
|
||||
end
|
||||
end
|
||||
end
|
||||
ForgeMessage.where("user_id =? and project_id =? and viewed =?", User.current.id, @project.id, 0).update_all(:viewed => true)
|
||||
# 更新@消息为已读
|
||||
@project.boards.each do |board|
|
||||
board.messages.each do |m|
|
||||
User.current.at_messages.unviewed('Message', m.id).each {|x| x.viewed!}
|
||||
end
|
||||
end
|
||||
# 注释掉这句是因为和上面的方法代码重复,一个类型的消息,已经更新就不需要再更新
|
||||
# @project.boards.each do |board|
|
||||
# board.messages.each do |m|
|
||||
# User.current.at_messages.unviewed('Message', m.id).each {|x| x.viewed!}
|
||||
# end
|
||||
# end
|
||||
elsif @course
|
||||
query_course_messages = @board.messages
|
||||
query_course_messages.each do |query_course_message|
|
||||
query = query_course_message.course_messages
|
||||
query.each do |course_message|
|
||||
if User.current.id == course_message.user_id
|
||||
course_message.update_attributes(:viewed => true)
|
||||
end
|
||||
end
|
||||
end
|
||||
CourseMessage.where("user_id =? and course_id =? and viewed =?", User.current.id, @course.id, 0).update_all(:viewed => true)
|
||||
end
|
||||
|
||||
sort_init 'updated_on', 'desc'
|
||||
|
|
|
@ -852,7 +852,7 @@ class CoursesController < ApplicationController
|
|||
# return
|
||||
# end
|
||||
# 统计访问量
|
||||
@course.update_attribute(:visits, @course.visits.to_i + 1)
|
||||
@course.update_column(:visits, @course.visits.to_i + 1)
|
||||
#更新创建课程消息状态
|
||||
create_course_messages = @course.course_messages.where("user_id =? and course_message_type =? and course_id =? and viewed =?", User.current.id, 'Course', @course.id, 0)
|
||||
create_course_messages.update_all(:viewed => true)
|
||||
|
|
|
@ -458,10 +458,16 @@ class FilesController < ApplicationController
|
|||
if params[:in_project_toolbar]
|
||||
@in_project_toolbar = params[:in_project_toolbar]
|
||||
end
|
||||
# 发送邮件
|
||||
attachments = Attachment.attach_filesex(@project, params[:attachments], params[:attachment_type])
|
||||
if !attachments.empty? && !attachments[:files].blank? && Setting.notified_events.include?('file_added')
|
||||
# 发送邮件
|
||||
Mailer.run.attachments_added(attachments[:files])
|
||||
# 生成动态
|
||||
attachments[:files].each do |file|
|
||||
ForgeActivity.create(:user_id => User.current.id, :project_id => @project.id, :forge_act_id => file.id, :forge_act_type => "Attachment")
|
||||
end
|
||||
# 更新资源总数, 根据上传的附件数累加
|
||||
@project.project_score.update_attribute(:attach_num, @project.project_score.attach_num + attachments[:files].count) unless @project.project_score.nil?
|
||||
end
|
||||
# end
|
||||
if params[:project_attachment_type] && params[:project_attachment_type].is_a?(Array)
|
||||
|
@ -485,11 +491,6 @@ class FilesController < ApplicationController
|
|||
end
|
||||
end
|
||||
end
|
||||
# 更新资源总数, 根据上传的附件数累加
|
||||
unless @project.project_score.nil?
|
||||
@project.project_score.update_attribute(:attach_num, @project.project_score.attach_num + attachments[:files].count)
|
||||
end
|
||||
# end
|
||||
# TODO: 临时用 nyan
|
||||
sort_init 'created_on', 'desc'
|
||||
sort_update 'created_on' => "#{Attachment.table_name}.created_on",
|
||||
|
|
|
@ -37,16 +37,6 @@ class MessagesController < ApplicationController
|
|||
|
||||
# Show a topic and its replies
|
||||
def show
|
||||
=begin
|
||||
if @course
|
||||
topic_id = params[:r]?params[:r]:params[:id]
|
||||
parent_id = params[:id]
|
||||
url = course_boards_path(@course,:topic_id => topic_id,:parent_id=>parent_id);
|
||||
redirect_to url
|
||||
return;
|
||||
end
|
||||
=end
|
||||
|
||||
@isReply = true
|
||||
page = params[:page]
|
||||
# Find the page of the requested reply
|
||||
|
@ -54,16 +44,7 @@ class MessagesController < ApplicationController
|
|||
offset = @topic.children.count(:conditions => ["#{Message.table_name}.id < ?", params[:r].to_i])
|
||||
page = 1 + offset / REPLIES_PER_PAGE
|
||||
end
|
||||
|
||||
@reply_count = @topic.children.count
|
||||
# @reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
|
||||
# @replies = @topic.children.
|
||||
# includes(:author, :attachments, {:board => :project}).
|
||||
# reorder("#{Message.table_name}.created_on DESC").
|
||||
# limit(@reply_pages.per_page).
|
||||
# offset(@reply_pages.offset).
|
||||
# all
|
||||
|
||||
@reply = Message.new(:subject => "RE: #{@message.subject}")
|
||||
if @course
|
||||
messages_replies = @topic.children.
|
||||
|
|
|
@ -295,34 +295,32 @@ class ProjectsController < ApplicationController
|
|||
def show
|
||||
# 更新消息为已读
|
||||
update_message_status(User.current, @project)
|
||||
# over
|
||||
if params[:jump] && redirect_to_project_menu_item(@project, params[:jump])
|
||||
return
|
||||
end
|
||||
# 统计访问量
|
||||
@project.update_attribute(:visits, @project.visits.to_i + 1)
|
||||
@project.update_column(:visits, @project.visits + 1)
|
||||
# over
|
||||
@author = params[:user_id].blank? ? nil : User.active.find(params[:user_id])
|
||||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||
# 根据私密性,取出符合条件的所有数据
|
||||
if User.current.member_of?(@project) || User.current.admin?
|
||||
case params[:type]
|
||||
when nil
|
||||
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type in ('Issue', 'Message','News', 'ProjectCreateInfo', 'Attachment')",@project).order("updated_at desc").limit(10).offset(@page * 10)
|
||||
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type in ('Issue', 'Message','News', 'Project', 'Attachment')", @project).includes(:forge_act).order("updated_at desc").limit(10).offset(@page * 10)
|
||||
when 'issue'
|
||||
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type = 'Issue'",@project).order("updated_at desc").limit(10).offset(@page * 10)
|
||||
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type = 'Issue'", @project).includes(:forge_act).order("updated_at desc").limit(10).offset(@page * 10)
|
||||
when 'news'
|
||||
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type = 'News'",@project).order("updated_at desc").limit(10).offset(@page * 10)
|
||||
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type = 'News'", @project).includes(:forge_act).order("updated_at desc").limit(10).offset(@page * 10)
|
||||
when 'message'
|
||||
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type = 'Message'",@project).order("updated_at desc").limit(10).offset(@page * 10)
|
||||
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type = 'Message'", @project).includes(:forge_act).order("updated_at desc").limit(10).offset(@page * 10)
|
||||
when 'attachment'
|
||||
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type = 'Attachment'",@project).order("updated_at desc").limit(10).offset(@page * 10)
|
||||
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type = 'Attachment'", @project).includes(:forge_act).order("updated_at desc").limit(10).offset(@page * 10)
|
||||
end
|
||||
else
|
||||
@events_pages = ForgeActivity.includes(:project).where("forge_activities.project_id = ? and projects.is_public
|
||||
= ? and forge_act_type != ? ",@project,1, "Document").order("created_at desc")
|
||||
.page(params['page'|| 1]).per(10);
|
||||
@events_pages = ForgeActivity.includes(:project).where("forge_activities.project_id = ? and projects.is_public = ? and forge_act_type != ? ",@project,1, "Document").order("created_at desc").page(params['page'|| 1]).per(10);
|
||||
end
|
||||
boards = @project.boards.includes(:last_message => :author).all
|
||||
@topic_count = @project.boards.count
|
||||
# 根据对应的请求,返回对应的数据
|
||||
respond_to do |format|
|
||||
format.html
|
||||
|
@ -560,18 +558,9 @@ class ProjectsController < ApplicationController
|
|||
end
|
||||
|
||||
def update_message_status(user, project)
|
||||
project_invite_messages = ForgeMessage.where("user_id =? and project_id =? and forge_message_type =?", user, project, "ProjectInvite")
|
||||
project_invite_messages.each do |project_invite_message|
|
||||
project_invite_message.update_attribute(:viewed, true)
|
||||
end
|
||||
#更新被加入项目消息的viewed字段
|
||||
join_project_messages = ForgeMessage.where("user_id =? and project_id =? and forge_message_type=?", user, project, "JoinProject")
|
||||
join_project_messages.each do |join_project|
|
||||
join_project.update_attribute(:viewed, true)
|
||||
end
|
||||
#更新被移出项目消息的viewed字段
|
||||
remove_project_messages = ForgeMessage.where("user_id =? and project_id =? and forge_message_type=?", user, project, "RemoveFromProject")
|
||||
remove_project_messages.update_all(:viewed => true)
|
||||
# 更新加入项目消息
|
||||
project__messages = ForgeMessage.where("forge_message_type in ('ProjectInvite', 'JoinProject', 'RemoveFromProject') and user_id =? and project_id =? ", user, project)
|
||||
project__messages.update_all(:viewed => true) unless project__messages.blank?
|
||||
end
|
||||
|
||||
def message_invite(message_id, key)
|
||||
|
|
|
@ -326,12 +326,12 @@ class StudentWorkController < ApplicationController
|
|||
render_403
|
||||
return
|
||||
end
|
||||
|
||||
@student_work_count = (search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").order("#{@order} #{@b_sort}"),@name).count
|
||||
end
|
||||
|
||||
@score = @b_sort == "desc" ? "asc" : "desc"
|
||||
|
||||
# 消息传过来的ID
|
||||
@message_student_work_id = params[:student_work_id]
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html
|
||||
|
|
|
@ -119,49 +119,46 @@ class UsersController < ApplicationController
|
|||
# @new_message_count = forge_querys.count + forum_querys.count + course_querys.count + user_querys.count
|
||||
case params[:type]
|
||||
when nil
|
||||
# 系统消息为管理员发送,我的消息中包含有系统消息
|
||||
@message_alls = []
|
||||
messages = MessageAll.where("(user_id =? and message_type !=?) or message_type =?" ,@user, "SystemMessage", "SystemMessage").order("created_at desc")
|
||||
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|
|
||||
@message_alls << message_all.message
|
||||
end
|
||||
when 'unviewed'
|
||||
@message_alls = []
|
||||
messages = MessageAll.where("user_id =?", @user).order("created_at desc")
|
||||
messages = MessageAll.where("user_id =?", @user.id).includes(:message).order("created_at desc")
|
||||
messages.each do |message_all|
|
||||
# 在点击或者刷新消息列表后未读的消息存放在数组
|
||||
if message_all.message_type != "SystemMessage"&& !message_all.message.nil? && message_all.message.viewed == 0
|
||||
@message_alls << message_all.message
|
||||
end
|
||||
end
|
||||
|
||||
#课程相关消息
|
||||
when 'homework'
|
||||
@message_alls = CourseMessage.where("course_message_type in ('HomeworkCommon','StudentWorksScore','JournalsForMessage','StudentWork','Exercise') and user_id =?", @user).order("created_at desc")
|
||||
@message_alls = CourseMessage.where("course_message_type in ('HomeworkCommon','StudentWorksScore','JournalsForMessage','StudentWork','Exercise') and user_id =?", @user.id).order("created_at desc")
|
||||
when 'course_message'
|
||||
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Message", @user).order("created_at desc")
|
||||
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Message", @user.id).order("created_at desc")
|
||||
when 'course_news'
|
||||
# 课程通知包含发布的通知和回复的通知
|
||||
@message_alls = CourseMessage.where("course_message_type in (?, ? ,?)", "News", "Comment", "Course").where("user_id =?", @user).order("created_at desc")
|
||||
@message_alls = CourseMessage.where("course_message_type in ('News', 'Comment') and user_id =?", @user.id).order("created_at desc")
|
||||
when 'poll'
|
||||
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Poll", @user).order("created_at desc")
|
||||
|
||||
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Poll", @user.id).order("created_at desc")
|
||||
#项目相关消息
|
||||
when 'issue'
|
||||
@message_alls = ForgeMessage.where("forge_message_type =? or forge_message_type =?" , "Issue", "Journal").where("user_id=?", @user).order("created_at desc")
|
||||
@message_alls = ForgeMessage.where("forge_message_type in ('Issue', 'Journal') and user_id =?" , @user.id).order("created_at desc")
|
||||
when 'forge_message'
|
||||
@message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Message", @user).order("created_at desc")
|
||||
@message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Message", @user.id).order("created_at desc")
|
||||
when 'forge_news'
|
||||
@message_alls = ForgeMessage.where("forge_message_type in (?,?) and user_id =?", "News", "Comment", @user).order("created_at desc")
|
||||
@message_alls = ForgeMessage.where("forge_message_type in (?,?) and user_id =?", "News", "Comment", @user.id).order("created_at desc")
|
||||
when 'apply'
|
||||
@message_alls = ForgeMessage.where("forge_message_type in ('ProjectInvite', 'AppliedProject', 'JoinProject', 'RemoveFromProject') and user_id =?", @user).order("created_at desc")
|
||||
|
||||
@message_alls = ForgeMessage.where("forge_message_type in ('ProjectInvite', 'AppliedProject', 'JoinProject', 'RemoveFromProject') and user_id =?", @user.id).order("created_at desc")
|
||||
#贴吧消息
|
||||
when 'forum'
|
||||
@message_alls = MemoMessage.where("memo_type =? and user_id =?", "Memo", @user).order("created_at desc")
|
||||
|
||||
@message_alls = MemoMessage.where("memo_type =? and user_id =?", "Memo", @user.id).order("created_at desc")
|
||||
#用户留言
|
||||
when 'user_feedback'
|
||||
@message_alls = UserFeedbackMessage.where("journals_for_message_type =? and user_id =?", "JournalsForMessage", @user).order("created_at desc")
|
||||
@message_alls = UserFeedbackMessage.where("journals_for_message_type =? and user_id =?", "JournalsForMessage", @user.id).order("created_at desc")
|
||||
else
|
||||
render_404
|
||||
return
|
||||
|
@ -1210,17 +1207,15 @@ class UsersController < ApplicationController
|
|||
|
||||
def show
|
||||
# 统计访问量
|
||||
unless User.current == @user
|
||||
@user.update_attribute(:visits, @user.visits.to_i + 1)
|
||||
end
|
||||
@user.update_column(:visits, @user.visits.to_i + 1) unless User.current == @user
|
||||
#更新用户申请成为课程老师或教辅消息的状态
|
||||
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.where("container_type='User' and container_id=#{@user.id} and shield_type='Project'").map(&:shield_id)
|
||||
shield_course_ids = ShieldActivity.where("container_type='User' and container_id=#{@user.id} and shield_type='Course'").map(&:shield_id)
|
||||
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.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(",") + ")"
|
||||
|
@ -1256,7 +1251,13 @@ class UsersController < ApplicationController
|
|||
end
|
||||
else
|
||||
# @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})or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id})").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
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(','))+")"
|
||||
# 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(','))+")"
|
||||
# 减少数据库交互
|
||||
watched_user_ids = User.watched_by(@user.id).count == 0 ? " " : ("," + User.watched_by(@user.id).map{|u| u.id.to_s }.join(','))
|
||||
user_ids = "(" + @user.id.to_s + watched_user_ids + ")"
|
||||
watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}").map { |blog| blog.id}.join(",")
|
||||
blog_ids = "(" + watched_user_blog_ids + ")"
|
||||
|
||||
@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}) "+
|
||||
"or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " +
|
||||
|
|
|
@ -764,7 +764,7 @@ module ApplicationHelper
|
|||
|
||||
# 判断版本库是否初始为gitlab
|
||||
def rep_is_gitlab?(project)
|
||||
rep = Repository.where("project_id =? and type =?", project, "Repository::Gitlab")
|
||||
rep = project.repositories.where("type =?", "Repository::Gitlab")
|
||||
return rep.blank? ? true :false
|
||||
end
|
||||
|
||||
|
|
|
@ -24,40 +24,20 @@ module CoursesHelper
|
|||
def find_excelletn_course keywords, current_course
|
||||
# 获取tag匹配结果ID
|
||||
a_tags = []
|
||||
# kc = keywords.to_a
|
||||
Course.visible.where("is_excellent =? and is_public =?", 1, 1).each do |ec|
|
||||
Course.where("is_excellent =? and is_public =?", 1, 1).includes(:tags).each do |ec|
|
||||
if ec.tags.any?{|value| current_course.name.include?(value.to_s)}
|
||||
a_tags << ec.id
|
||||
end
|
||||
end
|
||||
# sql = "SELECT distinct c.* FROM `courses` c, tags t, taggings ts where t.id = ts.tag_id and ts.taggable_id = c.id and c.is_excellent = 1 and is_delete = 0 and
|
||||
# ts.taggable_type = 'Course' and t.name like '%#{keywords}%'"
|
||||
# a_tags = Course.find_by_sql(sql).select{|course| course.is_public ==1 unless User.current.member_of_course?(course)}
|
||||
# 通过elastic结果获取精品课程
|
||||
a_courses = []
|
||||
#courses = Course.search(keywords)
|
||||
#courses.each do |c|
|
||||
# a_courses << c.id
|
||||
#end
|
||||
a_courses << a_tags unless a_tags.length == 0
|
||||
# 课程本身不能搜索显示自己
|
||||
excellent_ids = a_courses.flatten.uniq.delete_if{|i| i == current_course.id}
|
||||
limit = 5 - excellent_ids.length.to_i
|
||||
excellent_ids = a_tags.uniq.delete_if{|i| i == current_course.id}
|
||||
sql = "SELECT distinct c.id FROM course_activities cs, courses c where cs.course_id = c.id
|
||||
and c.is_excellent =1 and c.is_public = 1 and c.id != #{current_course.id} order by cs.updated_at desc;"
|
||||
default_ecourse_ids = Course.find_by_sql(sql).flatten
|
||||
# REDO:时间紧,待优化
|
||||
default_ids =[]
|
||||
default_ecourse_ids.each do |de|
|
||||
default_ids << de.id
|
||||
end
|
||||
default_ids = default_ids - excellent_ids
|
||||
#default_ecourse = Course.where("id is not in (?)", ids).find_by_sql(sql).flatten.delete_if{|i| i == current_course.id}.flatten
|
||||
arr_result = excellent_ids << default_ids
|
||||
arr_result = arr_result.flatten.first(5)
|
||||
return arr_result
|
||||
# 过滤条件:精品课程、本身不在搜索范围
|
||||
#e_courses = Course.where("is_excellent =? and id in (?)",1, arr_result).where("id !=?", current_course.id)
|
||||
and (c.is_excellent =1 or c.excellent_option =1) and c.is_public = 1 and c.id != #{current_course.id} order by cs.updated_at desc;"
|
||||
default_ids = Course.find_by_sql(sql).flatten.map { |c| c.id }
|
||||
excellent_ids << default_ids.flatten
|
||||
arr_result = excellent_ids.flatten.uniq.first(5)
|
||||
excellent_courses = Course.find(arr_result)
|
||||
return excellent_courses
|
||||
end
|
||||
|
||||
# 判断精品课程是否可见,非课程成员无法查看私有课程
|
||||
|
@ -258,7 +238,7 @@ module CoursesHelper
|
|||
# 学生人数计算
|
||||
# add by nwb
|
||||
def studentCount course
|
||||
course ? course.student.count.to_s : 0#course.student.count
|
||||
course ? course.student.count.to_i : 0#course.student.count
|
||||
end
|
||||
|
||||
#课程成员数计算
|
||||
|
@ -293,12 +273,17 @@ module CoursesHelper
|
|||
def searchTeacherAndAssistant project
|
||||
#searchPeopleByRoles(project, TeacherRoles)
|
||||
members = []
|
||||
project.members.each do |m|
|
||||
project.members.includes(:user).each do |m|
|
||||
members << m if m && m.user && m.user.allowed_to?(:as_teacher,project)
|
||||
end
|
||||
members
|
||||
end
|
||||
|
||||
def TeacherAndAssistantCount course
|
||||
students_count = course.student.count
|
||||
number = course.members.count - students_count
|
||||
end
|
||||
|
||||
def search_student_in_group(project, course_group_id)
|
||||
#searchPeopleByRoles(project, StudentRoles)
|
||||
members = []
|
||||
|
@ -766,7 +751,7 @@ module CoursesHelper
|
|||
#加入课程、退出课程按钮
|
||||
def join_in_course_header(course, user, options=[])
|
||||
if user.logged?
|
||||
joined = course.members.map{|member| member.user_id}.include? user.id
|
||||
joined = course.members.includes(:user).map{|member| member.user_id}.include? user.id
|
||||
text = joined ? l(:label_course_exit_student) : l(:label_course_join_student)
|
||||
url = joined ? join_path(:object_id => course.id) : try_join_path(:object_id => course.id)
|
||||
method = joined ? 'delete' : 'post'
|
||||
|
|
|
@ -111,9 +111,9 @@ module IssuesHelper
|
|||
|
||||
def principals_options_for_isuue_list(project)
|
||||
if User.current.member_of?(project)
|
||||
project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["<< #{l(:label_me)} >>", User.current.id]).unshift(["指派给", 0])
|
||||
project.members.includes(:user).order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["<< #{l(:label_me)} >>", User.current.id]).unshift(["指派给", 0])
|
||||
else
|
||||
project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["指派给", 0])
|
||||
project.members.includes(:user).order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["指派给", 0])
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ class Attachment < ActiveRecord::Base
|
|||
@@thumbnails_storage_path = File.join(Rails.root, "tmp", "thumbnails")
|
||||
|
||||
before_save :files_to_final_location
|
||||
after_save :act_as_course_activity,:act_as_forge_activity
|
||||
after_save :act_as_course_activity
|
||||
after_create :office_conver, :be_user_score,:create_attachment_ealasticsearch_index
|
||||
after_update :office_conver, :be_user_score,:update_attachment_ealasticsearch_index
|
||||
after_destroy :delete_from_disk,:down_user_score,:delete_attachment_ealasticsearch_index, :decrease_attchments_count, :down_course_score
|
||||
|
|
|
@ -108,7 +108,8 @@ class Project < ActiveRecord::Base
|
|||
has_many :tags, :through => :project_tags, :class_name => 'Tag'
|
||||
has_many :project_tags, :class_name => 'ProjectTags'
|
||||
# 动态级联删除
|
||||
has_many :forge_activities, :class_name => 'ForgeActivity', :dependent => :destroy
|
||||
has_many :forge_acts, :class_name => 'ForgeActivity',:as =>:forge_act ,:dependent => :destroy
|
||||
#has_many :forge_activities, :class_name => 'ForgeActivity', :as =>:forge_act, :dependent => :destroy
|
||||
# 关联虚拟表
|
||||
has_many :forge_messages, :class_name =>'ForgeMessage', :as => :forge_message, :dependent => :destroy
|
||||
|
||||
|
@ -1212,9 +1213,7 @@ class Project < ActiveRecord::Base
|
|||
# Author lizanle
|
||||
# Description 新建项目要在ForgeActivities中加一条数据。
|
||||
def acts_as_forge_activities
|
||||
fa = ForgeActivity.new(:user_id => User.current.id,:project_id => self.id,
|
||||
:forge_act_id => self.id,:forge_act_type => "ProjectCreateInfo")
|
||||
fa.save!
|
||||
self.forge_acts << ForgeActivity.new(:user_id => User.current.id, :project_id => self.id)
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -339,13 +339,15 @@ class User < Principal
|
|||
message_new_time.onclick_time = User.current.last_login_on.nil? ? Time.now : User.current.last_login_on
|
||||
message_new_time.save
|
||||
end
|
||||
course_count = CourseMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count
|
||||
forge_count = ForgeMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count
|
||||
user_feedback_count = UserFeedbackMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count
|
||||
user_memo_count = MemoMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count
|
||||
system_messages_count = SystemMessage.where("created_at >?", User.current.onclick_time.onclick_time).count
|
||||
at_count = AtMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count
|
||||
org_count = OrgMessage.where("user_id=? and viewed =? and created_at >?", User.current.id,0, User.current.onclick_time.onclick_time).count
|
||||
user = User.current
|
||||
onclick_time = user.onclick_time.onclick_time
|
||||
course_count = CourseMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time).count
|
||||
forge_count = ForgeMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time).count
|
||||
user_feedback_count = UserFeedbackMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time).count
|
||||
user_memo_count = MemoMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time).count
|
||||
system_messages_count = SystemMessage.where("created_at >?", onclick_time).count
|
||||
at_count = AtMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time).count
|
||||
org_count = OrgMessage.where("user_id=? and viewed =? and created_at >?", user.id,0, onclick_time).count
|
||||
messages_count = course_count + forge_count + user_feedback_count + user_memo_count + system_messages_count + at_count + org_count
|
||||
end
|
||||
|
||||
|
|
|
@ -2,20 +2,7 @@
|
|||
<%= import_ke(enable_at: false, prettify: false) %>
|
||||
<%= javascript_include_tag "create_kindeditor" %>
|
||||
<% end %>
|
||||
|
||||
<style type="text/css">
|
||||
/*回复框*/
|
||||
/*.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}*/
|
||||
/*.homepagePostReplyInputContainer .ke-toolbar-icon {line-height: 26px; font-size: 14px; padding-left: 26px;}*/
|
||||
/*.homepagePostReplyInputContainer .ke-toolbar-icon-url {background-image: url(/images/public_icon.png)}*/
|
||||
/*.homepagePostReplyInputContainer .ke-outline {padding: 0px 0px; line-height: 26px; font-size: 14px;}*/
|
||||
/*.homepagePostReplyInputContainer .ke-icon-emoticons {background-position: 0px -671px; width: 50px; height: 26px;}*/
|
||||
/*.homepagePostReplyInputContainer .ke-icon-emoticons:hover {background-position: -79px -671px; width: 50px; height: 26px;}*/
|
||||
/*.homepagePostReplyInputContainer .ke-outline {border: none;}*/
|
||||
/*.homepagePostReplyInputContainer .ke-inline-block {display: none;}*/
|
||||
/*.homepagePostReplyInputContainer .ke-container {float: left;}*/
|
||||
</style>
|
||||
<% if topics%>
|
||||
<% if topics %>
|
||||
<% topics.each do |topic| %>
|
||||
<script>
|
||||
function expand_reply(container, btnid) {
|
||||
|
@ -44,19 +31,12 @@
|
|||
});
|
||||
</script>
|
||||
<% if topic %>
|
||||
<%= render :partial => 'users/course_message', :locals => {:activity => topic, :user_activity_id => topic.id,:is_course=>1,:is_board=>1} %>
|
||||
<%= render :partial => 'users/course_message', :locals => {:activity => topic, :user_activity_id => topic.id, :is_course => 1, :is_board=>1} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if topics.count == 10 %>
|
||||
<!--<div id="show_more_course_topic" class="loadMore mt10 f_grey">展开更多<%#= link_to "", boards_topic_path(@board, :course_id => @board.course.id ,:page => page), :id => "more_topic_link", :remote => "true", :class => "none" %></div>-->
|
||||
<%= link_to "点击展开更多",boards_topic_path(@board, :course_id => @board.course.id ,:page => page),:id => "show_more_course_topic",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
||||
<% end %>
|
||||
<% end%>
|
||||
|
||||
<!--
|
||||
<script type="text/javascript">
|
||||
$("#show_more_course_topic").mouseover(function () {
|
||||
$("#more_topic_link").click();
|
||||
});
|
||||
</script>-->
|
||||
|
|
|
@ -192,6 +192,4 @@ function nh_init_board(params){
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
</script>
|
||||
<style type="text/css">
|
||||
</style>
|
||||
<% course_activities.each do |activity| if course_activities %>
|
||||
<% course_activities.includes(:course_act).each do |activity| if course_activities %>
|
||||
<script>
|
||||
function expand_reply(container, btnid) {
|
||||
var target = $(container);
|
||||
|
@ -73,7 +73,7 @@
|
|||
sd_create_editor_from_data(<%= activity.id%>, null, "100%", "<%= activity.class.to_s %>");
|
||||
});
|
||||
</script>
|
||||
<% if activity && activity.course_act%>
|
||||
<% if activity && activity.course_act %>
|
||||
<% act = activity.course_act %>
|
||||
<% case activity.course_act_type.to_s %>
|
||||
<% when 'HomeworkCommon' %>
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
<% unless contributor_course_scor(course.id).count == 0 %>
|
||||
<ul class="rankList">
|
||||
<h4>课程活跃度
|
||||
<a class="contributor_course" onmouseover ="message_titile_show2($(this),event)" onmouseout ="message_titile_hide2($(this))" style="cursor: pointer; position:relative;">积分规则</a>
|
||||
</h4>
|
||||
<div class="numIntro undis" style="cursor:pointer;">
|
||||
<div class="active-degree-rule">
|
||||
积分规则<br/>
|
||||
资源发布:资源数 x 5 <br/>
|
||||
问答发布:发帖数 x 2 <br/>
|
||||
通知发布:通知数 x 1 <br/>
|
||||
问答回复:回复数 x 1 <br/>
|
||||
作业留言:留言数 x 1 <br/>
|
||||
通知留言:留言数 x 1 <br/>
|
||||
课程留言:留言数 x 1 <br/>
|
||||
总得分为以上得分之和</div>
|
||||
</div>
|
||||
<% contributor_course_scor(course.id).each do |contributor_score| %>
|
||||
<% total_score = contributor_score.resource_num.to_i * 5 + contributor_score.message_num.to_i * 2 +
|
||||
contributor_score.message_reply_num.to_i * 1 + contributor_score.journal_num.to_i * 1 +
|
||||
+ contributor_score.homework_journal_num.to_i * 1 + contributor_score.news_reply_num.to_i * 1 +
|
||||
contributor_score.news_num.to_i * 1 %>
|
||||
<% unless total_score ==0 %>
|
||||
<li><%=link_to image_tag(url_to_avatar(contributor_score.user), :width => "35", :height => "35", :class=> "rankPortrait"),user_path(contributor_score.user) %>
|
||||
<p><%=link_to contributor_score.user.show_name, user_path(contributor_score.user.id), :title => contributor_score.user.show_name %></p>
|
||||
<p><span class="c_green" style="cursor:pointer">
|
||||
<a onmouseover ="message_titile_show($(this),event)" onmouseout ="message_titile_hide($(this))" class="c_green">
|
||||
<%=total_score %></a></span></p>
|
||||
<div style="display: none" class="numIntro">
|
||||
<div class="contributor-course-calculate">积分计算</div>
|
||||
<%# unless contributor_score.resource_num.to_i == 0 %>
|
||||
<div style="padding-left: 2px;padding-bottom: 2px;padding-right: 2px">
|
||||
资源发布数 x 5 = <%= contributor_score.resource_num.to_i %> x 5 = <%= contributor_score.resource_num.to_i * 5 %></br>
|
||||
<%# end %>
|
||||
<%# unless contributor_score.message_num.to_i == 0 %>
|
||||
问答发布数 x 2 = <%= contributor_score.message_num.to_i %> x 2 = <%= contributor_score.message_num.to_i * 2 %></br>
|
||||
通知发布数 x 1 = <%= contributor_score.news_num.to_i %> x 1 = <%= contributor_score.news_num.to_i %></br>
|
||||
<%# end %>
|
||||
<%# unless contributor_score.message_reply_num.to_i == 0 %>
|
||||
问答回帖数 x 1 = <%= contributor_score.message_reply_num.to_i %> x 1 = <%= contributor_score.message_reply_num.to_i %></br>
|
||||
作业留言数 x 1 = <%= contributor_score.homework_journal_num.to_i %> x 1 = <%= contributor_score.homework_journal_num.to_i %></br>
|
||||
通知留言数 x 1 = <%= contributor_score.news_reply_num.to_i %> x 1 = <%= contributor_score.news_reply_num.to_i %></br>
|
||||
<%# end %>
|
||||
<%# unless contributor_score.journal_num.to_i == 0 %>
|
||||
课程留言数 x 1 = <%= contributor_score.journal_num.to_i %> x 1 = <%= contributor_score.journal_num.to_i %></br>
|
||||
<%# end %>
|
||||
<%# unless contributor_score.homework_journal_num.to_i == 0 %>
|
||||
<%# end %>
|
||||
<%# unless contributor_score.news_reply_num.to_i == 0 %>
|
||||
<%# end %>
|
||||
总得分:<%=total_score %>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<% end %>
|
|
@ -0,0 +1,21 @@
|
|||
<% hero_homework_scores = hero_homework_score(course, "desc") %>
|
||||
<% unless hero_homework_scores.map(&:score).detect{|s| s.to_i != 0}.nil? %>
|
||||
<ul class="rankList">
|
||||
<h4><span>课程英雄榜</span>
|
||||
<a class="contributor_course" onmouseover ="message_titile_show2($(this),event)" onmouseout ="message_titile_hide2($(this))" style="cursor:pointer;">积分规则</a></h4>
|
||||
<div style="cursor:pointer;" class="numIntro undis">
|
||||
<div class="hero-degree-rule">积分规则<br/>
|
||||
英雄榜的得分是每个同学作业的得分总和
|
||||
</div>
|
||||
</div>
|
||||
<% hero_homework_scores.each do |student_score| %>
|
||||
<% if student_score.score.to_i != 0 %>
|
||||
<li> <a href="javascript:void:(0);"><%=link_to image_tag(url_to_avatar(student_score.user), :width => "35", :height => "35", :class=> "rankPortrait"),user_path(student_score.user) %></a>
|
||||
<p><a href="javascript:void:(0);"><%=link_to student_score.user.show_name, user_path(student_score.user), :title => student_score.user.show_name %></a></p>
|
||||
<p><span class="c_red" style="cursor:pointer" ><%= student_score.score<0 ? 0 : student_score.score.to_i %></span></p>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<% end %>
|
|
@ -1,15 +1,14 @@
|
|||
<% unless excellent_course_recommend(course).length == 0 %>
|
||||
<% exc_course = excellent_course_recommend(course) %>
|
||||
<% unless exc_course.length == 0 %>
|
||||
<ul class="courseR mb10">
|
||||
<h4 class="mb5" ><%= l(:label_homework_recommendation) %>:</h4>
|
||||
<% excellent_course_recommend(course).each do |e_course| %>
|
||||
<% e_course = Course.find(e_course) %>
|
||||
|
||||
<% exc_course.each do |e_course| %>
|
||||
<li class="mt15"> <%= image_tag(url_to_avatar(e_course), :width => "40", :height => "40", :class => "fl mr10 rankPortrait", :alt => "logo") %>
|
||||
<div class="fl">
|
||||
<p class="f12 mb5"><%=link_to e_course.name, course_path(e_course.id), :class => "hidden fl w170" %><div class="cl"></div> </p>
|
||||
<p class="f12">
|
||||
<% if visable_attachemnts_incourse(e_course).count > 0 %>
|
||||
<span class="fl mr15 fontGrey4"><%= l(:project_module_attachments) %>(<%= link_to visable_attachemnts_incourse(e_course).count, course_files_path(e_course), :class => "linkBlue2" %>)</span>
|
||||
<% if course_file_num > 0 %>
|
||||
<span class="fl mr15 fontGrey4"><%= l(:project_module_attachments) %>(<%= link_to course_file_num, course_files_path(e_course), :class => "linkBlue2" %>)</span>
|
||||
<% end %>
|
||||
<% if e_course.homework_commons.where("publish_time <= '#{Date.today}'").count > 0 %>
|
||||
<span class="fl fontGrey4"><%= l(:label_homework_commont) %>(<%= link_to e_course.homework_commons.where("publish_time <= '#{Date.today}'").count, homework_common_index_path(:course=>e_course.id), :class => "linkBlue2" %>)</span>
|
||||
|
|
|
@ -24,19 +24,6 @@
|
|||
</ul>
|
||||
</div>
|
||||
<script>
|
||||
<%# type = type%>
|
||||
// $(function (){
|
||||
// if('<%#= type %>' != null && '<%#= type %>' == 'courses' ){
|
||||
// $('input:radio[value="courses"]').attr('checked','checked');
|
||||
// }
|
||||
// if('<%#= type %>' != null && '<%#= type %>' == 'projects' ){
|
||||
// $('input:radio[value="projects"]').attr('checked','checked');
|
||||
// }
|
||||
// if('<%#= type %>' != null && '<%#= type %>' == 'users' ){
|
||||
// $('input:radio[value="users"]').attr('checked','checked');
|
||||
// }
|
||||
// });
|
||||
|
||||
$(function(){
|
||||
$("#navHomepageSearchInput").keypress(function(e){
|
||||
var name = $.trim($('#navHomepageSearchInput').val());
|
||||
|
@ -65,23 +52,6 @@
|
|||
<input type="text" style="display: none;"/>
|
||||
<a href="javascript:void(0);" class="homepageSearchIcon" onclick="search_in_header($(this));"></a>
|
||||
<% end %>
|
||||
<!--<div class="navSearchTypeBox" id="navHomepageSearchType">-->
|
||||
<!--<div class="fl mr15 mt8">-->
|
||||
<!--<input type="radio" value="courses" name="search_type" checked/>-->
|
||||
<!--课程-->
|
||||
<!--</div>-->
|
||||
<!--<div class="fl mr15 mt8">-->
|
||||
<!--<input type="radio" value="projects" name="search_type" />-->
|
||||
<!--项目-->
|
||||
<!--</div>-->
|
||||
<!--<div class="fl mr15 mt8">-->
|
||||
<!--<input type="radio" value="users" name="search_type" />-->
|
||||
<!--用户-->
|
||||
<!--</div>-->
|
||||
<!--<div id="navSearchAlert" class="fr mr10">-->
|
||||
<!--<span class="c_red">请选择搜索类型</span>-->
|
||||
<!--</div>-->
|
||||
<!--</div>-->
|
||||
</div>
|
||||
|
||||
<div class="navHomepageProfile" id="navHomepageProfile">
|
||||
|
|
|
@ -1,80 +1,39 @@
|
|||
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
|
||||
<% teacher_num = searchTeacherAndAssistant(@course).count %>
|
||||
<% student_num = studentCount(@course) %>
|
||||
<% course_file_num = visable_attachemnts_incourse(@course).count%>
|
||||
<% teacher_num = 0 %>
|
||||
<% student_num = 0 %>
|
||||
<div class="pr_info_logo fl mr10 mb5">
|
||||
<% if is_excellent_course(@course) %>
|
||||
<img src="/images/course/boutique.png" width="50" height="auto" alt="精品" class="boutiqueP" />
|
||||
<% end %>
|
||||
<!--<a href="#"><img src="images/courses/pic_courses.jpg" width="60" height="60" alt="logo" /></a>-->
|
||||
<%= image_tag(url_to_avatar(@course), :width => "60", :height => "60") %>
|
||||
</div>
|
||||
<div class="pr_info_id fl mb5 f14">ID:<%= @course.id%><%= @course.is_public == 0 ? "(私有)" : "(公开)" %>
|
||||
<div class="pr_info_id fl mb5 f14">ID:<%= @course.id %><%= @course.is_public == 0 ? "(私有)" : "(公开)" %>
|
||||
<% if is_excellent_course(@course) %>
|
||||
<img src="/images/course/medal.png" alt="精品课程" style="vertical-align:bottom;" class="ml5" />
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="pr_info_id fl f14">
|
||||
<% unless is_teacher %>
|
||||
<!--<a href="" class="pr_join_a f12">加入课程</a>-->
|
||||
<div id="join_in_course_header"><%= join_in_course_header(@course, User.current) %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<!--<div class="pr_info_id fl mb5 f14">
|
||||
ID:<%#= @course.id%>
|
||||
</div>
|
||||
<div class="pr_info_join fl">
|
||||
<%# if is_teacher%>
|
||||
<%#= link_to "<span class='pr_setting'></span>#{l(:button_configure)}".html_safe, {:controller => 'courses', :action => 'settings', :id => @course}, :class => "pr_join_a" %>
|
||||
<%#= set_course_time @course%>
|
||||
<%#= link_to "<span class='pr_copy'></span>#{l(:button_copy)}".html_safe, copy_course_course_path(@course.id), :class => "pr_join_a" %>
|
||||
<%# else%>
|
||||
<div id="join_in_course_header"><%#= join_in_course_header(@course, User.current) %></div>
|
||||
<%# end%>
|
||||
</div>-->
|
||||
<div class="cl"></div>
|
||||
|
||||
<!--<div >-->
|
||||
<!--<a class="pr_info_name fl c_dark fb break_word" href="http://<%#= Setting.host_course%>/courses/<%#= @course.id%>" target="_blank">-->
|
||||
<!--<%#= @course.name %>-->
|
||||
<!--</a>-->
|
||||
<!--<%# if @course.is_public == 0%>-->
|
||||
<!--<span class="img_private ">-->
|
||||
<!--<%#= l(:field_is_private)%>-->
|
||||
<!--</span>-->
|
||||
<!--<%# end %>-->
|
||||
<!--<%#if @course.tea_id == User.current.id && @course.outline == 0 %>-->
|
||||
<!--<span>-->
|
||||
<!--<a href="javascript:void(0)" onclick="course_outline('<%#= @course.id%>');">设置大纲</a>-->
|
||||
<!--</span>-->
|
||||
<!--<%# else%>-->
|
||||
<!--<span>-->
|
||||
<!--<a href="javascript:void(0)" onclick="course_outline('<%#= @course.id%>');">设置大纲</a>-->
|
||||
<!--</span>-->
|
||||
<!--<%# end %>-->
|
||||
<!--</div>-->
|
||||
<div >
|
||||
<a class="pr_info_name fl c_dark fb break_word" href="http://<%= Setting.host_course%>/courses/<%= @course.id%>" target="_blank"></a>
|
||||
<div>
|
||||
<a class="pr_info_name c_dark fb break_word fl" href="http://<%= Setting.host_course%>/courses/<%= @course.id%>" target="_blank">
|
||||
<%= @course.name %>
|
||||
</a>
|
||||
<%# if @course.is_public == 0%>
|
||||
<!--<span class="img_private "></span>-->
|
||||
<!--<span class="img_private mr5 fl">
|
||||
<%#= l(:field_is_private)%>
|
||||
</span>-->
|
||||
<%# end %>
|
||||
<span id="course_outline_bar">
|
||||
<%if User.current && @course.tea_id == User.current.id && (@course.outline == 0 || BlogComment.where(:id=>@course.outline).count == 0) %>
|
||||
<% if User.current && @course.tea_id == User.current.id && (@course.outline == 0 || BlogComment.where(:id=>@course.outline).count == 0) %>
|
||||
<a href="javascript:void(0);" title="设置课程大纲" onclick="course_outline('<%= @course.id%>')" class="mr5 syllabusSetting fl"> </a>
|
||||
<% elsif User.current && @course.tea_id == User.current.id && @course.outline != 0 && BlogComment.where(:id=>@course.outline).count != 0%>
|
||||
<% elsif User.current && @course.tea_id == User.current.id && @course.outline != 0 && BlogComment.where(:id=>@course.outline).count != 0 %>
|
||||
<a href="<%=syllabus_course_path(@course) %>" title="课程大纲" class="mr5 syllabusIcon fl"> </a>
|
||||
<% elsif User.current && @course.tea_id != User.current.id && !@course.is_public? && User.current.member_of_course?(@course) && @course.outline != 0%>
|
||||
<% elsif User.current && @course.tea_id != User.current.id && !@course.is_public? && User.current.member_of_course?(@course) && @course.outline != 0 %>
|
||||
<a href="<%=syllabus_course_path(@course) %>" title="课程大纲" class="mr5 syllabusIcon fl"> </a>
|
||||
<% elsif User.current && @course.tea_id != User.current.id && @course.is_public? && @course.outline != 0%>
|
||||
<% elsif User.current && @course.tea_id != User.current.id && @course.is_public? && @course.outline != 0 %>
|
||||
<a href="<%=syllabus_course_path(@course) %>" title="课程大纲" class="mr5 syllabusIcon fl"> </a>
|
||||
<%else%>
|
||||
<%else %>
|
||||
<%end %>
|
||||
</span>
|
||||
</div>
|
||||
|
|
|
@ -55,7 +55,8 @@
|
|||
<div id="content">
|
||||
<div id="LSide" class="fl">
|
||||
<div class="project_info" style="position: relative" id="project_info_<%=@course.id %>">
|
||||
<%=render :partial=>'layouts/project_info' %>
|
||||
<% course_file_num = visable_attachemnts_incourse(@course).count %>
|
||||
<%=render :partial=>'layouts/project_info', :locals => {:course_file_num => course_file_num} %>
|
||||
</div><!--课程信息 end-->
|
||||
<div class="info_box">
|
||||
<ul>
|
||||
|
@ -138,94 +139,11 @@
|
|||
</ul>
|
||||
<% end %>
|
||||
</div><!--项目侧导航 end-->
|
||||
<%# 课程贡献榜 %>
|
||||
<%# 课程活跃度 %>
|
||||
<div class="cl"></div>
|
||||
<% unless contributor_course_scor(@course.id).count == 0 %>
|
||||
<ul class="rankList">
|
||||
<h4>课程活跃度
|
||||
<a class="contributor_course" onmouseover ="message_titile_show2($(this),event)" onmouseout ="message_titile_hide2($(this))" style="cursor: pointer; position:relative;">积分规则</a>
|
||||
</h4>
|
||||
<div class="numIntro undis" style="cursor:pointer;">
|
||||
<div class="active-degree-rule">
|
||||
积分规则<br/>
|
||||
资源发布:资源数 x 5 <br/>
|
||||
问答发布:发帖数 x 2 <br/>
|
||||
通知发布:通知数 x 1 <br/>
|
||||
问答回复:回复数 x 1 <br/>
|
||||
作业留言:留言数 x 1 <br/>
|
||||
通知留言:留言数 x 1 <br/>
|
||||
课程留言:留言数 x 1 <br/>
|
||||
总得分为以上得分之和</div>
|
||||
</div>
|
||||
|
||||
<% contributor_course_scor(@course.id).each do |contributor_score| %>
|
||||
<% total_score = contributor_score.resource_num.to_i * 5 + contributor_score.message_num.to_i * 2 +
|
||||
contributor_score.message_reply_num.to_i * 1 + contributor_score.journal_num.to_i * 1 +
|
||||
+ contributor_score.homework_journal_num.to_i * 1 + contributor_score.news_reply_num.to_i * 1 +
|
||||
contributor_score.news_num.to_i * 1 %>
|
||||
<% unless total_score ==0 %>
|
||||
<li><%=link_to image_tag(url_to_avatar(contributor_score.user), :width => "35", :height => "35", :class=> "rankPortrait"),user_path(contributor_score.user) %>
|
||||
<p><%=link_to contributor_score.user.show_name, user_path(contributor_score.user.id), :title => contributor_score.user.show_name %></p>
|
||||
<p><span class="c_green" style="cursor:pointer">
|
||||
<a onmouseover ="message_titile_show($(this),event)" onmouseout ="message_titile_hide($(this))" class="c_green">
|
||||
<%=total_score %></a></span></p>
|
||||
<div style="display: none" class="numIntro">
|
||||
<div class="contributor-course-calculate">积分计算</div>
|
||||
<%# unless contributor_score.resource_num.to_i == 0 %>
|
||||
<div style="padding-left: 2px;padding-bottom: 2px;padding-right: 2px">
|
||||
资源发布数 x 5 = <%= contributor_score.resource_num.to_i %> x 5 = <%= contributor_score.resource_num.to_i * 5 %></br>
|
||||
<%# end %>
|
||||
<%# unless contributor_score.message_num.to_i == 0 %>
|
||||
问答发布数 x 2 = <%= contributor_score.message_num.to_i %> x 2 = <%= contributor_score.message_num.to_i * 2 %></br>
|
||||
通知发布数 x 1 = <%= contributor_score.news_num.to_i %> x 1 = <%= contributor_score.news_num.to_i %></br>
|
||||
<%# end %>
|
||||
<%# unless contributor_score.message_reply_num.to_i == 0 %>
|
||||
问答回帖数 x 1 = <%= contributor_score.message_reply_num.to_i %> x 1 = <%= contributor_score.message_reply_num.to_i %></br>
|
||||
作业留言数 x 1 = <%= contributor_score.homework_journal_num.to_i %> x 1 = <%= contributor_score.homework_journal_num.to_i %></br>
|
||||
通知留言数 x 1 = <%= contributor_score.news_reply_num.to_i %> x 1 = <%= contributor_score.news_reply_num.to_i %></br>
|
||||
<%# end %>
|
||||
<%# unless contributor_score.journal_num.to_i == 0 %>
|
||||
课程留言数 x 1 = <%= contributor_score.journal_num.to_i %> x 1 = <%= contributor_score.journal_num.to_i %></br>
|
||||
<%# end %>
|
||||
<%# unless contributor_score.homework_journal_num.to_i == 0 %>
|
||||
|
||||
<%# end %>
|
||||
<%# unless contributor_score.news_reply_num.to_i == 0 %>
|
||||
|
||||
|
||||
<%# end %>
|
||||
总得分:<%=total_score %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<% hero_homework_scores = hero_homework_score(@course, "desc") %>
|
||||
<% unless hero_homework_scores.map(&:score).detect{|s| s.to_i != 0}.nil? %>
|
||||
<ul class="rankList">
|
||||
<h4><span>课程英雄榜</span>
|
||||
<a class="contributor_course" onmouseover ="message_titile_show2($(this),event)" onmouseout ="message_titile_hide2($(this))" style="cursor:pointer;">积分规则</a></h4>
|
||||
<div style="cursor:pointer;" class="numIntro undis">
|
||||
<div class="hero-degree-rule">积分规则<br/>
|
||||
英雄榜的得分是每个同学作业的得分总和
|
||||
</div>
|
||||
</div>
|
||||
<% hero_homework_scores.each do |student_score| %>
|
||||
<% if student_score.score.to_i != 0 %>
|
||||
<li> <a href="javascript:void:(0);"><%=link_to image_tag(url_to_avatar(student_score.user), :width => "35", :height => "35", :class=> "rankPortrait"),user_path(student_score.user) %></a>
|
||||
<p><a href="javascript:void:(0);"><%=link_to student_score.user.show_name, user_path(student_score.user), :title => student_score.user.show_name %></a></p>
|
||||
<p><span class="c_red" style="cursor:pointer" ><%= student_score.score<0 ? 0 : student_score.score.to_i %></span></p>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<% end %>
|
||||
<%= render :partial => 'courses/course_activity_users', :locals => {:course => @course} %>
|
||||
<%# 课程英雄榜 %>
|
||||
<%= render :partial => 'courses/course_heroes', :locals => {:course => @course} %>
|
||||
|
||||
<% if @course.description && !@course.description.blank? %>
|
||||
<div class="project_intro">
|
||||
|
@ -251,7 +169,7 @@
|
|||
<div class="cl"></div>
|
||||
</div><!--项目标签 end-->
|
||||
<!--课程推荐-->
|
||||
<%= render :partial => 'courses/recommendation', :locals => {:course => @course} %>
|
||||
<%= render :partial => 'courses/recommendation', :locals => {:course => @course, :course_file_num => course_file_num} %>
|
||||
<div class="fontGrey5 mt10 ml10 mb10">访问计数 <%= @course.visits.to_i %></div>
|
||||
</div><!--LSide end-->
|
||||
|
||||
|
|
|
@ -44,8 +44,6 @@
|
|||
<div class="cl"></div>
|
||||
|
||||
<div id="Container">
|
||||
|
||||
<%#= render :partial => 'layouts/new_header'%>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div id="content">
|
||||
|
@ -104,20 +102,6 @@
|
|||
|
||||
<!--邀请加入-->
|
||||
<div class="subNavBox">
|
||||
<%# if User.current.member_of?(@project) %>
|
||||
<!--<div class="subNav currentDd currentDt subNav_jiantou" id="expand_tools_expand_invit" nhtype="toggle4cookie" data-id="expand_invit" data-target="#navContent_invit" data-val="expand">-->
|
||||
<!--<%#= l(:label_invite)%>-->
|
||||
<!--</div>-->
|
||||
<!--<ul class="navContent " style="display:block" id="navContent_invit">-->
|
||||
<!--<li><%#= link_to l(:label_invite_new_user), :controller=>"projects", :action=>"invite_members_by_mail", :id => @project %></li>-->
|
||||
<!--<!–<%# if User.current.allowed_to?(:manage_members, @project) %>–>-->
|
||||
<!--<li><%#= link_to l(:label_invite_trustie_user), :controller=>"projects", :action=>"invite_members", :id => @project %></li>-->
|
||||
<!--<%# end %>-->
|
||||
<!--</ul>-->
|
||||
<%# end %><!--end-->
|
||||
<!--menu 左侧工具栏 -->
|
||||
<%#--project_new_type: 1为开发组;2为科研组;3为朋友圈子--%>
|
||||
|
||||
<div id="project_memu_list">
|
||||
<% if @project.project_new_type == 1 || @project.project_new_type.nil? %>
|
||||
<%= render :partial => 'projects/development_group', :locals => {:project => @project} %>
|
||||
|
|
|
@ -204,7 +204,13 @@
|
|||
<% end%>
|
||||
<% end%>
|
||||
</div>
|
||||
<% courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5) %>
|
||||
<% course_order_ids = "(" +
|
||||
CourseActivity.find_by_sql("SELECT c.course_id, updated_at FROM
|
||||
(SELECT ca.course_id, MAX(ca.updated_at) AS updated_at FROM course_activities ca WHERE ca.course_id IN (" + @user.courses.visible.select('courses.id').map{|c| c.id}.join(',') + ")
|
||||
GROUP BY ca.course_id) AS c
|
||||
ORDER BY c.updated_at DESC limit 5").map {|c| c.course_id}.join(",") + ")"%>
|
||||
<% courses = Course.where("id in #{course_order_ids}")%>
|
||||
<%# courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5) %>
|
||||
<div class="homepageLeftMenuCourses <%= courses.empty? ? 'none' : ''%>" id="homepageLeftMenuCourses">
|
||||
<ul>
|
||||
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user, :page => 0} %>
|
||||
|
@ -217,7 +223,14 @@
|
|||
<%=link_to "", new_project_path(:host=> Setting.host_name), :class => "homepageMenuSetting fr", :style => "margin-right:10px;", :title => "新建项目"%>
|
||||
<% end%>
|
||||
</div>
|
||||
<% projects = @user.projects.visible.select("projects.*,(SELECT MAX(created_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5)%>
|
||||
<% project_order_ids = "(" +
|
||||
ForgeActivity.find_by_sql("SELECT p.project_id, p.created_at FROM
|
||||
(SELECT fa.project_id, MAX(fa.created_at) AS created_at FROM forge_activities fa WHERE fa.project_id IN (" + @user.projects.visible.select('projects.id').map{|p| p.id}.join(',') + ")
|
||||
GROUP BY fa.project_id) AS p
|
||||
ORDER BY p.created_at DESC limit 5").map {|p| p.project_id}.join(",") + ")"%>
|
||||
<%# project_order_ids = "(" + ForgeActivity.select("DISTINCT project_id, max(created_at) as max_created_at").where("project_id in #{"(" + @user.projects.visible.select("projects.id").map{|p| p.id}.join(",") + ")"}").order("max_created_at desc").map {|p| p.project_id}.join(",") + ")"%>
|
||||
<% projects = Project.where("projects.id in #{project_order_ids}")%>
|
||||
<%# projects = @user.projects.visible.select("projects.*, (SELECT MAX(created_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5)%>
|
||||
<div class="homepageLeftMenuCourses <%= projects.empty? ? 'none' : ''%>" id="homepageLeftMenuForge">
|
||||
<ul>
|
||||
<%= render :partial => 'layouts/user_projects', :locals => {:projects => projects,:user => @user, :page => 0} %>
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
</script>
|
||||
|
||||
<% unless forge_acts.empty? %>
|
||||
<% forge_acts.each do |activity| -%>
|
||||
<% forge_acts.includes(:forge_act).each do |activity| -%>
|
||||
<script>
|
||||
function expand_reply(container, btnid) {
|
||||
var target = $(container);
|
||||
|
@ -73,15 +73,14 @@
|
|||
</script>
|
||||
<!--创建-->
|
||||
<% case activity.forge_act_type %>
|
||||
<% when "ProjectCreateInfo" %>
|
||||
<% when "Project" %>
|
||||
<%= render :partial => 'projects/project_create', :locals => {:activity => activity, :user_activity_id => activity.id} %>
|
||||
<!--缺陷动态-->
|
||||
<% when "Issue" %>
|
||||
<%= render :partial => 'users/project_issue', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id, :project_id => activity.project_id} %>
|
||||
|
||||
<!--message -->
|
||||
<% when "Message" %>
|
||||
<%= render :partial => 'users/project_message', :locals => {:activity => activity.forge_act,:user_activity_id =>activity.id,:is_course=>1,:is_board=>0} %>
|
||||
<%= render :partial => 'users/project_message', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id, :is_course => 1, :is_board => 0} %>
|
||||
<!--new 新闻-->
|
||||
<% when "News" %>
|
||||
<% if !activity.forge_act.nil? and activity.forge_act.project %>
|
||||
|
|
|
@ -151,7 +151,7 @@
|
|||
<% else %>
|
||||
<% student_works = activity.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("score desc") %>
|
||||
<% end %>
|
||||
<% student_works.each_with_index do |sw, i| %>
|
||||
<% student_works.includes(:user).each_with_index do |sw, i| %>
|
||||
<div class="fl mr10 w100" style="text-align:center;">
|
||||
<a href="javascript:void(0);" class="linkBlue">
|
||||
<% if User.current.member_of_course?(activity.course) || User.current.admin? || activity.is_open == 1 %>
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
<%#= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||
<%= link_to activity.try(:author), user_path(activity.author_id, :host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id, :host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
TO
|
||||
<%= link_to activity.course.name.to_s+" | 课程问答区", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15 mr5"%>
|
||||
|
@ -18,15 +18,15 @@
|
|||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "postGrey" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "postGrey"%>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board_id, activity), :class=> "postGrey" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if activity.sticky == 1%>
|
||||
<% if activity.sticky == 1 %>
|
||||
<span class="sticky_btn_cir ml10">置顶</span>
|
||||
<% end%>
|
||||
<% if activity.locked%>
|
||||
<% if activity.locked %>
|
||||
<span class="locked_btn_cir ml10 fl" title="已锁定"> </span>
|
||||
<% end%>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<div class="homepagePostDate fl">
|
||||
发帖时间:<%= format_time(activity.created_on) %>
|
||||
|
@ -36,9 +36,9 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
<% if activity.parent_id.nil? %>
|
||||
<% content = activity.content%>
|
||||
<% content = activity.content %>
|
||||
<% else %>
|
||||
<% content = activity.parent.content%>
|
||||
<% content = activity.parent.content %>
|
||||
<% end %>
|
||||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %>
|
||||
<div class="cl"></div>
|
||||
|
@ -113,7 +113,7 @@
|
|||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.children.reorder("created_on desc").each do |reply|%>
|
||||
<% activity.children.includes(:author).reorder("created_on desc").each do |reply|%>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= reply.id %>');
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
<div class="resources mt10">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
|
|
|
@ -73,10 +73,9 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>activity.description} %>
|
||||
|
||||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id => user_activity_id, :content => activity.description} %>
|
||||
<div id="intro_content_show_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<%# 局部刷新:修改xissue属性 %>
|
||||
<% if User.current.member_of?(activity.project) %>
|
||||
|
|
|
@ -54,6 +54,10 @@
|
|||
</li>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
<%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "assigned"},:remote=>'true', :method => :put, :id=>"issue_query_assign_form_#{activity.id}", :class => 'query_form') do %>
|
||||
<li>
|
||||
<p class="label03"> 指派 : </p>
|
||||
|
@ -66,6 +70,10 @@
|
|||
</li>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
<ul class="fl">
|
||||
<%= form_tag({:controller => 'issues', :action => 'update', :id => activity.id, :issue_detail => true, :type => "prior"},:remote=>'true', :method => :put, :id=>"issue_query_prior_form_#{activity.id}", :class => 'query_form') do %>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.journals.reorder("created_on desc").each do |reply| %>
|
||||
<% activity.journals.includes(:user, :details).reorder("created_on desc").each do |reply| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= reply.id %>');
|
||||
|
@ -44,7 +44,7 @@
|
|||
<%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_time(reply.created_on) %>
|
||||
<span id="reply_praise_count_<%=reply.id %>">
|
||||
<span id="reply_praise_count_<%= reply.id %>">
|
||||
<% if reply.user == User.current %>
|
||||
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%= get_praise_num(reply) > 0 ? "(#{get_praise_num(reply)})" : "" %></span></span>
|
||||
<% else %>
|
||||
|
|
|
@ -108,7 +108,7 @@
|
|||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.children.reorder("created_on desc").each do |reply| %>
|
||||
<% activity.children.includes(:author).reorder("created_on desc").each do |reply| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= reply.id %>');
|
||||
|
|
|
@ -54,56 +54,62 @@
|
|||
sd_create_editor_from_data(<%= user_activity.id %>, null, "100%", "<%= user_activity.class.to_s %>");
|
||||
});
|
||||
</script>
|
||||
<% unless user_activity.act_type == "ProjectCreateInfo" %>
|
||||
<% if user_activity.act_type == "ProjectCreateInfo" %>
|
||||
<%= render :partial => 'project_create', :locals => {:activity => user_activity,:user_activity_id =>user_activity.id} %>
|
||||
<% else %>
|
||||
<% act= user_activity.act %>
|
||||
<%if act %>
|
||||
|
||||
<% case user_activity.container_type.to_s %>
|
||||
<% when 'Course' %>
|
||||
<% if act %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'HomeworkCommon' %>
|
||||
<% cache (act) do %>
|
||||
<%= render :partial => 'course_homework', :locals => {:activity => act,:user_activity_id =>user_activity.id,:course_activity => 0} %>
|
||||
<% end %>
|
||||
<% when 'News' %>
|
||||
<% cache [act, act.comments.count] do %>
|
||||
<%= render :partial => 'course_news', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||
<% end %>
|
||||
<% when 'Message'%>
|
||||
<%= render :partial => 'course_message', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_course=>0,:is_board=>0} %>
|
||||
<% when 'Poll' %>
|
||||
<%= render :partial => 'course_poll', :locals => {:activity => act, :user_activity_id => user_activity.id} %>
|
||||
<% when 'Course'%>
|
||||
<%= 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 %>
|
||||
<% cache (act) do %>
|
||||
<%= render :partial => 'users/course_create', :locals => {:activity => act, :user_activity_id => act.id} %>
|
||||
<%end%>
|
||||
<% end %>
|
||||
<% when 'Project' %>
|
||||
<% if act %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'Issue' %>
|
||||
<% cache [act, act.journals.count, act.attachments.count] do%>
|
||||
<%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity_id =>user_activity.id, :user_id => user_id} %>
|
||||
<% end %>
|
||||
<% when 'Message' %>
|
||||
<%= render :partial => 'project_message', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_course=>0,:is_board=>0} %>
|
||||
<% when 'ProjectCreateInfo'%>
|
||||
<% cache (act) do %>
|
||||
<%= render :partial => 'project_create', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% when 'Principal' %>
|
||||
<% if act %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'JournalsForMessage' %>
|
||||
<% unless act.private == 1 && (!User.current || (User.current && act.jour_id != User.current.id && act.user_id != User.current.id)) %>
|
||||
<%= render :partial => 'user_journalsformessage', :locals => {:activity => act,:user_activity_id =>user_activity.id,:is_activity=>1} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% when 'Blog'%>
|
||||
<%if act %>
|
||||
<% cache (act) do %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'BlogComment' %>
|
||||
<%= render :partial => 'user_blog', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= render :partial => 'project_create', :locals => {:activity => user_activity,:user_activity_id =>user_activity.id} %>
|
||||
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
@ -21,13 +21,6 @@
|
|||
<%= link_to ma.subject.html_safe, ma.url, :class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}", :onmouseover =>"message_titile_show($(this),event)", :onmouseout => "message_titile_hide($(this))" %>
|
||||
<% end %>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>标题:</strong><%= ma.subject %></p>
|
||||
<% unless ma.description.nil? %>
|
||||
<div class="fl"><strong>内容:</strong></div>
|
||||
<div class="ml36"><%= ma.description.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
|
@ -155,7 +155,7 @@
|
|||
<% else %>
|
||||
<% student_works = homework_common.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("score desc") %>
|
||||
<% end %>
|
||||
<% student_works.each_with_index do |sw, i| %>
|
||||
<% student_works.includes(:user).each_with_index do |sw, i| %>
|
||||
<div class="fl mr10 w100" style="text-align:center;">
|
||||
<a href="javascript:void(0);" class="linkBlue">
|
||||
<% if User.current.member_of_course?(homework_common.course) || User.current.admin? || homework_common.is_open == 1 %>
|
||||
|
|
|
@ -15,9 +15,6 @@
|
|||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<%= ma.project %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -38,21 +35,6 @@
|
|||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<% if ma.project.is_public? || User.current.member_of?(ma.project) || User.current.admin? %>
|
||||
<p>
|
||||
项目名称:<%= ma.project.name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
项目描述:<%= ma.project.description %>
|
||||
</p>
|
||||
<% else %>
|
||||
<p>
|
||||
您已经被移出该私有项目,非项目成员没有权限访问私有项目
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -74,21 +56,6 @@
|
|||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<% if ma.project.is_public? || User.current.member_of?(ma.project) || User.current.admin? %>
|
||||
<p>
|
||||
项目名称:<%= ma.project.name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
项目描述:<%= ma.project.description %>
|
||||
</p>
|
||||
<% else %>
|
||||
<p>
|
||||
您已经被移出该私有项目,非项目成员没有权限访问私有项目
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -114,9 +81,6 @@
|
|||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<%= ma.project %>
|
||||
</div>
|
||||
<% unless User.current.member_of?(ma.project) %>
|
||||
<li class="homepageHomeworkContentWarn fl">
|
||||
<%=link_to "同意加入", {:controller => 'projects', :action => 'member', :id => ma.project_id, :message_id =>ma.id, :key => ma.secret_key},
|
||||
|
@ -144,13 +108,6 @@
|
|||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>主题:</strong><%= ma.forge_message.subject %></p>
|
||||
<% unless ma.forge_message.description.nil? || ma.forge_message.description == "" %>
|
||||
<div class="fl"><strong>描述:</strong></div>
|
||||
<div class="ml36"><%= ma.forge_message.description.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageHomeworkContentWarn fl"> 截止时间快到了!</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
|
@ -169,13 +126,6 @@
|
|||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>主题:</strong><%= ma.forge_message.subject %></p>
|
||||
<% unless ma.forge_message.description.nil? || ma.forge_message.description == "" %>
|
||||
<div class="fl"><strong>描述:</strong></div>
|
||||
<div class="ml36"><%= ma.forge_message.description.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -197,11 +147,6 @@
|
|||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style" >
|
||||
<p><strong>问题标题:</strong><%= ma.forge_message.journalized.subject %></p>
|
||||
<div class="fl"><strong>更新内容:</strong></div>
|
||||
<div class="ml60"><%= get_issue_des_update(ma.forge_message).html_safe %></div>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -210,37 +155,14 @@
|
|||
<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>
|
||||
<% if ma.forge_message.parent_id.nil? %>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.forge_message.subject, 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"}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a></li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>主题:</strong><%= ma.forge_message.subject %></p>
|
||||
<% unless ma.forge_message.content.nil? %>
|
||||
<div class="fl"><strong>内容:</strong></div>
|
||||
<div class="ml36"><%= ma.forge_message.content.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.forge_message.subject, 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"}" %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a></li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>帖子主题:</strong><%= ma.forge_message.subject %></p>
|
||||
<% unless ma.forge_message.content.nil? %>
|
||||
<div class="fl"><strong>评论内容:</strong></div>
|
||||
<div class="ml60"><%= ma.forge_message.content.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</a>
|
||||
</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -260,13 +182,6 @@
|
|||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>标题:</strong><%= ma.forge_message.title %></p>
|
||||
<% unless ma.forge_message.description.nil? %>
|
||||
<div class="fl"><strong>内容:</strong></div>
|
||||
<div class="ml36"><%= ma.forge_message.description.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
@ -281,11 +196,6 @@
|
|||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>新闻标题:</strong><%= ma.forge_message.commented.title %></p>
|
||||
<div class="fl"><strong>评论内容:</strong></div>
|
||||
<div class="ml60"><%= ma.forge_message.comments.html_safe %></div>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
|
|
@ -15,13 +15,6 @@
|
|||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>标题:</strong><%= ma.memo.subject %></p>
|
||||
<% unless ma.memo.content.nil? %>
|
||||
<div class="fl"><strong>内容:</strong></div>
|
||||
<div class="ml36"><%= ma.memo.content.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.memo.content.html_safe, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}" %>
|
||||
|
@ -29,13 +22,6 @@
|
|||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p><strong>标题:</strong><%= ma.memo.subject %></p>
|
||||
<% unless ma.memo.content.nil? %>
|
||||
<div class="fl"><strong>内容:</strong></div>
|
||||
<div class="ml36"><%= ma.memo.content.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.memo.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
|
|
|
@ -15,14 +15,6 @@
|
|||
<!--:onmouseover =>"message_titile_show($(this),event);",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this));"-->
|
||||
</li>
|
||||
<div style="display:none;" class="message_title_red system_message_style">
|
||||
<% unless ma.subject.blank? %>
|
||||
<p><strong>标题:</strong><%= ma.subject %></p>
|
||||
<% end %>
|
||||
<% if (!ma.description.blank?) || (!ma.content.blank?) %>
|
||||
<div class="fl"><strong>内容:</strong></div><div class="ml36"><%= ma.description.nil? ? ma.content.html_safe : ma.description.html_safe %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<%# end %>
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
<% end %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.journals_for_message.created_on).html_safe %> </li>
|
||||
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -0,0 +1,5 @@
|
|||
class AddIndexToMessageAlls < ActiveRecord::Migration
|
||||
def change
|
||||
add_index :message_alls, [:user_id, :message_id, :created_at]
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddIndexToCourseMessages < ActiveRecord::Migration
|
||||
def change
|
||||
add_index :course_messages, [:user_id, :course_id, :created_at]
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddIndexToMemoMessages < ActiveRecord::Migration
|
||||
def change
|
||||
add_index :memo_messages, [:user_id, :forum_id, :created_at]
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddIndexToUserFeedbackMessages < ActiveRecord::Migration
|
||||
def change
|
||||
add_index :user_feedback_messages, [:user_id, :created_at]
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddIndexToForgeMessages < ActiveRecord::Migration
|
||||
def change
|
||||
add_index :forge_messages, [:user_id, :project_id, :created_at]
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddForgetypeToForgeMessages < ActiveRecord::Migration
|
||||
def change
|
||||
add_index :forge_messages, [:forge_message_id, :forge_message_type]
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddUsertypeToUserFeedbackMessages < ActiveRecord::Migration
|
||||
def change
|
||||
add_index :user_feedback_messages, [:journals_for_message_id]
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddMemotypeToMemoMessages < ActiveRecord::Migration
|
||||
def change
|
||||
add_index :memo_messages, [:memo_id, :memo_type]
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddFeedToUserFeedbackMessages < ActiveRecord::Migration
|
||||
def change
|
||||
add_index :course_messages, [:course_message_type]
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddIndexMtyeToMessageAlls < ActiveRecord::Migration
|
||||
def change
|
||||
add_index :message_alls, [:message_type]
|
||||
end
|
||||
end
|
|
@ -0,0 +1,8 @@
|
|||
class ChangeProjectCreateType < ActiveRecord::Migration
|
||||
def up
|
||||
execute("update forge_activities set forge_act_type = 'Project' where forge_act_type = 'ProjectCreateInfo'")
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddIndexToForgeActivities < ActiveRecord::Migration
|
||||
def change
|
||||
add_index :forge_activities, [:project_id, :forge_act_id, :created_at, :forge_act_type], :name => "forge_act_index"
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddIndexToCourseActiivities < ActiveRecord::Migration
|
||||
def change
|
||||
add_index :course_activities, [:course_id, :course_act_id, :course_act_type, :created_at], :name => "course_act_index"
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddIndexToUserActivities < ActiveRecord::Migration
|
||||
def change
|
||||
add_index :user_activities, [:act_id, :act_type, :container_id, :created_at], :name => "user_act_index"
|
||||
end
|
||||
end
|
22
db/schema.rb
22
db/schema.rb
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20160317090350) do
|
||||
ActiveRecord::Schema.define(:version => 20160325030423) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
@ -405,6 +405,8 @@ ActiveRecord::Schema.define(:version => 20160317090350) do
|
|||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
add_index "course_activities", ["course_id", "course_act_id", "course_act_type", "created_at"], :name => "course_act_index"
|
||||
|
||||
create_table "course_attachments", :force => true do |t|
|
||||
t.string "filename"
|
||||
t.string "disk_filename"
|
||||
|
@ -465,6 +467,9 @@ ActiveRecord::Schema.define(:version => 20160317090350) do
|
|||
t.integer "status"
|
||||
end
|
||||
|
||||
add_index "course_messages", ["course_message_type"], :name => "index_course_messages_on_course_message_type"
|
||||
add_index "course_messages", ["user_id", "course_id", "created_at"], :name => "index_course_messages_on_user_id_and_course_id_and_created_at"
|
||||
|
||||
create_table "course_statuses", :force => true do |t|
|
||||
t.integer "changesets_count"
|
||||
t.integer "watchers_count"
|
||||
|
@ -728,6 +733,7 @@ ActiveRecord::Schema.define(:version => 20160317090350) do
|
|||
end
|
||||
|
||||
add_index "forge_activities", ["forge_act_id"], :name => "index_forge_activities_on_forge_act_id"
|
||||
add_index "forge_activities", ["project_id", "forge_act_id", "created_at", "forge_act_type"], :name => "forge_act_index"
|
||||
|
||||
create_table "forge_messages", :force => true do |t|
|
||||
t.integer "user_id"
|
||||
|
@ -741,6 +747,9 @@ ActiveRecord::Schema.define(:version => 20160317090350) do
|
|||
t.integer "status"
|
||||
end
|
||||
|
||||
add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type"
|
||||
add_index "forge_messages", ["user_id", "project_id", "created_at"], :name => "index_forge_messages_on_user_id_and_project_id_and_created_at"
|
||||
|
||||
create_table "forums", :force => true do |t|
|
||||
t.string "name", :null => false
|
||||
t.text "description"
|
||||
|
@ -1055,6 +1064,9 @@ ActiveRecord::Schema.define(:version => 20160317090350) do
|
|||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
add_index "memo_messages", ["memo_id", "memo_type"], :name => "index_memo_messages_on_memo_id_and_memo_type"
|
||||
add_index "memo_messages", ["user_id", "forum_id", "created_at"], :name => "index_memo_messages_on_user_id_and_forum_id_and_created_at"
|
||||
|
||||
create_table "memos", :force => true do |t|
|
||||
t.integer "forum_id", :null => false
|
||||
t.integer "parent_id"
|
||||
|
@ -1078,6 +1090,9 @@ ActiveRecord::Schema.define(:version => 20160317090350) do
|
|||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
add_index "message_alls", ["message_type"], :name => "index_message_alls_on_message_type"
|
||||
add_index "message_alls", ["user_id", "message_id", "created_at"], :name => "index_message_alls_on_user_id_and_message_id_and_created_at"
|
||||
|
||||
create_table "messages", :force => true do |t|
|
||||
t.integer "board_id", :null => false
|
||||
t.integer "parent_id"
|
||||
|
@ -1800,6 +1815,8 @@ ActiveRecord::Schema.define(:version => 20160317090350) do
|
|||
t.integer "user_id"
|
||||
end
|
||||
|
||||
add_index "user_activities", ["act_id", "act_type", "container_id", "created_at"], :name => "user_act_index"
|
||||
|
||||
create_table "user_extensions", :force => true do |t|
|
||||
t.integer "user_id", :null => false
|
||||
t.date "birthday"
|
||||
|
@ -1830,6 +1847,9 @@ ActiveRecord::Schema.define(:version => 20160317090350) do
|
|||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
add_index "user_feedback_messages", ["journals_for_message_id"], :name => "index_user_feedback_messages_on_journals_for_message_id"
|
||||
add_index "user_feedback_messages", ["user_id", "created_at"], :name => "index_user_feedback_messages_on_user_id_and_created_at"
|
||||
|
||||
create_table "user_grades", :force => true do |t|
|
||||
t.integer "user_id", :null => false
|
||||
t.integer "project_id", :null => false
|
||||
|
|
Loading…
Reference in New Issue