Merge branch 'cxt_course' into develop
This commit is contained in:
commit
785f027a63
|
@ -40,9 +40,10 @@ class BlogCommentsController < ApplicationController
|
|||
end
|
||||
def show
|
||||
@article = BlogComment.find(params[:id])
|
||||
all_comments = []
|
||||
@replies = get_all_children(all_comments, @article)
|
||||
@replies = BlogComment.where("root_id = #{@article.id}").reorder("created_on desc")
|
||||
@reply_count = @replies.count
|
||||
@replies = get_no_children_comments_all @replies
|
||||
@limit_count = @replies.count
|
||||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||
@limit = 10
|
||||
@replies = @replies[@page * @limit..@page * @limit + 9]
|
||||
|
|
|
@ -50,6 +50,8 @@ class MessagesController < ApplicationController
|
|||
all_comments = []
|
||||
@replies = Message.where("root_id = #{@topic.id}").reorder("created_on desc")
|
||||
@reply_count = @replies.count
|
||||
@replies = get_no_children_comments_all @replies
|
||||
@limit_count = @replies.count
|
||||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||
@limit = 10
|
||||
@replies = @replies[@page * @limit..@page * @limit + 9]
|
||||
|
@ -171,9 +173,6 @@ class MessagesController < ApplicationController
|
|||
@reply.root_id = parent.root_id.nil? ? parent.id : parent.root_id
|
||||
# @reply.reply_id = params[:id]
|
||||
parent.children << @reply
|
||||
@user_activity_id = params[:user_activity_id] if params[:user_activity_id]
|
||||
@is_course = params[:is_course] if params[:is_course]
|
||||
@is_board = params[:is_board] if params[:is_board]
|
||||
else
|
||||
@quote = params[:quote][:quote]
|
||||
@reply = Message.new
|
||||
|
@ -207,8 +206,8 @@ class MessagesController < ApplicationController
|
|||
end
|
||||
if params[:user_activity_id]
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
@is_course = params[:is_course]
|
||||
@is_board = params[:is_board]
|
||||
@is_course = params[:is_course] if params[:is_course]
|
||||
@is_board = params[:is_board] if params[:is_board]
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
|
@ -282,8 +281,8 @@ class MessagesController < ApplicationController
|
|||
@message.destroy
|
||||
@topic = Message.find(params[:activity_id].to_i)
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
@is_course = params[:is_course]
|
||||
@is_board = params[:is_board]
|
||||
@is_course = params[:is_course] if params[:is_course]
|
||||
@is_board = params[:is_board] if params[:is_board]
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
|
|
|
@ -172,6 +172,8 @@ class NewsController < ApplicationController
|
|||
@news = result[:news]
|
||||
@comments = result[:comments]
|
||||
@comments_count = @comments.count
|
||||
@comments = get_no_children_comments_all @comments
|
||||
@limit_count = @comments.count
|
||||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||
@limit = 10
|
||||
@comments = @comments[@page * @limit..@page * @limit + 9]
|
||||
|
|
|
@ -41,8 +41,10 @@ class OrgDocumentCommentsController < ApplicationController
|
|||
@org_subfield = OrgSubfield.where(:id => @document.org_subfield_id).first
|
||||
@subfield_content = @organization.org_subfields.order("priority")
|
||||
all_comments = []
|
||||
@replies = get_all_children(all_comments, @document)
|
||||
@replies = OrgDocumentComment.where("root_id = #{@document.id}").reorder("created_at desc")
|
||||
@reply_count = @replies.count
|
||||
@replies = get_no_children_comments_all @replies
|
||||
@limit_count = @replies.count
|
||||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||
@limit = 10
|
||||
@replies = @replies[@page * @limit..@page * @limit + 9]
|
||||
|
|
|
@ -92,7 +92,7 @@ class SyllabusesController < ApplicationController
|
|||
def destroy
|
||||
if @syllabus && @syllabus.courses.not_deleted.empty?
|
||||
@syllabus.destroy
|
||||
redirect_to user_courselist_user_path(User.current.id)
|
||||
redirect_to user_courselist_user_path(User.current)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -171,7 +171,6 @@ class UsersController < ApplicationController
|
|||
else
|
||||
@user_activity_id = -1
|
||||
end
|
||||
@hw_status = params[:hw_status].to_i
|
||||
when 'JournalsForMessage'
|
||||
@reply = JournalsForMessage.find params[:reply_id]
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
|
@ -181,15 +180,11 @@ class UsersController < ApplicationController
|
|||
@reply = Message.find params[:reply_id]
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
@activity_id = params[:activity_id]
|
||||
@is_course = params[:is_course]
|
||||
@is_board = params[:is_board]
|
||||
@type = 'Message'
|
||||
when 'BlogComment'
|
||||
@reply = BlogComment.find params[:reply_id]
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
@activity_id = params[:activity_id]
|
||||
@homepage = params[:homepage]
|
||||
@user_id = params[:user_id]
|
||||
@type = 'BlogComment'
|
||||
when 'OrgDocumentComment'
|
||||
@reply = OrgDocumentComment.find params[:reply_id]
|
||||
|
@ -215,6 +210,96 @@ class UsersController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
#叠层回复框中的回复
|
||||
def reply_to_comment
|
||||
@type = params[:type]
|
||||
@reply = get_reply_by_type @type, params[:reply_id]
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
@is_project = params[:is_project] if params[:is_project]
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
#多级回复
|
||||
def reply_detail
|
||||
@type = params[:type]
|
||||
reply = get_reply_by_type @type, params[:reply_id]
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
case params[:type]
|
||||
when 'HomeworkCommon'
|
||||
@root = HomeworkCommon.find reply.jour_id
|
||||
options = {:notes => params[:reply_message], :reply_id => reply.user_id,:user_id => User.current.id,:m_parent_id => params[:reply_id].to_i,:m_reply_id => params[:reply_id].to_i, :root_id => reply.root_id}
|
||||
comment = HomeworkCommon.add_homework_jour(User.current, params[:reply_message], reply.jour_id, reply.root_id, options)
|
||||
@root.update_column('updated_at', Time.now)
|
||||
@is_teacher = User.current.allowed_to?(:as_teacher, @root.course) || User.current.admin?
|
||||
when 'JournalsForMessage'
|
||||
options = {:user_id => User.current.id,
|
||||
:status => true,
|
||||
:m_parent_id => params[:reply_id],
|
||||
:m_reply_id => params[:reply_id],
|
||||
:reply_id => reply.user.id,
|
||||
:notes => params[:reply_message],
|
||||
:root_id => reply.root_id,
|
||||
:is_readed => false}
|
||||
@root = reply.root
|
||||
comment = add_reply_adapter(@root, options)
|
||||
@root.update_attribute(:updated_on,Time.now)
|
||||
when 'Message'
|
||||
@root = reply.root
|
||||
comment = Message.new
|
||||
comment.author = User.current
|
||||
comment.board = reply.board
|
||||
comment.content = params[:reply_message]
|
||||
comment.subject = "RE: #{@root.subject}"
|
||||
comment.reply_id = params[:reply_id]
|
||||
comment.root_id = reply.root_id
|
||||
reply.children << comment
|
||||
@is_project = params[:is_project] if params[:is_project]
|
||||
when 'BlogComment'
|
||||
@root = reply.root
|
||||
comment = BlogComment.new
|
||||
comment.author = User.current
|
||||
comment.blog = reply.blog
|
||||
comment.title = "RE: #{@root.title}"
|
||||
comment.content = params[:reply_message]
|
||||
comment.reply_id = params[:reply_id]
|
||||
comment.root_id = reply.root_id
|
||||
reply.children << comment
|
||||
when 'OrgDocumentComment'
|
||||
@root = reply.root
|
||||
comment = OrgDocumentComment.new(:creator_id => User.current.id, :reply_id => params[:reply_id])
|
||||
comment.title = "RE:#{@root.title}"
|
||||
comment.content = params[:reply_message]
|
||||
comment.root_id = reply.root_id
|
||||
reply.children << comment
|
||||
when 'News'
|
||||
@root = News.find reply.commented_id
|
||||
comment = @root.comments.build(:author_id => User.current.id, :reply_id => params[:reply_id], :comments => params[:reply_message], :parent_id => reply.id)
|
||||
comment.save
|
||||
when 'Issue'
|
||||
@root = reply.issue
|
||||
comment = @root.journals.build(:user_id => User.current.id, :reply_id => params[:reply_id], :notes => params[:reply_message], :parent_id => reply.id)
|
||||
comment.save
|
||||
@is_project = params[:is_project] if params[:is_project]
|
||||
when 'Syllabus'
|
||||
@root = Syllabus.find reply.jour_id
|
||||
options = {:notes => params[:reply_message], :reply_id => reply.user_id,:user_id => User.current.id,:m_parent_id => params[:reply_id].to_i,:m_reply_id => params[:reply_id].to_i, :root_id => reply.root_id}
|
||||
comment = Syllabus.add_syllabus_jour(User.current, params[:reply_message], reply.jour_id, reply.root_id, options)
|
||||
@root.update_column('updated_at', Time.now)
|
||||
@count = @root.journals_for_messages.count
|
||||
@comments = @root.journals_for_messages.reorder("created_on desc").limit(3)
|
||||
end
|
||||
update_course_activity(@root.class.to_s,@root.id)
|
||||
update_user_activity(@root.class.to_s,@root.id)
|
||||
update_forge_activity(@root.class.to_s,@root.id)
|
||||
update_org_activity(@root.class.to_s,@root.id)
|
||||
update_principal_activity(@root.class.to_s,@root.id)
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def refresh_changests
|
||||
if !(@user.nil?) && !(@user.memberships.nil?)
|
||||
@user.memberships.each do |member|
|
||||
|
@ -3398,7 +3483,11 @@ class UsersController < ApplicationController
|
|||
|
||||
@my_syllabuses = @user.syllabuses
|
||||
|
||||
my_syllabus_ids = @my_syllabuses.empty? ? "(-1)" : "(" + @my_syllabuses.map{|syllabus| syllabus.id}.join(',') + ")"
|
||||
if @user == User.current
|
||||
archive_ids = Course.where("tea_id = #{@user.id} and is_delete = 1").blank? ? "(-1)" : "(" + Course.where("tea_id = #{@user.id} and is_delete = 1").map{|course| course.syllabus_id}.join(",") + ")"
|
||||
@archive_syllabuses = Syllabus.where("id in #{archive_ids}")
|
||||
end
|
||||
|
||||
sy_courses = @user.courses.visible.not_deleted
|
||||
syllabus_ids = sy_courses.empty? ? '(-1)' : "(" + sy_courses.map{|course| !course.syllabus_id.nil? && course.syllabus_id}.join(",") + ")"
|
||||
syllabus_members = SyllabusMember.where("user_id = #{@user.id}")
|
||||
|
@ -3470,11 +3559,58 @@ class UsersController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
#归档班级列表
|
||||
def user_archive_courses
|
||||
if User.current.logged?
|
||||
@order, @c_sort, @type = params[:order] || 1, params[:sort] || 1, params[:type] || 1
|
||||
|
||||
#确定 sort_type
|
||||
if @order.to_i == @type.to_i
|
||||
@c_sort = @c_sort.to_i == 1 ? 2 : 1 #1升序 2降序
|
||||
else
|
||||
@c_sort = 2
|
||||
end
|
||||
|
||||
@user = User.current
|
||||
sort_name = "updated_at"
|
||||
archive_ids = Course.where("tea_id = #{@user.id} and is_delete = 1").blank? ? "(-1)" : "(" + Course.where("tea_id = #{@user.id} and is_delete = 1").map{|course| course.syllabus_id}.join(",") + ")"
|
||||
@archive_syllabuses = Syllabus.where("id in #{archive_ids}")
|
||||
|
||||
if @order.to_i == 1 #根据 班级更新时间排序
|
||||
@archive_syllabuses = syllabus_course_list_sort @archive_syllabuses
|
||||
@c_sort == 1 ? (@archive_syllabuses = @archive_syllabuses.sort{|x,y| x[:last_update] <=> y[:last_update] }) : (@archive_syllabuses = @archive_syllabuses.sort{|x,y| y[:last_update] <=> x[:last_update]})
|
||||
@type = 1
|
||||
elsif @order.to_i == 2 #根据 作业+资源数排序
|
||||
@type = 2
|
||||
@archive_syllabuses.each do |syllabus|
|
||||
count = 0
|
||||
courses = syllabus.courses.not_deleted
|
||||
courses.each do |c|
|
||||
count += (User.current.admin? || User.current.allowed_to?(:as_teacher,c)) ? (c.homework_commons.count + visable_attachemnts_incourse(c).count) : (c.homework_commons.where("publish_time <= '#{Date.today}'").count + visable_attachemnts_incourse(c).count)
|
||||
end
|
||||
syllabus[:infocount] = count
|
||||
end
|
||||
@c_sort == 1 ? (@archive_syllabuses = @archive_syllabuses.sort{|x,y| x[:infocount] <=> y[:infocount] }) : (@archive_syllabuses = @archive_syllabuses.sort{|x,y| y[:infocount] <=> x[:infocount]})
|
||||
@archive_syllabuses = sortby_time_countcommon_nosticky @archive_syllabuses,sort_name
|
||||
else
|
||||
@type = 1
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html {render :layout => 'new_base_user'}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#展开课程下的班级
|
||||
def expand_courses
|
||||
@syllabus = Syllabus.where("id = #{params[:syllabus_id]}").first
|
||||
unless @syllabus.nil?
|
||||
@courses = @syllabus.courses.not_deleted.select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc")
|
||||
if params[:is_delete] && params[:is_delete] == '1'
|
||||
@courses = @syllabus.courses.where("is_delete = 1").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc")
|
||||
else
|
||||
@courses = @syllabus.courses.not_deleted.select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc")
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
|
@ -3567,18 +3703,12 @@ class UsersController < ApplicationController
|
|||
if params[:type].present?
|
||||
case params[:type]
|
||||
when 'OrgDocumentComment'
|
||||
#obj = OrgDocumentComment.where('id = ?', params[:id].to_i).first
|
||||
@user_activity_id = params[:div_id].to_i if params[:div_id]
|
||||
@type = 'OrgDocumentComment'
|
||||
#comments = []
|
||||
@journals = OrgDocumentComment.where("root_id = #{params[:id].to_i}").reorder("created_at desc")
|
||||
when 'Message','is_project_message'
|
||||
#obj = Message.where('id = ?', params[:id].to_i).first
|
||||
@type = 'Message'
|
||||
@is_course = params[:is_course]
|
||||
@is_board = params[:is_board]
|
||||
@user_activity_id = params[:div_id].to_i if params[:div_id]
|
||||
#comments = []
|
||||
@journals = Message.where("root_id = #{params[:id].to_i}").reorder("created_on desc")
|
||||
when 'News'
|
||||
obj = News.where('id = ?', params[:id].to_i).first
|
||||
|
@ -3591,8 +3721,6 @@ class UsersController < ApplicationController
|
|||
@type = 'Syllabus'
|
||||
@user_activity_id = params[:div_id].to_i if params[:div_id]
|
||||
when 'JournalsForMessage'
|
||||
#obj = JournalsForMessage.where('id = ?', params[:id].to_i).first
|
||||
#journals = []
|
||||
@journals = JournalsForMessage.where("root_id = #{params[:id].to_i}").reorder("created_on desc")
|
||||
@type = 'JournalsForMessage'
|
||||
@user_activity_id = params[:div_id].to_i if params[:div_id]
|
||||
|
@ -3609,20 +3737,17 @@ class UsersController < ApplicationController
|
|||
when 'BlogComment'
|
||||
obj = BlogComment.where('id = ?', params[:id].to_i).first
|
||||
@user_activity_id = params[:div_id].to_i if params[:div_id]
|
||||
@homepage = params[:homepage].to_i
|
||||
@type = 'BlogComment'
|
||||
@user_id = obj.author_id
|
||||
#comments = []
|
||||
@journals = BlogComment.where("root_id = #{params[:id].to_i}").reorder("created_on desc")
|
||||
when 'HomeworkCommon'
|
||||
obj = HomeworkCommon.where('id = ?', params[:id].to_i).first
|
||||
@type = 'HomeworkCommon'
|
||||
@journals = obj.journals_for_messages.reorder("created_on desc")
|
||||
@hw_status = params[:hw_status].to_i if params[:hw_status]
|
||||
@is_teacher = User.current.allowed_to?(:as_teacher,obj.course)
|
||||
@user_activity_id = params[:user_activity_id].to_i if params[:user_activity_id]
|
||||
end
|
||||
end
|
||||
@journals = get_no_children_comments_all @journals
|
||||
end
|
||||
|
||||
def homepage
|
||||
|
|
|
@ -116,7 +116,7 @@ class WordsController < ApplicationController
|
|||
else
|
||||
@user_activity_id = -1
|
||||
end
|
||||
@hw_status = params[:hw_status].to_i
|
||||
@hw_status = params[:hw_status].to_i if
|
||||
@is_teacher = User.current.allowed_to?(:as_teacher, @homework.course) || User.current.admin?
|
||||
elsif @journal_destroyed.jour_type == 'Syllabus'
|
||||
@syllabus = Syllabus.find @journal_destroyed.jour_id
|
||||
|
@ -315,7 +315,7 @@ class WordsController < ApplicationController
|
|||
respond_to do |format|
|
||||
format.js{
|
||||
@user_activity_id = params[:user_activity_id].to_i
|
||||
@hw_status = params[:hw_status].to_i
|
||||
@hw_status = params[:hw_status].to_i if params[:hw_status]
|
||||
@is_teacher = User.current.allowed_to?(:as_teacher, @homework_common.course) || User.current.admin?
|
||||
}
|
||||
end
|
||||
|
@ -349,7 +349,7 @@ class WordsController < ApplicationController
|
|||
respond_to do |format|
|
||||
format.js{
|
||||
@user_activity_id = params[:user_activity_id].to_i
|
||||
@hw_status = params[:hw_status].to_i
|
||||
@hw_status = params[:hw_status].to_i if params[:hw_status]
|
||||
@is_teacher = User.current.allowed_to?(:as_teacher, @homework_common.course) || User.current.admin?
|
||||
}
|
||||
end
|
||||
|
@ -454,45 +454,5 @@ class WordsController < ApplicationController
|
|||
end
|
||||
obj
|
||||
end
|
||||
|
||||
def add_reply_adapter obj, options
|
||||
#modify by nwb
|
||||
#添加对课程留言的支持
|
||||
#留言回复应该不关系其所属的Class,而关心的是其所属的父留言
|
||||
case obj.jour_type
|
||||
when 'Principal'
|
||||
obj.jour.add_jour(nil, nil, nil, options)
|
||||
when 'Project'
|
||||
Project.add_new_jour(nil, nil, obj.jour_id, options)
|
||||
when 'Course'
|
||||
Course.add_new_jour(nil, nil, obj.jour_id, options)
|
||||
when 'Bid'
|
||||
obj.jour.add_jour(nil, nil, nil, options)
|
||||
when 'Contest'
|
||||
obj.jour.add_jour(nil, nil, obj.jour_id, options)
|
||||
when 'Softapplication'
|
||||
obj.jour.add_jour(nil, nil, obj.jour_id, options)
|
||||
when 'HomeworkAttach'
|
||||
obj.jour.add_jour(nil, nil, obj.jour_id, options)
|
||||
end
|
||||
# obj = obj_distinguish_url_origin || User.find_by_id(2)
|
||||
# if obj.kind_of? User
|
||||
# obj.add_jour(nil, nil, nil, options)
|
||||
# elsif obj.kind_of? Project
|
||||
# Project.add_new_jour(nil, nil, obj.id, options)
|
||||
# elsif obj.kind_of? Course
|
||||
# Course.add_new_jour(nil, nil, obj.id, options)
|
||||
# elsif obj.kind_of? Bid
|
||||
# obj.add_jour(nil, nil, nil, options)
|
||||
# elsif obj.kind_of? Contest
|
||||
# obj.add_jour(nil, nil, obj.id, options) #new added
|
||||
# elsif obj.kind_of? Softapplication
|
||||
# obj.add_jour(nil, nil, obj.id, options) #new added
|
||||
# elsif obj.kind_of? HomeworkAttach
|
||||
# obj.add_jour(nil, nil, obj.id, options) #new added
|
||||
# else
|
||||
# raise "create reply obj unknow type.#{obj.class}"
|
||||
# end
|
||||
end
|
||||
#######end of message
|
||||
end
|
||||
|
|
|
@ -3394,6 +3394,61 @@ def secdomain_with_protocol secdomain
|
|||
return Setting.protocol + "://" + secdomain + ".trustie.net"
|
||||
end
|
||||
|
||||
#根据回复类型获取回复
|
||||
def get_reply_by_type type, reply_id
|
||||
reply = nil
|
||||
case type
|
||||
when 'HomeworkCommon'
|
||||
reply = JournalsForMessage.find reply_id
|
||||
when 'JournalsForMessage'
|
||||
reply = JournalsForMessage.find reply_id
|
||||
when 'Message'
|
||||
reply = Message.find reply_id
|
||||
when 'BlogComment'
|
||||
reply = BlogComment.find reply_id
|
||||
when 'OrgDocumentComment'
|
||||
reply = OrgDocumentComment.find reply_id
|
||||
when 'News'
|
||||
reply = Comment.find reply_id
|
||||
when 'Issue'
|
||||
reply = Journal.find reply_id
|
||||
when 'Syllabus'
|
||||
reply = JournalsForMessage.find reply_id
|
||||
end
|
||||
reply
|
||||
end
|
||||
|
||||
#获取不包含子节点的回复(前三个)
|
||||
def get_no_children_comments comments
|
||||
result = {}
|
||||
no_children_comments = []
|
||||
count = 0
|
||||
three_more = false
|
||||
comments.each do |comment|
|
||||
if comment.children.blank?
|
||||
count = count + 1
|
||||
if count > 3
|
||||
three_more = true
|
||||
end
|
||||
break if count > 3
|
||||
no_children_comments << comment
|
||||
end
|
||||
end
|
||||
result[:three_more] = three_more
|
||||
result[:no_children_comments] = no_children_comments
|
||||
result
|
||||
end
|
||||
|
||||
#获取不包含子节点的回复(所有)
|
||||
def get_no_children_comments_all comments
|
||||
no_children_comments = []
|
||||
comments.each do |comment|
|
||||
if comment.children.blank?
|
||||
no_children_comments << comment
|
||||
end
|
||||
end
|
||||
no_children_comments
|
||||
end
|
||||
|
||||
#获取回复的所有父节点
|
||||
def get_reply_parents parents_rely, comment
|
||||
|
@ -3746,3 +3801,43 @@ def homework_type_option
|
|||
type
|
||||
end
|
||||
|
||||
def add_reply_adapter obj, options
|
||||
#modify by nwb
|
||||
#添加对课程留言的支持
|
||||
#留言回复应该不关系其所属的Class,而关心的是其所属的父留言
|
||||
case obj.jour_type
|
||||
when 'Principal'
|
||||
obj.jour.add_jour(nil, nil, nil, options)
|
||||
when 'Project'
|
||||
Project.add_new_jour(nil, nil, obj.jour_id, options)
|
||||
when 'Course'
|
||||
Course.add_new_jour(nil, nil, obj.jour_id, options)
|
||||
#when 'Bid'
|
||||
# obj.jour.add_jour(nil, nil, nil, options)
|
||||
#when 'Contest'
|
||||
# obj.jour.add_jour(nil, nil, obj.jour_id, options)
|
||||
#when 'Softapplication'
|
||||
# obj.jour.add_jour(nil, nil, obj.jour_id, options)
|
||||
#when 'HomeworkAttach'
|
||||
# obj.jour.add_jour(nil, nil, obj.jour_id, options)
|
||||
end
|
||||
# obj = obj_distinguish_url_origin || User.find_by_id(2)
|
||||
# if obj.kind_of? User
|
||||
# obj.add_jour(nil, nil, nil, options)
|
||||
# elsif obj.kind_of? Project
|
||||
# Project.add_new_jour(nil, nil, obj.id, options)
|
||||
# elsif obj.kind_of? Course
|
||||
# Course.add_new_jour(nil, nil, obj.id, options)
|
||||
# elsif obj.kind_of? Bid
|
||||
# obj.add_jour(nil, nil, nil, options)
|
||||
# elsif obj.kind_of? Contest
|
||||
# obj.add_jour(nil, nil, obj.id, options) #new added
|
||||
# elsif obj.kind_of? Softapplication
|
||||
# obj.add_jour(nil, nil, obj.id, options) #new added
|
||||
# elsif obj.kind_of? HomeworkAttach
|
||||
# obj.add_jour(nil, nil, obj.id, options) #new added
|
||||
# else
|
||||
# raise "create reply obj unknow type.#{obj.class}"
|
||||
# end
|
||||
end
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=comment.id%>').show();" onmouseout="$('#delete_reply_<%=comment.id%>').hide();">
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => comment, :type => 'BlogComment', :user_activity_id => @article.id}%>
|
||||
|
||||
<% if !comment.content_detail.blank? %>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
|
@ -52,7 +52,7 @@
|
|||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if @reply_count > @page * @limit + 10 %>
|
||||
<% if @limit_count > @page * @limit + 10 %>
|
||||
<div id="more_blog_replies">
|
||||
<div class="detail_cont_hide clearfix">
|
||||
<span class="orig_icon" >↓ </span>
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<% if @in_user_homepage %>
|
||||
<% homepage = BlogComment.find(@user.blog.homepage_id) %>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'blogs/homepage', :locals => {:activity => @blog_comment, :user_activity_id => homepage.id}) %>");
|
||||
<% else%>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @blog_comment,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% end %>
|
||||
<%# if @in_user_homepage %>
|
||||
<%# homepage = BlogComment.find(@user.blog.homepage_id) %>
|
||||
//$("#user_activity_<%#= @user_activity_id%>").replaceWith("<%#= escape_javascript(render :partial => 'blogs/homepage', :locals => {:activity => @blog_comment, :user_activity_id => homepage.id}) %>");
|
||||
<%# else%>
|
||||
//$("#user_activity_<%#= @user_activity_id%>").replaceWith("<%#= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @blog_comment,:user_activity_id =>@user_activity_id}) %>");
|
||||
<%# end %>
|
||||
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/user_blog_post_reply', :locals => {:activity => @blog_comment,:user_activity_id =>@user_activity_id}) %>");
|
||||
sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", 'UserActivity');
|
|
@ -1,11 +1,12 @@
|
|||
<% if @in_user_homepage %>
|
||||
<% homepage = BlogComment.find(@user.blog.homepage_id) %>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id}) %>");
|
||||
<% elsif @in_user_center%>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
|
||||
<%# if @in_user_homepage %>
|
||||
<%# homepage = BlogComment.find(@user.blog.homepage_id) %>
|
||||
//$("#user_activity_<%#= @user_activity_id%>").replaceWith("<%#= escape_javascript(render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id}) %>");
|
||||
<%# elsif @in_user_center%>
|
||||
//$("#user_activity_<%#= @user_activity_id%>").replaceWith("<%#= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
|
||||
// init_activity_KindEditor_data(<%#= @user_activity_id%>,"","87%", 'UserActivity');
|
||||
<% else%>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
|
||||
<%# else%>
|
||||
//$("#user_activity_<%#= @user_activity_id%>").replaceWith("<%#= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
|
||||
//init_activity_KindEditor_data(<%#= @user_activity_id%>,"","87%", 'UserActivity');
|
||||
<% end %>
|
||||
<%# end %>
|
||||
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/user_blog_post_reply', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
|
||||
sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", 'UserActivity');
|
|
@ -109,9 +109,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% all_comments = []%>
|
||||
<% all_replies = BlogComment.where("root_id = #{@article.id}").reorder("created_on desc") %>
|
||||
<% count= all_replies.count %>
|
||||
|
||||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复
|
||||
|
@ -124,7 +122,6 @@
|
|||
<div class="homepagePostReplyBannerTime"></div>
|
||||
</div>
|
||||
|
||||
<%# comments = all_replies %>
|
||||
<% if @reply_count > 0 %>
|
||||
<div class="" id="reply_div_<%= @article.id %>">
|
||||
<%= render :partial => 'blog_comment_show_replies' %>
|
||||
|
|
|
@ -45,16 +45,15 @@
|
|||
<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>
|
||||
</div>
|
||||
<% all_comments = []%>
|
||||
<% all_repies = BlogComment.where("root_id = #{activity.id}").reorder("created_on desc") %>
|
||||
<% count = all_repies.count %>
|
||||
<% no_children_comments = get_no_children_comments all_repies %>
|
||||
<div class="homepagePostReply">
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :homepage => 1} %>
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :homepage => 1, :expand_more =>no_children_comments[:three_more]} %>
|
||||
|
||||
<% comments = all_repies[0..2] %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'BlogComment', :activity_id =>activity.id, :homepage => 1, :user_id => activity.author_id}%>
|
||||
<%= render :partial => 'users/message_replies', :locals => {:comments => no_children_comments[:no_children_comments], :user_activity_id => user_activity_id, :type => 'BlogComment', :activity_id =>activity.id, :homepage => 1, :user_id => activity.author_id}%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<% if @news.project_id && @news.project_id != -1 %>
|
||||
$("#user_activity_<%= @user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'projects/project_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% elsif @news.course_id %>
|
||||
$("#user_activity_<%= @user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'users/course_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||
$("#activity_post_reply_<%= @user_activity_id %>").html("<%= escape_javascript(render :partial => 'users/course_news_post_reply', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% elsif @news.org_subfield_id %>
|
||||
$("#user_activity_<%= @user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_subfield_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% end %>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<% if @news.project_id && @news.project_id != -1 %>
|
||||
$("#user_activity_<%= @user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'projects/project_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% elsif @news.course_id %>
|
||||
$("#user_activity_<%= @user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'users/course_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||
$("#activity_post_reply_<%= @user_activity_id %>").html("<%= escape_javascript(render :partial => 'users/course_news_post_reply', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% elsif @news.org_subfield_id %>
|
||||
$("#user_activity_<%= @user_activity_id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_subfield_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% end %>
|
||||
|
|
|
@ -13,5 +13,11 @@ function click_OK(){
|
|||
hideModal();
|
||||
<% if params[:source] == "1" %>
|
||||
window.location.href = "<%=syllabus_courselist_syllabus_path(@syllabus, :list_type => params[:type].to_i) %>";
|
||||
<% elsif params[:source] == "0" %>
|
||||
<% if params[:type] == "0" %>
|
||||
window.location.href = "<%=user_courselist_user_path(User.current) %>";
|
||||
<% else %>
|
||||
window.location.href = "<%=user_archive_courses_users_path() %>";
|
||||
<% end %>
|
||||
<% end %>
|
||||
}
|
|
@ -1,5 +1,9 @@
|
|||
<% if params[:group_id] != "0" %>
|
||||
$("#member_li_<%=@member.id %>").html("");
|
||||
var all_indexes = $("#member_li_<%=@member.id %>").nextAll().find("td:first-child");
|
||||
for(var i = 0; i < all_indexes.length; i++){
|
||||
$(all_indexes[i]).html(parseInt($(all_indexes[i]).html()) - 1);
|
||||
}
|
||||
$("#member_li_<%=@member.id %>").remove();
|
||||
<% end %>
|
||||
<% if @group && @group != "-1" %>
|
||||
//$("#member_content").html("<%#= escape_javascript( render :partial => 'new_member_list', :locals => {:members => @results})%>");
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33"), user_path(comment.user_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=comment.id %>').show();" onmouseout="$('#delete_reply_<%=comment.id %>').hide();">
|
||||
<%= render :partial => 'users/news_contents', :locals => {:comment => comment}%>
|
||||
<%= render :partial => 'users/news_contents', :locals => {:comment => comment, :type => 'Issue', :user_activity_id => issue.id}%>
|
||||
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
<% if comment.details.any? %>
|
||||
|
|
|
@ -140,25 +140,25 @@
|
|||
|
||||
<div class="subNavBox ">
|
||||
<div class="subNav ">
|
||||
<a href="<%=url_for(:controller => 'users', :action => 'show',:id=>@user.id)%>" class=" f14 c_blue02">
|
||||
<a href="<%=url_for(:controller => 'users', :action => 'show',:id=>@user)%>" class=" f14 c_blue02">
|
||||
动态
|
||||
</a>
|
||||
</div>
|
||||
<% if @center_flag %>
|
||||
<div class="subNav">
|
||||
<a href="<%=url_for(:controller => 'users', :action => 'user_courselist',:id=>@user.id)%>" class=" f14 c_blue02">
|
||||
<a href="<%=url_for(:controller => 'users', :action => 'user_courselist',:id=>@user)%>" class=" f14 c_blue02">
|
||||
我的课程
|
||||
<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.courses.count%>)</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="subNav">
|
||||
<a href="<%=url_for(:controller => 'users', :action => 'user_projectlist',:id=>@user.id)%>" class=" f14 c_blue02">
|
||||
<a href="<%=url_for(:controller => 'users', :action => 'user_projectlist',:id=>@user)%>" class=" f14 c_blue02">
|
||||
我的项目
|
||||
<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.projects.count%>)</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="subNav">
|
||||
<a href="<%=url_for(:controller => 'users', :action => 'user_resource',:id=>@user.id,:type=>1)%>" class=" f14 c_blue02">
|
||||
<a href="<%=url_for(:controller => 'users', :action => 'user_resource',:id=>@user,:type=>1)%>" class=" f14 c_blue02">
|
||||
我的资源库
|
||||
<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=Attachment.where("(author_id = #{@user.id} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) or (container_type = 'Course' and container_id in (#{@user.courses.map{|c| c.id}.empty? ? '0' : @user.courses.map{|c| c.id}.join(',')}))").count%>)</span>
|
||||
</a>
|
||||
|
@ -166,13 +166,13 @@
|
|||
|
||||
<% else%>
|
||||
<div class="subNav">
|
||||
<a href="<%=url_for(:controller => 'users', :action => 'user_courselist',:id=>@user.id)%>" class=" f14 c_blue02">
|
||||
<a href="<%=url_for(:controller => 'users', :action => 'user_courselist',:id=>@user)%>" class=" f14 c_blue02">
|
||||
TA的课程
|
||||
<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.courses.visible.count%>)</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="subNav">
|
||||
<a href="<%=url_for(:controller => 'users', :action => 'user_projectlist',:id=>@user.id)%>" class=" f14 c_blue02">
|
||||
<a href="<%=url_for(:controller => 'users', :action => 'user_projectlist',:id=>@user)%>" class=" f14 c_blue02">
|
||||
TA的项目
|
||||
<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.projects.visible.count%>)</span>
|
||||
</a>
|
||||
|
|
|
@ -162,8 +162,8 @@
|
|||
<% if hidden_unproject_infos %>
|
||||
<ul class="users_accordion mb10">
|
||||
<li id="user_01" class="user_icons_course">
|
||||
<%= link_to '班级',{:controller => "users", :action => "user_courselist", :id => @user.id}, :id => "user_course_list" %>
|
||||
<font class="show-all-sub"><%= link_to '全部',{:controller => "users", :action => "user_courselist", :id => @user.id}, :style => "color:#aaa;" %></font>
|
||||
<%= link_to '班级',{:controller => "users", :action => "user_courselist", :id => @user}, :id => "user_course_list" %>
|
||||
<font class="show-all-sub"><%= link_to '全部',{:controller => "users", :action => "user_courselist", :id => @user}, :style => "color:#aaa;" %></font>
|
||||
<% courses = @user.favorite_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(10) %>
|
||||
<div class="<%= courses.empty? ? 'none' : ''%>" id="homepage_left_course_list">
|
||||
<%=render :partial => 'layouts/homepage_left_course_list', :locals => {:courses => courses} %>
|
||||
|
@ -181,7 +181,7 @@
|
|||
</li>
|
||||
<% if @user == User.current %>
|
||||
<li id="user_05" class="user_icons_myhw">
|
||||
<%=link_to '我的作业', my_homeworks_user_path(@user.id), :target => "_blank", :style => "font-size:14px;" %>
|
||||
<%=link_to '我的作业', my_homeworks_user_path(@user), :target => "_blank", :style => "font-size:14px;" %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
@ -190,8 +190,8 @@
|
|||
|
||||
<ul class="users_accordion mb10">
|
||||
<li id="user_06" class="user_icons_project">
|
||||
<%= link_to '项目',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :id => 'user_project_list'%>
|
||||
<font class="show-all-sub"><%= link_to '全部',{:controller => "users", :action => "user_projectlist", :id => @user.id}, :style => "color:#aaa;" %></font>
|
||||
<%= link_to '项目',{:controller => "users", :action => "user_projectlist", :id => @user}, :id => 'user_project_list'%>
|
||||
<font class="show-all-sub"><%= link_to '全部',{:controller => "users", :action => "user_projectlist", :id => @user}, :style => "color:#aaa;" %></font>
|
||||
<% projects = @user.favorite_projects.visible.select("projects.*, (SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(10)%>
|
||||
<div class="<%= projects.empty? ? 'none' : ''%>" id="homepage_left_project_list">
|
||||
<%=render :partial => 'layouts/homepage_left_project_list', :locals => {:projects => projects} %>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=reply.id %>').show();" onmouseout="$('#delete_reply_<%=reply.id %>').hide();">
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => reply}%>
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => reply, :type => 'Message', :user_activity_id => @topic.id}%>
|
||||
|
||||
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
|
||||
<%= reply.content.html_safe%>
|
||||
|
@ -49,7 +49,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if @reply_count > @page * @limit + 10 %>
|
||||
<% if @limit_count > @page * @limit + 10 %>
|
||||
<div id="more_message_replies">
|
||||
<div class="detail_cont_hide clearfix">
|
||||
<span class="orig_icon" >↓ </span>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33, :height => 33), user_path(reply.author) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => reply} %>
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => reply, :type => 'Message', :user_activity_id => @topic.id} %>
|
||||
|
||||
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
|
||||
<%= reply.content.html_safe %>
|
||||
|
@ -48,7 +48,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if @reply_count > @page * @limit + 10 %>
|
||||
<% if @limit_count > @page * @limit + 10 %>
|
||||
<div id="more_message_replies">
|
||||
<div class="detail_cont_hide clearfix">
|
||||
<span class="orig_icon" >↓ </span>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
|
||||
</div>
|
||||
<div class="reply-content ml15" onmouseover="$('#delete_reply_<%=reply.id %>').show();" onmouseout="$('#delete_reply_<%=reply.id %>').hide();">
|
||||
<%= render :partial => 'projects/project_message_contents', :locals => {:comment => reply}%>
|
||||
<%= render :partial => 'projects/project_message_contents', :locals => {:comment => reply, :user_activity_id => @topic.id}%>
|
||||
|
||||
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
|
||||
<%= reply.content.html_safe%>
|
||||
|
@ -49,7 +49,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if @reply_count > @page * @limit + 10 %>
|
||||
<% if @limit_count > @page * @limit + 10 %>
|
||||
<div id="more_message_replies">
|
||||
<div class="detail_cont_hide clearfix">
|
||||
<span class="orig_icon" >↓ </span>
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
<% if params[:is_project] %>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'projects/act_messages', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id,:is_course=>@is_course,:is_board=>@is_board}) %>");
|
||||
<% else %>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/project_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id,:is_course=>@is_course,:is_board=>@is_board}) %>");
|
||||
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/course_message_post_reply', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% end %>
|
||||
|
||||
<%elsif @course%>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id,:is_course=>@is_course,:is_board=>@is_board}) %>");
|
||||
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/course_message_post_reply', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% elsif @org_subfield %>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_subfield_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>");
|
||||
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'organizations/org_message_post_reply', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>");
|
||||
<%end%>
|
||||
sd_create_editor_from_data(<%= @user_activity_id %>,"","100%", "UserActivity");
|
|
@ -2,12 +2,12 @@
|
|||
<% if params[:is_project] %>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'projects/act_messages', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id,:is_course=>@is_course,:is_board=>@is_board}) %>");
|
||||
<% else %>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/project_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id,:is_course=>@is_course,:is_board=>@is_board}) %>");
|
||||
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/course_message_post_reply', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% end %>
|
||||
|
||||
<%elsif @course%>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id,:is_course=>@is_course,:is_board=>@is_board}) %>");
|
||||
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/course_message_post_reply', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% elsif @org_subfield %>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_subfield_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>");
|
||||
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'organizations/org_message_post_reply', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>");
|
||||
<%end%>
|
||||
sd_create_editor_from_data(<%= @user_activity_id %>,"","100%", "UserActivity");
|
|
@ -10,7 +10,7 @@
|
|||
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=comment.id %>').show();" onmouseout="$('#delete_reply_<%=comment.id %>').hide();">
|
||||
<%= render :partial => 'users/news_contents', :locals => {:comment => comment}%>
|
||||
<%= render :partial => 'users/news_contents', :locals => {:comment => comment, :type => 'News', :user_activity_id => @news.id}%>
|
||||
|
||||
<% if !comment.content_detail.blank? %>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
|
@ -52,7 +52,7 @@
|
|||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if @comments_count > @page * @limit + 10 %>
|
||||
<% if @limit_count > @page * @limit + 10 %>
|
||||
<div id="more_news_replies">
|
||||
<div class="detail_cont_hide clearfix">
|
||||
<span class="orig_icon" >↓ </span>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=comment.id%>').show();" onmouseout="$('#delete_reply_<%=comment.id%>').hide();">
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => comment, :type => 'OrgDocumentComment', :user_activity_id => @document.id}%>
|
||||
|
||||
<% if !comment.content_detail.blank? %>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
|
@ -53,7 +53,7 @@
|
|||
</li>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if @reply_count > @page * @limit + 10 %>
|
||||
<% if @limit_count > @page * @limit + 10 %>
|
||||
<div id="more_document_replies">
|
||||
<div class="detail_cont_hide clearfix">
|
||||
<span class="orig_icon" >↓ </span>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//location.reload();
|
||||
<% if @act %>
|
||||
$("#organization_document_<%= @document.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document,:flag => 2, :act => @act}) %>");
|
||||
$("#activity_post_reply_<%= @act.id %>").html("<%= escape_javascript(render :partial => 'organizations/org_document_post_reply', :locals => {:activity => @document, :user_activity_id => @act.id}) %>");
|
||||
sd_create_editor_from_data(<%= @act.id %>,"","100%", "<%=@act.class.to_s%>");
|
||||
<% elsif params[:detail_page] %>
|
||||
window.location.href = '<%= organization_path(params[:organization_id],:org_subfield_id => @org_sub_id )%>';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<% if @user_activity_id %>
|
||||
$("#organization_document_<%= @document.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document,:flag => 2, :act => @act}) %>");
|
||||
$("#activity_post_reply_<%= @user_activity_id %>").html("<%= escape_javascript(render :partial => 'organizations/org_document_post_reply', :locals => {:activity => @document, :user_activity_id => @user_activity_id}) %>");
|
||||
<% end %>
|
||||
sd_create_editor_from_data(<%= @act.id %>,"","100%", "<%=@act.class.to_s%>");
|
||||
|
|
|
@ -74,9 +74,6 @@
|
|||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% all_comments = []%>
|
||||
<% all_replies = OrgDocumentComment.where("root_id = #{@document.id}").reorder("created_at desc") %>
|
||||
<% count = all_replies.count %>
|
||||
|
||||
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= @document.id %>">
|
||||
<%# if count > 0 %>
|
||||
|
@ -89,7 +86,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<%# comments = all_replies %>
|
||||
<div class="" id="reply_div_<%= @document.id %>">
|
||||
<%= render :partial => "document_show_replies" %>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
<% all_replies = OrgDocumentComment.where("root_id = #{activity.id}").reorder("created_at desc") %>
|
||||
<% count = all_replies.count %>
|
||||
<% no_children_comments = get_no_children_comments all_replies %>
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :expand_more =>no_children_comments[:three_more]} %>
|
||||
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/message_replies', :locals => {:comments => no_children_comments[:no_children_comments], :user_activity_id => user_activity_id, :type => 'OrgDocumentComment', :activity_id =>activity.id}%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id %>">
|
||||
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_url_in_org(User.current.id) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= user_activity_id %>' style="display:none;">
|
||||
<%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => activity.id, :act_id => user_activity_id, :flag => 2), :method => "post", :remote => true) do |f| %>
|
||||
<div nhname='toolbar_container_<%= user_activity_id %>'></div>
|
||||
<textarea placeholder="有问题或建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id %>' name="org_content"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id %>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;line-height:18px;">发送</a>
|
||||
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id %>'></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "users/show_unlogged" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
|
@ -0,0 +1,35 @@
|
|||
<% all_replies = Message.where("root_id = #{activity.id}").reorder("created_on desc") %>
|
||||
<% count = all_replies.count %>
|
||||
<% no_children_comments = get_no_children_comments all_replies %>
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :expand_more =>no_children_comments[:three_more]} %>
|
||||
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/message_replies', :locals => {:comments => no_children_comments[:no_children_comments], :user_activity_id => user_activity_id, :type => 'Message', :activity_id =>activity.id}%>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if !activity.locked? && authorize_for_course('messages', 'reply') %>
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "users/show_unlogged" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
|
@ -69,42 +69,11 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% all_comments = []%>
|
||||
<% all_replies = OrgDocumentComment.where("root_id = #{activity.id}").reorder("created_at desc") %>
|
||||
<% count = all_replies.count %>
|
||||
|
||||
<div class="homepagePostReply">
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id,:is_course => 0,:is_board =>0} %>
|
||||
|
||||
<% comments = all_replies[0..2] %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'Message', :activity_id =>activity.id, :is_course => 0, :is_board =>0}%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_url_in_org(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id,:is_course => 0, :is_board => 0},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "users/show_unlogged" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div id="activity_post_reply_<%=user_activity_id %>">
|
||||
<%=render :partial => 'organizations/org_message_post_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -55,37 +55,10 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% count=activity.comments.count %>
|
||||
|
||||
<div class="homepagePostReply">
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
|
||||
|
||||
<% comments = activity.comments.reorder("created_on desc").limit(3) %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/news_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'News', :activity_id => activity.id} %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_url_in_org(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "users/show_unlogged" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div id="activity_post_reply_<%=user_activity_id %>">
|
||||
<%=render :partial => 'users/course_news_post_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -67,41 +67,10 @@
|
|||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% all_comments = []%>
|
||||
<% all_replies = OrgDocumentComment.where("root_id = #{document.id}").reorder("created_at desc") %>
|
||||
<% count = all_replies.count %>
|
||||
|
||||
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= document.id %>">
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => document, :user_activity_id => act.id} %>
|
||||
|
||||
<% comments = all_replies[0..2] %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= act.id %>">
|
||||
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => act.id, :type => 'OrgDocumentComment', :activity_id =>document.id}%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= act.id %>">
|
||||
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_url_in_org(User.current.id) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= act.id %>' style="display:none;">
|
||||
<%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id, :act_id => act.id, :flag => flag), :method => "post", :remote => true) do |f| %>
|
||||
<div nhname='toolbar_container_<%= act.id %>'></div>
|
||||
<textarea placeholder="有问题或建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= act.id %>' name="org_content"></textarea>
|
||||
<a id="new_message_submit_btn_<%= act.id %>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;line-height:18px;">发送</a>
|
||||
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= act.id %>'></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "users/show_unlogged" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div id="activity_post_reply_<%=act.id %>">
|
||||
<%=render :partial => 'organizations/org_document_post_reply', :locals => {:activity => document, :user_activity_id => act.id} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
|
|
@ -81,45 +81,11 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% all_comments = []%>
|
||||
<% all_replies = get_all_children(all_comments, activity) %>
|
||||
<% count = all_replies.count %>
|
||||
<%# allow_delete = (activity.user == User.current || User.current.admin? || User.current.allowed_to?(:as_teacher,activity.course)) %>
|
||||
<%# count = fetch_user_leaveWord_reply(activity).count %>
|
||||
|
||||
<div class="container-big-grey">
|
||||
<%= render :partial => 'projects/project_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id,:is_course => is_course,:is_board =>is_board} %>
|
||||
|
||||
<% comments = all_replies[0..2] %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'projects/project_message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'Message', :activity_id =>activity.id, :is_course => is_course, :is_board =>is_board}%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if !activity.locked? %>
|
||||
<div class="reply-container ml15 borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="reply-content mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id,:is_course => is_course, :is_board => 'true', :is_project => true},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "projects/show_unlogged" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div id="activity_post_reply_<%=user_activity_id %>">
|
||||
<%=render :partial => 'projects/project_message_post_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -16,5 +16,25 @@
|
|||
<%= comment.content_detail.html_safe %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="orig_reply mt-10">
|
||||
<div class="reply">
|
||||
<span class="reply-right">
|
||||
<span id="reply_praise_count_<%=comment.id %>">
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||
</span>
|
||||
<span style="position: relative" class="fr mr20">
|
||||
<%= link_to(
|
||||
l(:button_reply),
|
||||
{:controller => 'users' ,:action => 'reply_to_comment', :reply_id => comment.id, :type => 'Message', :user_activity_id => user_activity_id, :is_project => true},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:title => l(:button_reply)) %>
|
||||
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup03" style="display: none"> ︿</span>
|
||||
</span>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<p id="reply_message_<%= comment.id%>"></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
|
@ -1,8 +1,8 @@
|
|||
<div class="orig_cont clearfix">
|
||||
<% if !comment.parent.nil? && !comment.parent.parent.nil? %>
|
||||
<div>
|
||||
<%=render :partial => 'projects/journal_comment_reply', :locals => {:comment => comment.parent} %>
|
||||
<%=render :partial => 'projects/journal_comment_reply', :locals => {:comment => comment.parent, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => comment} %>
|
||||
<%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => comment, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
|
@ -1,8 +1,8 @@
|
|||
<div class="orig_cont clearfix">
|
||||
<% unless comment.parent.nil? %>
|
||||
<div>
|
||||
<%=render :partial => 'projects/project_issue_comments_reply', :locals => {:comment => comment.parent} %>
|
||||
<%=render :partial => 'projects/project_issue_comments_reply', :locals => {:comment => comment.parent, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => comment} %>
|
||||
<%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => comment, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
|
@ -16,5 +16,25 @@
|
|||
<%= comment.content_detail.html_safe %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="orig_reply mt-10">
|
||||
<div class="reply">
|
||||
<span class="reply-right">
|
||||
<span id="reply_praise_count_<%=comment.id %>">
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||
</span>
|
||||
<span style="position: relative" class="fr mr20">
|
||||
<%= link_to(
|
||||
l(:button_reply),
|
||||
{:controller => 'users' ,:action => 'reply_to_comment', :reply_id => comment.id, :type => 'Issue', :user_activity_id => user_activity_id, :is_project => true},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:title => l(:button_reply)) %>
|
||||
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup03" style="display: none"> ︿</span>
|
||||
</span>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<p id="reply_message_<%= comment.id%>"></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
|
@ -8,18 +8,18 @@
|
|||
<% length = parents_rely.length %>
|
||||
<div id="comment_reply_<%=comment.id %>">
|
||||
<% if length <= 2 %>
|
||||
<%=render :partial => 'projects/project_issue_comments_reply', :locals => {:comment => comment.parent} %>
|
||||
<%=render :partial => 'projects/project_issue_comments_reply', :locals => {:comment => comment.parent, :user_activity_id => user_activity_id} %>
|
||||
<% else %>
|
||||
<div class="orig_cont clearfix">
|
||||
<div class="orig_cont clearfix">
|
||||
<%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => parents_rely[length - 1]} %>
|
||||
<%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => parents_rely[length - 1], :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
<div class="orig_cont_hide_issue clearfix">
|
||||
<span class="orig_icon" >↓ </span>
|
||||
<span class="orig_icon" style="display:none;" > ↑</span><span class="">已经隐藏<%=(length - 2).to_s %>个楼层</span>
|
||||
<%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => comment.class), :remote=>true, :class => 'linkBlue2' %>
|
||||
</div>
|
||||
<%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => parents_rely[0]} %>
|
||||
<%=render :partial => 'projects/project_issue_comments_reply_detail', :locals => {:comment => parents_rely[0], :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
|
||||
</div>
|
||||
<div class="reply-content ml15" onmouseover="$('#delete_reply_<%=activity.id %>_<%=comment.id %>').show();" onmouseout="$('#delete_reply_<%=activity.id %>_<%=comment.id %>').hide();">
|
||||
<%= render :partial => 'projects/project_issue_contents', :locals => {:comment => comment}%>
|
||||
<%= render :partial => 'projects/project_issue_contents', :locals => {:comment => comment, :user_activity_id => user_activity_id}%>
|
||||
|
||||
<% if !comment.content_detail.blank? || comment.class == Journal %>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<% count = activity.journals.count %>
|
||||
<% comments = activity.journals.includes(:user, :details).reorder("created_on desc") %>
|
||||
<% no_children_comments = get_no_children_comments comments %>
|
||||
<div class="container-big-grey">
|
||||
<%= render :partial => 'projects/project_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
|
||||
<% comments = activity.journals.includes(:user, :details).reorder("created_on desc").limit(3) %>
|
||||
<%= render :partial => 'projects/project_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :expand_more =>no_children_comments[:three_more]} %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => "projects/project_issue_expand_show", :locals => {:comments => comments, :activity => activity, :user_activity_id => user_activity_id} %>
|
||||
<%= render :partial => "projects/project_issue_expand_show", :locals => {:comments => no_children_comments[:no_children_comments], :activity => activity, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
</div>
|
|
@ -8,18 +8,18 @@
|
|||
<% length = parents_rely.length %>
|
||||
<div id="comment_reply_<%=comment.id %>">
|
||||
<% if length <= 2 %>
|
||||
<%=render :partial => 'projects/journal_comment_reply', :locals => {:comment => comment.parent} %>
|
||||
<%=render :partial => 'projects/journal_comment_reply', :locals => {:comment => comment.parent, :user_activity_id => user_activity_id} %>
|
||||
<% else %>
|
||||
<div class="orig_cont clearfix">
|
||||
<div class="orig_cont clearfix">
|
||||
<%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => parents_rely[length - 1]} %>
|
||||
<%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => parents_rely[length - 1], :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
<div class="orig_cont_hide_issue clearfix">
|
||||
<span class="orig_icon" >↓ </span>
|
||||
<span class="orig_icon" style="display:none;" > ↑</span><span class="">已经隐藏<%=(length - 2).to_s %>个楼层</span>
|
||||
<%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => comment.class), :remote=>true, :class => 'linkBlue2' %>
|
||||
</div>
|
||||
<%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => parents_rely[0]} %>
|
||||
<%=render :partial => 'projects/comment_reply_detail', :locals => {:comment => parents_rely[0], :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
<% all_replies = Message.where("root_id = #{activity.id}").reorder("created_on desc") %>
|
||||
<% count = all_replies.count %>
|
||||
<% no_children_comments = get_no_children_comments all_replies %>
|
||||
|
||||
<%= render :partial => 'projects/project_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :expand_more =>no_children_comments[:three_more]} %>
|
||||
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'projects/project_message_replies', :locals => {:comments => no_children_comments[:no_children_comments], :user_activity_id => user_activity_id, :type => 'Message', :activity_id =>activity.id}%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if !activity.locked? %>
|
||||
<div class="reply-container ml15 borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="reply-content mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true', :is_project => true},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "projects/show_unlogged" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
|
@ -11,7 +11,7 @@
|
|||
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
|
||||
</div>
|
||||
<div class="reply-content ml15" onmouseover="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').show();" onmouseout="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').hide();">
|
||||
<%= render :partial => 'projects/project_message_contents', :locals => {:comment => comment}%>
|
||||
<%= render :partial => 'projects/project_message_contents', :locals => {:comment => comment, :user_activity_id => user_activity_id}%>
|
||||
|
||||
<% if !comment.content_detail.blank? %>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
|
@ -29,7 +29,7 @@
|
|||
<span style="position: relative" class="fr mr20">
|
||||
<%= link_to(
|
||||
l(:button_reply),
|
||||
{:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id, :is_course => is_course, :is_project => true, :is_board => is_board},
|
||||
{:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id, :is_project => true},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:title => l(:button_reply)) %>
|
||||
|
@ -39,7 +39,7 @@
|
|||
<% if comment.course_destroyable_by?(User.current) || comment.destroyable_by?(User.current) %>
|
||||
<%= link_to(
|
||||
l(:button_delete),
|
||||
delete_board_message_path(comment,:board_id =>comment.board.id, :user_activity_id => user_activity_id, :activity_id => activity_id, :is_course => is_course, :is_project => true, :is_board => is_board),
|
||||
delete_board_message_path(comment,:board_id =>comment.board.id, :user_activity_id => user_activity_id, :activity_id => activity_id, :is_project => true),
|
||||
:method => :post,
|
||||
:remote => true,
|
||||
:id => "delete_reply_#{activity_id}_#{comment.id}",
|
||||
|
|
|
@ -8,14 +8,14 @@
|
|||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||
<%if count>3 %>
|
||||
<% if expand_more %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<% if activity.class.to_s == 'Issue' %>
|
||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply_homework('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'is_project_issue',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||
展开更多
|
||||
</a>
|
||||
<% elsif activity.class.to_s == 'Message' %>
|
||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply_homework('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'is_project_message',<%=user_activity_id %>,<%=is_course %>,<%=is_board %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply_homework('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'is_project_message',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||
展开更多
|
||||
</a>
|
||||
<% else %>
|
||||
|
|
|
@ -31,10 +31,8 @@
|
|||
<%= l(:label_publish_time)%>:<%= homework.publish_time%> 00:00
|
||||
</div>
|
||||
<% end %>
|
||||
<% if homework.homework_detail_manual && homework.homework_detail_manual.comment_status < 2 %>
|
||||
<% if !homework.end_time.nil? %>
|
||||
<div class="homepagePostDeadline ml15 <%= (is_pro || is_base_group) ? 'mt8' : '' %>">提交截止时间:<%= homework.end_time.to_s %> 23:59</div>
|
||||
<% elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status >= 2 && homework.anonymous_comment == 0%>
|
||||
<div class="homepagePostDeadline ml15 <%= (is_pro || is_base_group) ? 'mt8' : '' %>">匿评截止时间:<%= homework.homework_detail_manual.evaluation_end.to_s %> 23:59</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
|
|
@ -68,11 +68,11 @@
|
|||
<%= link_to "加入班级",join_private_courses_courses_path,:remote => true,:class => "hw_btn_green fr mt5",:method => "post"%>
|
||||
<% end %>
|
||||
<% if User.current == course.teacher || User.current.admin? %>
|
||||
<a href="javascript:void(0)" onclick="archive_course(<%=course.id %>, 0);" class="btn_grey_big fr mt5 mr5" style="width: 56px;">归档</a>
|
||||
<a href="javascript:void(0)" onclick="archive_course(<%=course.id %>, 0, 1);" class="btn_grey_big fr mt5 mr5" style="width: 56px;">归档</a>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if User.current == course.teacher || User.current.admin? %>
|
||||
<a href="javascript:void(0)" onclick="archive_course(<%=course.id %>, 1);" class="btn_grey_big fr mt5" style="width: 56px;">恢复</a>
|
||||
<a href="javascript:void(0)" onclick="archive_course(<%=course.id %>, 1, 1);" class="btn_grey_big fr mt5" style="width: 56px;">恢复</a>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
|
@ -119,19 +119,4 @@
|
|||
$(function() {
|
||||
$(".sy_con_l").css("min-height",$(".sy_con_r").height());
|
||||
});
|
||||
function archive_course(id, type){
|
||||
if(type == 0){
|
||||
var htmlvalue = '<div id="muban_popup_box" style="width:400px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||
'<div class="clear muban_popup_con"><div class="newupload_conbox newupload_tishi"><p>您是否确定归档此班级</p>' +
|
||||
'<a href="javascript:void(0);" class="btn btn-grey mt10 mr10" onclick="hideModal();">取 消</a>' +
|
||||
'<a href="/courses/'+ id +'/archive_course?source=1&type=0" class="btn btn-blue mt10" onclick="hideModal();" data-remote="true">确 定</a></div></div></div>';
|
||||
pop_box_new(htmlvalue, 400, 132);
|
||||
} else{
|
||||
var htmlvalue = '<div id="muban_popup_box" style="width:400px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||
'<div class="clear muban_popup_con"><div class="newupload_conbox newupload_tishi"><p>您和您的学生将可以重新在此班级中互动<br/>此班级的动态会在首页中显示<br/><br/>' +
|
||||
'您是否确定恢复此班级</p><a href="javascript:void(0);" class="btn btn-grey mt10 mr10" onclick="hideModal();">取 消</a>' +
|
||||
'<a href="/courses/'+ id +'/archive_course?source=1&type=1" class="btn btn-blue mt10" onclick="hideModal();" data-remote="true">确 定</a></div></div></div>';
|
||||
pop_box_new(htmlvalue, 400, 200);
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1,31 @@
|
|||
<% count=activity.journals_for_messages.count %>
|
||||
<% comments = activity.journals_for_messages.reorder("created_on desc") %>
|
||||
<% no_children_comments = get_no_children_comments comments %>
|
||||
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :expand_more =>no_children_comments[:three_more]} %>
|
||||
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= activity.id %>">
|
||||
<%=render :partial => 'users/news_replies', :locals => {:comments => no_children_comments[:no_children_comments], :type => 'Syllabus', :activity_id => activity.id, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= activity.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= activity.id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_syllabus_message', :id => activity.id},:method => "post") do |f|%>
|
||||
<div nhname='toolbar_container_<%= activity.id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= activity.id%>' name="comment"></textarea>
|
||||
<a id="new_message_submit_btn_<%= activity.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= activity.id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "users/show_unlogged" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
|
@ -62,35 +62,10 @@
|
|||
<div class="cl"></div>
|
||||
</div><!--HomeWork end-->
|
||||
<% end %>
|
||||
<% count=@syllabus.journals_for_messages.count %>
|
||||
<div class="homepagePostReply" style="margin-bottom: 20px;">
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => @syllabus, :user_activity_id => @syllabus.id} %>
|
||||
|
||||
<% comments = @syllabus.journals_for_messages.reorder("created_on desc").limit(3) %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= @syllabus.id %>">
|
||||
<%=render :partial => 'users/news_replies', :locals => {:comments => comments, :type => 'Syllabus', :activity_id => @syllabus.id} %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= @syllabus.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= @syllabus.id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_syllabus_message', :id => @syllabus.id},:method => "post") do |f|%>
|
||||
<div nhname='toolbar_container_<%= @syllabus.id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @syllabus.id%>' name="comment"></textarea>
|
||||
<a id="new_message_submit_btn_<%= @syllabus.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= @syllabus.id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "users/show_unlogged" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="homepagePostReply" style="margin-bottom: 20px;">
|
||||
<div id="activity_post_reply_<%=@syllabus.id %>">
|
||||
<%=render :partial => 'syllabuses/syllabus_post_reply', :locals => {:activity => @syllabus, :user_activity_id => @syllabus.id} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div><!--回复框 用正式版样式-->
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<div class="orig_cont clearfix">
|
||||
<% unless comment.parent.nil? %>
|
||||
<div>
|
||||
<%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent} %>
|
||||
<%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent, :type => type, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => comment} %>
|
||||
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => comment, :type => type, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
|
@ -4,7 +4,7 @@
|
|||
<div class="orig_right fl">
|
||||
<%= link_to comment.creator_user.show_name, user_path(comment.creator_user), :class => "content-username" %>
|
||||
<span class="orig_area"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
|
||||
<div class="orig_content ">
|
||||
<div class="orig_content">
|
||||
<% if comment.class == Journal %>
|
||||
<% if comment.details.any? %>
|
||||
<% details_to_strings(comment.details).each do |string| %>
|
||||
|
@ -16,5 +16,40 @@
|
|||
<%= comment.content_detail.html_safe %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="orig_reply mt-10">
|
||||
<div class="reply">
|
||||
<span class="reply-right">
|
||||
<span id="reply_praise_count_<%=comment.id %>">
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||
</span>
|
||||
<% if type == 'Message' %>
|
||||
<% topic = comment.root %>
|
||||
<% if !topic.locked? && authorize_for('messages', 'reply') %>
|
||||
<span style="position: relative" class="fr mr20">
|
||||
<%= link_to(
|
||||
l(:button_reply),
|
||||
{:controller => 'users' ,:action => 'reply_to_comment', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:title => l(:button_reply)) %>
|
||||
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup03" style="display: none"> ︿</span>
|
||||
</span>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<span style="position: relative" class="fr mr20">
|
||||
<%= link_to(
|
||||
l(:button_reply),
|
||||
{:controller => 'users' ,:action => 'reply_to_comment', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:title => l(:button_reply)) %>
|
||||
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup03" style="display: none"> ︿</span>
|
||||
</span>
|
||||
<% end %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<p id="reply_message_<%= comment.id%>"></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
|
@ -33,10 +33,8 @@
|
|||
<% end %>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<%= render :partial => 'users/homework_opr', :locals => {:activity => activity, :is_teacher => is_teacher, :hw_status => hw_status, :user_activity_id => user_activity_id} %>
|
||||
<% if activity.homework_detail_manual && activity.homework_detail_manual.comment_status < 2 %>
|
||||
<div class="homepagePostDeadline">提交截止时间:<%= activity.end_time.to_s %> 23:59</div>
|
||||
<% elsif activity.homework_detail_manual && activity.homework_detail_manual.comment_status >= 2 && activity.anonymous_comment == 0%>
|
||||
<div class="homepagePostDeadline">匿评截止时间:<%= activity.homework_detail_manual.evaluation_end.to_s %> 23:59</div>
|
||||
<% if !activity.end_time.nil? %>
|
||||
<div class="homepagePostDeadline">提交截止时间:<%= activity.end_time.to_s %> 23:59</div>
|
||||
<% end %>
|
||||
<% if activity.homework_detail_manual.comment_status == 0 && !activity.publish_time.nil? %>
|
||||
<div class="homepagePostDeadline ml15">
|
||||
|
@ -59,5 +57,5 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<%= render :partial => 'users/homework_post_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id, :hw_status => hw_status, :is_teacher => is_teacher} %>
|
||||
<%= render :partial => 'users/homework_post_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id, :is_teacher => is_teacher} %>
|
||||
</div>
|
||||
|
|
|
@ -38,43 +38,10 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% all_comments = []%>
|
||||
<% all_replies = JournalsForMessage.where("root_id = #{activity.id}").reorder("created_on desc") %>
|
||||
<% count = all_replies.count %>
|
||||
|
||||
<div class="homepagePostReply">
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
|
||||
|
||||
<% comments = all_replies[0..2] %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'JournalsForMessage', :activity_id =>activity.id}%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'words', :action => 'create_reply', :id => activity.id}, :method => "post", :remote => true) do |f|%>
|
||||
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => activity.id %>
|
||||
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => activity.user.id %>
|
||||
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => activity.id %>
|
||||
<%= hidden_field_tag 'show_name',params[:show_name],:value =>true %>
|
||||
<%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %>
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="user_notes"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "users/show_unlogged" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div id="activity_post_reply_<%=user_activity_id %>">
|
||||
<%=render :partial => 'users/user_journal_post_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -78,45 +78,10 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% all_comments = []%>
|
||||
<%# all_replies = get_all_children(all_comments, activity) %>
|
||||
<% all_replies = Message.where("root_id = #{activity.id}").reorder("created_on desc") %>
|
||||
<% count = all_replies.count %>
|
||||
<div class="homepagePostReply">
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id,:is_course => is_course,:is_board =>is_board} %>
|
||||
|
||||
<% comments = all_replies[0..2] %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'Message', :activity_id =>activity.id, :is_course => is_course, :is_board =>is_board}%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if !activity.locked? && authorize_for_course('messages', 'reply') %>
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => is_board,:is_course=>is_course},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "users/show_unlogged" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div id="activity_post_reply_<%=user_activity_id %>">
|
||||
<%=render :partial => 'users/course_message_post_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
<% all_replies = Message.where("root_id = #{activity.id}").reorder("created_on desc") %>
|
||||
<% count = all_replies.count %>
|
||||
<% no_children_comments = get_no_children_comments all_replies %>
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :expand_more =>no_children_comments[:three_more]} %>
|
||||
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/message_replies', :locals => {:comments => no_children_comments[:no_children_comments], :user_activity_id => user_activity_id, :type => 'Message', :activity_id =>activity.id}%>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if !activity.locked? && authorize_for_course('messages', 'reply') %>
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "users/show_unlogged" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
|
@ -63,39 +63,10 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<% count=activity.comments.count %>
|
||||
<div class="homepagePostReply">
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
|
||||
|
||||
<% comments = activity.comments.reorder("created_on desc").limit(3) %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/news_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'News', :activity_id => activity.id} %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if activity.commentable? %>
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "users/show_unlogged" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div id="activity_post_reply_<%=user_activity_id %>">
|
||||
<%=render :partial => 'users/course_news_post_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
<% count=activity.comments.count %>
|
||||
<% comments = activity.comments.reorder("created_on desc") %>
|
||||
<% no_children_comments = get_no_children_comments comments %>
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :expand_more =>no_children_comments[:three_more] } %>
|
||||
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/news_replies', :locals => {:comments => no_children_comments[:no_children_comments], :user_activity_id => user_activity_id, :type => 'News', :activity_id => activity.id} %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if activity.commentable? %>
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "users/show_unlogged" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
|
@ -1,36 +1,47 @@
|
|||
<% unless courses.nil? %>
|
||||
<% courses.each_with_index do |course, i| %>
|
||||
<li class="syllabus_class_list <%= i > 2 ? 'none' : '' %>">
|
||||
<% allow_visit = User.current.member_of_course?(course) || User.current.admin? || course.is_public == 1 %>
|
||||
<% allow_visit = course.is_delete == 0 && (User.current.member_of_course?(course) || User.current.admin? || course.is_public == 1) %>
|
||||
<% if course.is_delete == 0 %>
|
||||
<span id="collect_course_icon_<%=course.id %>">
|
||||
<%=render :partial => 'collect_course', :locals => {:course => course} %>
|
||||
</span>
|
||||
<% end %>
|
||||
|
||||
<div class="fl">
|
||||
<div class="syllabus_class_w ">
|
||||
<a href="<%= allow_visit ? course_path(course.id) : "javascript:void(0)" %>" class="syllabus_class_title fl" target="_blank" title="<%= allow_visit ? "" : "私有班级不可访问" %>"><%= course.name %></a>
|
||||
<div class="syllabus_class_w" style="width: 580px;">
|
||||
<a href="<%= allow_visit ? course_path(course.id) : "javascript:void(0)" %>" class="syllabus_class_title fl" target="_blank" title="<%= allow_visit ? "" : "班级不可访问" %>"><%= course.name %></a>
|
||||
<span class="<%= course.is_public == 0 ? 'syllabus_class_private' : 'syllabus_class_open' %> fl ml10 mt3 syllabus_class_property"><%= course.is_public == 0 ? '私有' : '公开' %></span>
|
||||
<span class="fr sy_p_grey hidden" style="max-width: 120px;">创建老师:<%= link_to course.teacher.show_name, user_path(course.teacher) %></span>
|
||||
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="">
|
||||
<p class="fl grayTxt ">更新:<%= format_date Time.at(course.updatetime) %><span class="mr10"></span>
|
||||
学期:<%= current_time_and_term(course) %></p>
|
||||
|
||||
<p class="list-info fr grayTxt">
|
||||
<% student_link = (User.current.logged? && course.open_student == 1 && course.is_public == 1) || (User.current.member_of_course?(course)) || User.current.admin? %>
|
||||
<span><a href="<%= student_link ? course_member_path(course, :role => 2) : "javascript:void(0)" %>" target="_blank" title="<%= student_link ? "" : "学生列表不对外公开" %>"><%= studentCount course %></a></span><span>学生</span>
|
||||
<span>|</span>
|
||||
<span><a href="<%= allow_visit ? homework_common_index_path(:course => course.id) : "javascript:void(0)" %>" target="_blank" title="<%= allow_visit ? "" : "私有班级不可访问" %>"><%= visable_course_homework course %></a></span><span>作业</span>
|
||||
<span>|</span>
|
||||
<span><a href="<%= allow_visit ? course_files_path(course) : "javascript:void(0)" %>" target="_blank" title="<%= allow_visit ? "" : "私有班级不可访问" %>"><%= visable_attachemnts_incourse(course).count %></a></span><span>资源</span>
|
||||
创建老师:<%= link_to course.teacher.show_name, user_path(course.teacher) %>
|
||||
</p>
|
||||
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="icons_sy_arrow fl mt19 ml10"></span>
|
||||
<% if User.current == @user && (User.current == course.teacher || User.current.admin?) %>
|
||||
<div class="pr">
|
||||
<a href="javascript:void(0)" onclick="archive_course(<%=course.id %>, <%=course.is_delete %>, 0);" onmouseover="$('#archive_notice_<%=course.id %>').show();" onmouseout="$('#archive_notice_<%=course.id %>').hide();"
|
||||
class="btn_grey_big fr mt5 mr15" style="width: 56px;"><%= course.is_delete == 0 ? '归档' : '恢复' %></a>
|
||||
<div class="archive_course_notice fontGrey2 none" id="archive_notice_<%=course.id %>" style="width: 230px;">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p class="mt5 mb5 break_word">
|
||||
<% if course.is_delete == 0 %>
|
||||
此班级的信息将不再显示<br/>
|
||||
您和您的学生将不能在此班级中继续互动<br/>
|
||||
但您可以点击上方的“归档管理”
|
||||
<% else %>
|
||||
此班级的信息将恢复显示<br/>
|
||||
您和您的学生将可以重新在此班级中互动
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
<% count=activity.journals_for_messages.count %>
|
||||
<% comments = activity.journals_for_messages.reorder("created_on desc") %>
|
||||
<% no_children_comments = get_no_children_comments comments %>
|
||||
<div class="homepagePostReply" id="homework_post_reply_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :hw_status => hw_status} %>
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :expand_more =>no_children_comments[:three_more]} %>
|
||||
|
||||
<% comments = activity.journals_for_messages.reorder("created_on desc").limit(3) %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%=render :partial => 'users/news_replies', :locals => {:comments => comments, :type => 'HomeworkCommon', :hw_status => hw_status, :is_teacher => is_teacher, :user_activity_id => user_activity_id, :activity_id => activity.id} %>
|
||||
<%=render :partial => 'users/news_replies', :locals => {:comments => no_children_comments[:no_children_comments], :type => 'HomeworkCommon', :is_teacher => is_teacher, :user_activity_id => user_activity_id, :activity_id => activity.id} %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
@ -16,7 +17,6 @@
|
|||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_homework_message', :id => activity.id},:method => "post", :remote => true) do |f|%>
|
||||
<%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %>
|
||||
<%= hidden_field_tag 'hw_status',params[:hw_status],:value =>hw_status %>
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="homework_message"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<div class="orig_cont clearfix">
|
||||
<% if !comment.parent.nil? && !comment.parent.parent.nil? %>
|
||||
<div>
|
||||
<%=render :partial => 'users/journal_comment_reply', :locals => {:comment => comment.parent} %>
|
||||
<%=render :partial => 'users/journal_comment_reply', :locals => {:comment => comment.parent, :type => type, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => comment} %>
|
||||
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => comment, :type => type, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
|
@ -8,21 +8,21 @@
|
|||
<% length = parents_rely.length %>
|
||||
<div id="comment_reply_<%=comment.id %>">
|
||||
<% if length <= 2 %>
|
||||
<%=render :partial => 'users/journal_comment_reply', :locals => {:comment => comment.parent} %>
|
||||
<%=render :partial => 'users/journal_comment_reply', :locals => {:comment => comment.parent, :type => type, :user_activity_id => user_activity_id} %>
|
||||
<% else %>
|
||||
<div class="orig_cont clearfix">
|
||||
<div class="orig_cont clearfix">
|
||||
<!--<div>-->
|
||||
<!--<%#=render :partial => 'users/journal_comment_reply', :locals => {:comment => parents_rely[length - 1]} %>-->
|
||||
<!--</div>-->
|
||||
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 1]} %>
|
||||
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 1], :type => type, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
<div class="orig_cont_hide clearfix">
|
||||
<span class="orig_icon" >↓ </span>
|
||||
<span class="orig_icon" style="display:none;" > ↑</span><span class="">已经隐藏<%=(length - 2).to_s %>个楼层</span>
|
||||
<%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => comment.class),:remote=>true, :class => 'linkBlue2' %>
|
||||
</div>
|
||||
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %>
|
||||
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0], :type => type, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').show();" onmouseout="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').hide();">
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => comment, :type => type, :user_activity_id => user_activity_id}%>
|
||||
|
||||
<% if !comment.content_detail.blank? %>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
|
@ -29,7 +29,7 @@
|
|||
<span style="position: relative" class="fr mr20">
|
||||
<%= link_to(
|
||||
l(:button_reply),
|
||||
{:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id, :is_course => is_course, :is_board => is_board},
|
||||
{:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:title => l(:button_reply)) %>
|
||||
|
@ -39,7 +39,7 @@
|
|||
<% if comment.course_destroyable_by?(User.current) || comment.destroyable_by?(User.current) %>
|
||||
<%= link_to(
|
||||
l(:button_delete),
|
||||
delete_board_message_path(comment,:board_id =>comment.board.id, :user_activity_id => user_activity_id, :activity_id => activity_id, :is_course => is_course, :is_board => is_board),
|
||||
delete_board_message_path(comment,:board_id =>comment.board.id, :user_activity_id => user_activity_id, :activity_id => activity_id),
|
||||
:method => :post,
|
||||
:remote => true,
|
||||
:id => "delete_reply_#{activity_id}_#{comment.id}",
|
||||
|
@ -87,7 +87,7 @@
|
|||
<span style="position: relative" class="fr mr20">
|
||||
<%= link_to(
|
||||
l(:button_reply),
|
||||
{:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id, :homepage => homepage, :user_id => user_id},
|
||||
{:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:title => l(:button_reply)) if !comment.root.locked? %>
|
||||
|
@ -96,7 +96,7 @@
|
|||
<% if comment.author == User.current %>
|
||||
<%= link_to(
|
||||
l(:button_delete),
|
||||
{:controller => 'blog_comments',:action => 'destroy', :id => comment.id, :user_activity_id => user_activity_id, :homepage => homepage, :user_id => user_id},
|
||||
{:controller => 'blog_comments',:action => 'destroy', :id => comment.id, :user_activity_id => user_activity_id},
|
||||
:method => :delete,
|
||||
:remote => true,
|
||||
:id => "delete_reply_#{activity_id}_#{comment.id}",
|
||||
|
|
|
@ -8,21 +8,21 @@
|
|||
<% length = parents_rely.length %>
|
||||
<div id="comment_reply_<%=comment.id %>">
|
||||
<% if length <= 2 %>
|
||||
<%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent} %>
|
||||
<%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent, :type => type, :user_activity_id => user_activity_id} %>
|
||||
<% else %>
|
||||
<div class="orig_cont clearfix">
|
||||
<div class="orig_cont clearfix">
|
||||
<!--<div>-->
|
||||
<!--<%#=render :partial => 'users/comment_reply', :locals => {:comment => parents_rely[length - 1]} %>-->
|
||||
<!--</div>-->
|
||||
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 1]} %>
|
||||
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 1], :type => type, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
<div class="orig_cont_hide clearfix">
|
||||
<span class="orig_icon" >↓ </span>
|
||||
<span class="orig_icon" style="display:none;" > ↑</span><span class="">已经隐藏<%=(length - 2).to_s %>个楼层</span>
|
||||
<%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => comment.class), :remote=>true, :class => 'linkBlue2' %>
|
||||
</div>
|
||||
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %>
|
||||
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0], :type => type, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').show();" onmouseout="$('#delete_reply_<%=activity_id %>_<%=comment.id %>').hide();">
|
||||
<%= render :partial => 'users/news_contents', :locals => {:comment => comment}%>
|
||||
<%= render :partial => 'users/news_contents', :locals => {:comment => comment, :type => type, :user_activity_id => user_activity_id}%>
|
||||
|
||||
<% if !comment.content_detail.blank? || comment.class == Journal %>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
|
@ -36,14 +36,14 @@
|
|||
<span style="position: relative" class="fr mr20">
|
||||
<%= link_to(
|
||||
l(:button_reply),
|
||||
{:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => 'HomeworkCommon', :hw_status => hw_status, :user_activity_id => user_activity_id},
|
||||
{:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => 'HomeworkCommon', :user_activity_id => user_activity_id},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:title => l(:button_reply)) %>
|
||||
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
||||
</span>
|
||||
<% if User.current.admin? ||is_teacher || comment.user == User.current%>
|
||||
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:hw_status => hw_status, :user_activity_id => user_activity_id},
|
||||
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user, :user_activity_id => user_activity_id},
|
||||
:id => "delete_reply_#{activity_id}_#{comment.id}",:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20 undis", :title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
<% elsif type == 'News' %>
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
<% count = activity.journals.count %>
|
||||
<% comments = activity.journals.includes(:user, :details).reorder("created_on desc") %>
|
||||
<% no_children_comments = get_no_children_comments comments %>
|
||||
<div class="homepagePostReply">
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :expand_more =>no_children_comments[:three_more]} %>
|
||||
|
||||
<% comments = activity.journals.includes(:user, :details).reorder("created_on desc").limit(3) %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/news_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'Issue', :activity_id => activity.id} %>
|
||||
<%= render :partial => 'users/news_replies', :locals => {:comments => no_children_comments[:no_children_comments], :user_activity_id => user_activity_id, :type => 'Issue', :activity_id => activity.id} %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -81,45 +81,10 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% all_comments = []%>
|
||||
<% all_replies = Message.where("root_id = #{activity.id}").reorder("created_on desc") %>
|
||||
<% count = all_replies.count %>
|
||||
<%# allow_delete = (activity.user == User.current || User.current.admin? || User.current.allowed_to?(:as_teacher,activity.course)) %>
|
||||
<%# count = fetch_user_leaveWord_reply(activity).count %>
|
||||
<div class="homepagePostReply">
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id,:is_course => is_course,:is_board =>is_board} %>
|
||||
|
||||
<% comments = all_replies[0..2] %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'Message', :activity_id =>activity.id, :is_course => is_course, :is_board =>is_board}%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if !activity.locked? %>
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id,:is_course => is_course, :is_board => 'true'},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "users/show_unlogged" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div id="activity_post_reply_<%=user_activity_id %>">
|
||||
<%=render :partial => 'users/course_message_post_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -8,18 +8,18 @@
|
|||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||
<%if count>3 %>
|
||||
<%if expand_more %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<% if activity.class.to_s == 'HomeworkCommon' %>
|
||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply_homework('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'HomeworkCommon',<%=activity.id %>,<%=hw_status %>,<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply_homework('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'HomeworkCommon',<%=activity.id %>,<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||
展开更多
|
||||
</a>
|
||||
<% elsif activity.class.to_s == 'Message' %>
|
||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_message_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'<%=activity.class %>',<%=user_activity_id %>,<%=is_course %>,<%=is_board %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_all_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'<%=activity.class %>',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||
展开更多
|
||||
</a>
|
||||
<% elsif activity.class.to_s == 'BlogComment' %>
|
||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_blog_comment_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'<%=activity.class %>',<%=user_activity_id %>,<%=homepage %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_all_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'<%=activity.class %>',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||
展开更多
|
||||
</a>
|
||||
<% else %>
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
<div nhname='new_message_<%= reply.id%>'>
|
||||
<% if @type == 'HomeworkCommon' %>
|
||||
<%= form_for('new_form',:url => {:controller => 'words', :action => 'reply_to_homework', :id => reply.id},:method => "post", :remote => true) do |f| %>
|
||||
<input type="hidden" name="hw_status" value=<%=@hw_status %>>
|
||||
<input type="hidden" name="user_activity_id" value=<%=@user_activity_id %>>
|
||||
<input type="hidden" name="reply[subject]" id="reply_subject">
|
||||
<div nhname='toolbar_container_<%= reply.id%>'></div>
|
||||
|
@ -29,8 +28,6 @@
|
|||
<% end%>
|
||||
<% elsif @type == 'Message' %>
|
||||
<%= form_for('new_form',:url => {:controller => 'messages', :action => 'reply', :id => reply.id, :board_id => reply.board.id}, :method => "post", :remote => true) do |f|%>
|
||||
<%= hidden_field_tag 'is_course', params[:is_course], :value => @is_course %>
|
||||
<%= hidden_field_tag 'is_board', params[:is_board], :value => @is_board %>
|
||||
<%= hidden_field_tag 'parent_id', params[:parent_id], :value => reply.id %>
|
||||
<%= hidden_field_tag 'activity_id',params[:activity_id],:value =>@activity_id %>
|
||||
<%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>@user_activity_id %>
|
||||
|
@ -41,11 +38,10 @@
|
|||
<p nhname='contentmsg_<%= reply.id%>'></p>
|
||||
<% end%>
|
||||
<% elsif @type == 'BlogComment' %>
|
||||
<%= form_for('new_form', :url => {:controller => 'blog_comments',:action => 'reply', :id => reply.id, :blog_id => reply.blog.id, :user_id => @user_id}, :method => "post", :remote => true) do |f| %>
|
||||
<%= form_for('new_form', :url => {:controller => 'blog_comments',:action => 'reply', :id => reply.id, :blog_id => reply.blog.id, :user_id => reply.blog.author_id}, :method => "post", :remote => true) do |f| %>
|
||||
<input type="hidden" name="blog_comment[title]" value="RE:<%=(BlogComment.find @activity_id).title %>" id="reply_subject">
|
||||
<%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>@user_activity_id %>
|
||||
<%= hidden_field_tag 'parent_id', params[:parent_id], :value => reply.id %>
|
||||
<%= hidden_field_tag 'homepage', params[:homepage], :value => @homepage %>
|
||||
<div nhname='toolbar_container_<%= reply.id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="blog_comment[content]"></textarea>
|
||||
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:2px;">发送</a>
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
<div class="<%= User.current.logged? ? 'orig_reply_box' : 'orig_reply_box2' %> borderBottomNone mt10" id="reply_to_message_<%= reply.id%>">
|
||||
<% if User.current.logged? %>
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= reply.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
|
||||
<div class="orig_textarea mb10 fl">
|
||||
<div nhname='new_message_<%= reply.id%>'>
|
||||
<%= form_for('new_form',:url => {:controller => 'users', :action => 'reply_detail', :reply_id => reply.id, :type => @type, :is_project => @is_project, :user_activity_id => @user_activity_id},:method => "post", :remote => true) do |f| %>
|
||||
<div nhname='toolbar_container_<%= reply.id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="reply_message"></textarea>
|
||||
<a id="new_message_submit_btn_<%= reply.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= reply.id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "users/show_unlogged_reply" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
|
@ -1,16 +1,12 @@
|
|||
<div class="syllabus_category">
|
||||
<% if @type.to_i == 2 %>
|
||||
<%= link_to "", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fr", :style => "margin-right: 5px;", :remote => true %>
|
||||
<% else %>
|
||||
<%= link_to "", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortdownbtn sort_no fr", :style => "margin-right: 5px;", :remote => true %>
|
||||
<% end %>
|
||||
<%= link_to "人气", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortTxt fr", :remote => true %>
|
||||
<% if @type.to_i == 1 %>
|
||||
<%= link_to "", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fr", :remote => true %>
|
||||
<% else %>
|
||||
<%= link_to "", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortdownbtn sort_no fr", :remote => true %>
|
||||
<% end %>
|
||||
<%= link_to "时间", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt fr", :remote => true %>
|
||||
<%= link_to "时间", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt mr5 fr", :remote => true %>
|
||||
<span class="grayTxt fl "><%=@user == User.current ? "我" : "他" %><%= list_type == 1 ? "创建" : "加入"%>的课程</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
@ -44,6 +40,9 @@
|
|||
<ul>
|
||||
<li class="icons_sy_setting">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li>
|
||||
<%= link_to "新建班级", new_course_path(:syllabus_id => syllabus.id), :class => "postOptionLink", :target => '_blank', :title => "新建班级"%>
|
||||
</li>
|
||||
<li>
|
||||
<%=link_to '查看课程', syllabus_path(syllabus.id), :class => 'postOptionLink',:target =>'_blank', :title => '查看课程' %>
|
||||
</li>
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
<div class="syllabus_category">
|
||||
<% if @type.to_i == 2 %>
|
||||
<%= link_to "", {:controller => 'users', :action => 'user_archive_courses', :type => @type, :sort => @c_sort, :order => 2 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fr", :style => "margin-right: 5px;", :remote => true %>
|
||||
<% end %>
|
||||
<%= link_to "人气", {:controller => 'users', :action => 'user_archive_courses', :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortTxt fr", :remote => true %>
|
||||
<% if @type.to_i == 1 %>
|
||||
<%= link_to "", {:controller => 'users', :action => 'user_archive_courses', :type => @type, :sort => @c_sort, :order => 1 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fr", :remote => true %>
|
||||
<% end %>
|
||||
<%= link_to "时间", {:controller => 'users', :action => 'user_archive_courses', :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt mr5 fr", :remote => true %>
|
||||
<span class="grayTxt fl ">归档的班级</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<% if syllabuses.any? %>
|
||||
<% syllabuses.each_with_index do |syllabus, index|%>
|
||||
<div class="syllabus_courses_box">
|
||||
<% course_count = syllabus.courses.where("is_delete = 1").count %>
|
||||
<div class="syllabus_courses_list" id="syllabus_courses_list_<%= syllabus.id %>">
|
||||
<div class="<%=index == 0 ? 'sy_courses_open' : 'sy_courses_close' %>">
|
||||
<span onclick="expand_courses(<%=syllabus.id %>,<%=course_count %>);" class="<%=index == 0 && course_count != 0 ? 'icons_sy_open' : 'icons_sy_close' %> fl mr5" title="点击展开/收起班级列表"></span>
|
||||
<%=link_to syllabus.title, syllabus_path(syllabus.id), :class => 'syllabus_courses_title fl', :target => '_blank' %>
|
||||
</div>
|
||||
<p class="fl sy_p_grey">更新时间:<%=format_date syllabus.updated_at %>
|
||||
<span class="mr10"></span>创建老师:<%=syllabus.user.show_name %>
|
||||
<span class="mr10"></span>班级:<%=course_count %>
|
||||
</p>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<div class="syllabus_class_box <%=index == 0 ? '' : 'none' %>">
|
||||
<ul id="syllabus_course_ul_<%=syllabus.id %>">
|
||||
<% if index == 0 %>
|
||||
<% courses = syllabus.courses.where("is_delete = 1").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc") %>
|
||||
<%= render :partial => 'users/courses_list', :locals => {:courses => courses, :syllabus => syllabus}%>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div><!--syllabus_class_box end-->
|
||||
|
||||
<div class="homepagePostSetting">
|
||||
<ul>
|
||||
<li class="icons_sy_setting">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li>
|
||||
<%= link_to "新建班级", new_course_path(:syllabus_id => syllabus.id), :class => "postOptionLink", :target => '_blank', :title => "新建班级"%>
|
||||
</li>
|
||||
<li>
|
||||
<%=link_to '查看课程', syllabus_path(syllabus.id), :class => 'postOptionLink',:target =>'_blank', :title => '查看课程' %>
|
||||
</li>
|
||||
<% if User.current == syllabus.user %>
|
||||
<li><%=link_to '删除课程', delete_syllabus_syllabus_path(syllabus), :class => 'postOptionLink', :remote => 'true'%></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% end %>
|
|
@ -41,47 +41,11 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<%# all_comments = []%>
|
||||
<% all_replies = BlogComment.where("root_id = #{activity.id}").reorder("created_on desc") %>
|
||||
<% count = all_replies.count %>
|
||||
|
||||
<div class="homepagePostReply">
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :homepage => 0} %>
|
||||
|
||||
<% comments = all_replies[0..2] %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'BlogComment', :activity_id =>activity.id, :homepage => 0, :user_id => activity.author_id}%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if activity.locked == false && User.current.logged?%>
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'blog_comments', :action => 'reply', :user_id=>activity.author_id,:blog_id=>activity.blog_id,:id=>activity.id},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
<input type="hidden" name="in_user_center" value="true">
|
||||
<input type="hidden" name="blog_comment[sticky]" value="0">
|
||||
<input type="hidden" name="blog_comment[locked]" value="0">
|
||||
<input type="hidden" name="blog_comment[title]" value="RE:<%= activity.title%>">
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="blog_comment[content]"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "users/show_unlogged" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div id="activity_post_reply_<%=user_activity_id %>">
|
||||
<%=render :partial => 'users/user_blog_post_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
<% all_replies = BlogComment.where("root_id = #{activity.id}").reorder("created_on desc") %>
|
||||
<% count = all_replies.count %>
|
||||
<% no_children_comments = get_no_children_comments all_replies %>
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :expand_more =>no_children_comments[:three_more]} %>
|
||||
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/message_replies', :locals => {:comments => no_children_comments[:no_children_comments], :user_activity_id => user_activity_id, :type => 'BlogComment', :activity_id =>activity.id}%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if activity.locked == false && User.current.logged?%>
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'blog_comments', :action => 'reply', :user_id=>activity.author_id,:blog_id=>activity.blog_id,:id=>activity.id},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
<input type="hidden" name="in_user_center" value="true">
|
||||
<input type="hidden" name="blog_comment[sticky]" value="0">
|
||||
<input type="hidden" name="blog_comment[locked]" value="0">
|
||||
<input type="hidden" name="blog_comment[title]" value="RE:<%= activity.title%>">
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="blog_comment[content]"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "users/show_unlogged" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
|
@ -274,13 +274,14 @@
|
|||
</div>
|
||||
|
||||
<% count=homework_common.journals_for_messages.count %>
|
||||
<% comments = homework_common.journals_for_messages.reorder("created_on desc") %>
|
||||
<% no_children_comments = get_no_children_comments comments %>
|
||||
<div class="homepagePostReply">
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => homework_common, :user_activity_id => homework_common.id, :is_in_course => is_in_course,:course_activity=>-1} %>
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => homework_common, :user_activity_id => homework_common.id, :is_in_course => is_in_course,:course_activity=>-1, :expand_more =>no_children_comments[:three_more]} %>
|
||||
|
||||
<% comments = homework_common.journals_for_messages.reorder("created_on desc").limit(3) %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= homework_common.id %>">
|
||||
<%=render :partial => 'users/news_replies', :locals => {:comments => comments, :type => 'HomeworkCommon', :is_in_course => is_in_course,:course_activity=>-1, :is_teacher => is_teacher, :user_activity_id => -1, :activity_id => homework_common.id} %>
|
||||
<%=render :partial => 'users/news_replies', :locals => {:comments => no_children_comments[:no_children_comments], :type => 'HomeworkCommon', :is_in_course => is_in_course,:course_activity=>-1, :is_teacher => is_teacher, :user_activity_id => -1, :activity_id => homework_common.id} %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
<% all_replies = JournalsForMessage.where("root_id = #{activity.id}").reorder("created_on desc") %>
|
||||
<% count = all_replies.count %>
|
||||
<% no_children_comments = get_no_children_comments all_replies %>
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :expand_more =>no_children_comments[:three_more]} %>
|
||||
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/message_replies', :locals => {:comments => no_children_comments[:no_children_comments], :user_activity_id => user_activity_id, :type => 'JournalsForMessage', :activity_id =>activity.id}%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'words', :action => 'create_reply', :id => activity.id},:method => "post", :remote => true) do |f|%>
|
||||
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => activity.id %>
|
||||
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => activity.user.id %>
|
||||
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => activity.id %>
|
||||
<%= hidden_field_tag 'show_name',params[:show_name],:value =>true %>
|
||||
<%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %>
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="user_notes"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "users/show_unlogged" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
|
@ -62,43 +62,10 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% all_comments = []%>
|
||||
<% all_replies = JournalsForMessage.where("root_id = #{activity.id}").reorder("created_on desc") %>
|
||||
<% count = all_replies.count %>
|
||||
|
||||
<div class="homepagePostReply">
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
|
||||
|
||||
<% comments = all_replies[0..2] %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'JournalsForMessage', :activity_id =>activity.id}%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'words', :action => 'create_reply', :id => activity.id},:method => "post", :remote => true) do |f|%>
|
||||
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => activity.id %>
|
||||
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => activity.user.id %>
|
||||
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => activity.id %>
|
||||
<%= hidden_field_tag 'show_name',params[:show_name],:value =>true %>
|
||||
<%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>user_activity_id %>
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="user_notes"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "users/show_unlogged" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div id="activity_post_reply_<%=user_activity_id %>">
|
||||
<%=render :partial => 'users/user_journal_post_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<% if params[:type] == 'HomeworkCommon' %>
|
||||
$('#reply_div_<%= @user_activity_id %>').html('<%=escape_javascript(render :partial => 'users/news_replies', :locals => {:comments => @journals, :type => @type, :hw_status =>@hw_status, :is_teacher => @is_teacher, :user_activity_id => @user_activity_id, :activity_id => params[:id].to_i}) %>');
|
||||
$('#reply_div_<%= @user_activity_id %>').html('<%=escape_javascript(render :partial => 'users/news_replies', :locals => {:comments => @journals, :type => @type, :is_teacher => @is_teacher, :user_activity_id => @user_activity_id, :activity_id => params[:id].to_i}) %>');
|
||||
<% elsif params[:type] == 'JournalsForMessage' %>
|
||||
$('#reply_div_<%= @user_activity_id %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id =>params[:id].to_i}) %>');
|
||||
<% elsif params[:type] == 'Message' %>
|
||||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i,:is_course => @is_course, :is_board => @is_board}) %>');
|
||||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i}) %>');
|
||||
<% elsif params[:type] == 'BlogComment' %>
|
||||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i, :homepage => @homepage, :user_id => @user_id}) %>');
|
||||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i}) %>');
|
||||
<% elsif params[:type] == 'OrgDocumentComment' %>
|
||||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals, :user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i}) %>');
|
||||
<% elsif params[:type] == 'News' || params[:type] == 'Issue' || params[:type] == 'Syllabus' %>
|
||||
|
@ -13,5 +13,5 @@ $('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :p
|
|||
<% elsif params[:type] == 'is_project_issue' %>
|
||||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'projects/project_issue_expand_show', :locals => {:comments => @journals, :user_activity_id => @user_activity_id, :activity => @activity}) %>');
|
||||
<% elsif params[:type] == 'is_project_message' %>
|
||||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'projects/project_message_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i,:is_course => @is_course, :is_board => @is_board}) %>');
|
||||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'projects/project_message_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i}) %>');
|
||||
<% end %>
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
<% if params[:type] == 'Message' %>
|
||||
<% if @user_activity_id.to_i != @root.id %>
|
||||
<% if @is_project %>
|
||||
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'projects/project_message_post_reply', :locals => {:activity => @root,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% elsif @org_subfield %>
|
||||
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'organizations/org_message_post_reply', :locals => {:activity => @root,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% else %>
|
||||
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/course_message_post_reply', :locals => {:activity => @root,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% end %>
|
||||
<% else %>
|
||||
window.location.href = "<%=board_message_path(@root.board_id, @root) %>";
|
||||
<% end %>
|
||||
<% elsif params[:type] == 'HomeworkCommon' %>
|
||||
$("#homework_post_reply_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/homework_post_reply', :locals => {:activity => @root, :user_activity_id => @user_activity_id, :is_teacher => @is_teacher}) %>");
|
||||
<% elsif params[:type] == 'BlogComment' %>
|
||||
<% if @user_activity_id.to_i != @root.id %>
|
||||
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/user_blog_post_reply', :locals => {:activity => @root,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% else %>
|
||||
window.location.href = "<%=user_blog_blog_comment_path(:user_id => @root.author_id,:blog_id=>@root.blog_id,:id=>@root.id) %>";
|
||||
<% end %>
|
||||
<% elsif params[:type] == 'News' %>
|
||||
<% if @user_activity_id.to_i != @root.id %>
|
||||
$("#activity_post_reply_<%= @user_activity_id %>").html("<%= escape_javascript(render :partial => 'users/course_news_post_reply', :locals => {:activity => @root,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% else %>
|
||||
window.location.href = "<%=news_path(@root) %>";
|
||||
<% end %>
|
||||
<% elsif params[:type] == 'JournalsForMessage' %>
|
||||
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/user_journal_post_reply', :locals => {:activity => @root,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% elsif params[:type] == 'Issue' %>
|
||||
<% if @user_activity_id.to_i != @root.id %>
|
||||
<% if @is_project %>
|
||||
$("#div_user_issue_reply_<%=@user_activity_id%>").html("<%= escape_javascript(render :partial => 'projects/project_issue_reply', :locals => {:activity => @root, :user_activity_id => @user_activity_id}) %>");
|
||||
<% else %>
|
||||
$("#div_user_issue_reply_<%=@user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/project_issue_reply', :locals => {:activity => @root, :user_activity_id => @user_activity_id}) %>");
|
||||
<% end %>
|
||||
<% else %>
|
||||
window.location.href = "<%=issue_path(@root) %>";
|
||||
<% end %>
|
||||
<% elsif params[:type] == 'OrgDocumentComment' %>
|
||||
<% if @user_activity_id.to_i != @root.id %>
|
||||
$("#activity_post_reply_<%= @user_activity_id %>").html("<%= escape_javascript(render :partial => 'organizations/org_document_post_reply', :locals => {:activity => @root, :user_activity_id => @user_activity_id}) %>");
|
||||
<% else %>
|
||||
window.location.href = "<%=org_document_comment_path(:id => @root.id, :organization_id => @root.organization.id) %>";
|
||||
<% end %>
|
||||
<% elsif params[:type] == 'Syllabus' %>
|
||||
$("#activity_post_reply_<%= @user_activity_id %>").html("<%= escape_javascript(render :partial => 'syllabuses/syllabus_post_reply', :locals => {:activity => @root, :user_activity_id => @user_activity_id}) %>");
|
||||
<% end %>
|
||||
sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity");
|
|
@ -0,0 +1,10 @@
|
|||
if($("#reply_message_<%= @reply.id%>").length > 0) {
|
||||
$("#reply_message_<%= @reply.id%>").replaceWith("<%= escape_javascript(render :partial => 'users/reply_to_comment', :locals => {:reply => @reply}) %>");
|
||||
$("#reply_iconup_<%=@reply.id %>").show();
|
||||
$(function(){
|
||||
sd_create_editor_from_data(<%= @reply.id%>,null,"100%", "<%=@reply.class.to_s%>");
|
||||
});
|
||||
}else if($("#reply_to_message_<%= @reply.id%>").length >0) {
|
||||
$("#reply_to_message_<%= @reply.id%>").replaceWith("<p id='reply_message_<%= @reply.id%>'></p>");
|
||||
$("#reply_iconup_<%=@reply.id %>").hide();
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
<% unless @comment.parent.nil? %>
|
||||
<% if params[:type] == 'JournalsForMessage' && (@comment.jour_type == 'Principal' || @comment.jour_type == 'Course') %>
|
||||
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/journal_comment_reply', :locals => {:comment => @comment.parent})%>");
|
||||
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/journal_comment_reply', :locals => {:comment => @comment.parent, :type => params[:type]})%>");
|
||||
<% elsif (@comment.class.to_s == 'Message' || @comment.class.to_s == 'BlogComment' || @comment.class.to_s == 'OrgDocumentComment') %>
|
||||
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/journal_comment_reply', :locals => {:comment => @comment.parent})%>");
|
||||
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/journal_comment_reply', :locals => {:comment => @comment.parent, :type => params[:type]})%>");
|
||||
<% else %>
|
||||
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/comment_reply', :locals => {:comment => @comment.parent})%>");
|
||||
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/comment_reply', :locals => {:comment => @comment.parent, :type => params[:type]})%>");
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -0,0 +1,40 @@
|
|||
<div class="syllabus_box" id="course-list">
|
||||
<div style="border-bottom: 1px solid #e7e7e7;">
|
||||
<h2 class="syllabus_h2_top fl" style="border-bottom: none;"><span class="icon_course fl mt7 mr5"></span>课程列表</h2>
|
||||
<%= link_to "返回", user_courselist_user_path(@user), :class => "linkBlue2 mt15 fr mr15 f14"%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<div id="user_archive_course_list">
|
||||
<%= render :partial => 'users/user_archive_course_list', :locals => {:syllabuses => @archive_syllabuses}%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
//如果右边的列表比左边的高度低则将右边的高度设为与左边对齐
|
||||
$(function() {
|
||||
var leftHeight = $("#LSide").height() - $(".fontGrey5").height() - 20;
|
||||
var rightHeight = $(".homepageRight").height();
|
||||
if (rightHeight < leftHeight) {
|
||||
var diffHeight = leftHeight - rightHeight;
|
||||
var tmpHeight = $(".syllabus_box").height() + diffHeight;
|
||||
$(".syllabus_box").css("minHeight", tmpHeight);
|
||||
}
|
||||
});
|
||||
function expand_courses(id, count){
|
||||
var div = $("#syllabus_courses_list_"+id);
|
||||
var classNum = div.next().children().children("li").size();
|
||||
if(classNum>0){
|
||||
div.next().toggle();
|
||||
div.children(":first-child").children(":first-child").toggleClass("icons_sy_close").toggleClass("icons_sy_open");
|
||||
} else if(count > 0) {
|
||||
var str = div.next().children().eq(0).attr('id');
|
||||
var id = str.substring(19);
|
||||
var user_id = <%= @user.id%>;
|
||||
$.get(
|
||||
'/users/'+user_id+'/expand_courses?is_delete=1&syllabus_id=' + id
|
||||
);
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1 @@
|
|||
$("#user_archive_course_list").html('<%= escape_javascript(render :partial => 'users/user_archive_course_list', :locals => {:syllabuses => @archive_syllabuses}) %>');
|
|
@ -1,5 +1,11 @@
|
|||
<div class="syllabus_box" id="course-list">
|
||||
<h2 class="syllabus_h2_top"><span class="icon_course fl mt7 mr5"></span>课程列表</h2>
|
||||
<div style="border-bottom: 1px solid #e7e7e7;">
|
||||
<h2 class="syllabus_h2_top fl" style="border-bottom: none;"><span class="icon_course fl mt7 mr5"></span>课程列表</h2>
|
||||
<% if @user == User.current && !@archive_syllabuses.blank? %>
|
||||
<%= link_to "归档管理", user_archive_courses_users_path(), :class => "linkBlue2 mt15 fr mr15 f14"%>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<%= render :partial => 'users/user_syllabus_list'%>
|
||||
<div class="" style="height:20px; background:#eaebec;"></div>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<% if @save_succ %>
|
||||
<% if @user_activity_id %>
|
||||
<% if @activity.jour_type == 'Principal' %>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
|
||||
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/user_journal_post_reply', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% elsif @activity.jour_type == 'Course' %>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
|
||||
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/user_journal_post_reply', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% end %>
|
||||
//init_activity_KindEditor_data('<%#= @user_activity_id%>', "", "87%", "UserActivity");
|
||||
sd_create_editor_from_data('<%= @user_activity_id%>', "", "100%", "UserActivity");
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<% elsif (['Principal','Project','Course', 'Bid', 'Contest', 'Softapplication','HomeworkCommon','Syllabus'].include? @journal_destroyed.jour_type)%>
|
||||
<% if @is_user%>
|
||||
<% if @activity %>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
|
||||
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/user_journal_post_reply', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
|
||||
sd_create_editor_from_data('<%= @user_activity_id%>', "", "100%", "UserActivity");
|
||||
<% else %>
|
||||
$("#user_activity_<%= @user_activity_id%>").hide();
|
||||
|
@ -19,11 +19,11 @@
|
|||
<% if @bid && @jours_count %>
|
||||
$('#jours_count').html("<%= @jours_count %>");
|
||||
<% elsif @syllabus %>
|
||||
$("#reply_banner_<%=@syllabus.id %>").replaceWith("<%=escape_javascript(render :partial => 'users/reply_banner', :locals => {:count => @count, :activity => @syllabus, :user_activity_id => @syllabus.id}) %>");
|
||||
$("#reply_div_<%=@syllabus.id %>").html("<%=escape_javascript(render :partial => 'users/news_replies', :locals => {:comments => @comments, :type => 'Syllabus', :user_activity_id => @syllabus.id, :activity_id => @syllabus.id}) %>");
|
||||
$("#activity_post_reply_<%= @syllabus.id %>").html("<%= escape_javascript(render :partial => 'syllabuses/syllabus_post_reply', :locals => {:activity => @syllabus, :user_activity_id => @syllabus.id}) %>");
|
||||
sd_create_editor_from_data(<%= @syllabus.id%>,"","100%", "<%=@syllabus.class.to_s%>");
|
||||
<% elsif @course && @jours_count%>
|
||||
<% if @user_activity_id %>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
|
||||
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/user_journal_post_reply', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
|
||||
sd_create_editor_from_data('<%= @user_activity_id%>', "", "100%", "UserActivity");
|
||||
<% else %>
|
||||
$('#course_jour_count').html("<%= @jours_count %>");
|
||||
|
@ -31,7 +31,7 @@
|
|||
<% elsif @user && @jours_count%>
|
||||
$('#jour_count').html("<%= @jours_count %>");
|
||||
<% elsif @homework%>
|
||||
$("#homework_post_reply_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/homework_post_reply', :locals => {:activity => @homework, :user_activity_id => @user_activity_id, :hw_status => @hw_status, :is_teacher => @is_teacher}) %>");
|
||||
$("#homework_post_reply_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/homework_post_reply', :locals => {:activity => @homework, :user_activity_id => @user_activity_id, :is_teacher => @is_teacher}) %>");
|
||||
<% if @user_activity_id != @homework.id %>
|
||||
sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity");
|
||||
<% else %>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$("#homework_post_reply_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/homework_post_reply', :locals => {:activity => @homework_common, :user_activity_id => @user_activity_id, :hw_status => @hw_status, :is_teacher => @is_teacher}) %>");
|
||||
$("#homework_post_reply_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/homework_post_reply', :locals => {:activity => @homework_common, :user_activity_id => @user_activity_id, :is_teacher => @is_teacher}) %>");
|
||||
<% if @user_activity_id != @homework_common.id %>
|
||||
sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity");
|
||||
<% else %>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$("#homework_post_reply_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/homework_post_reply', :locals => {:activity => @homework_common, :user_activity_id => @user_activity_id, :hw_status => @hw_status, :is_teacher => @is_teacher}) %>");
|
||||
$("#homework_post_reply_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/homework_post_reply', :locals => {:activity => @homework_common, :user_activity_id => @user_activity_id, :is_teacher => @is_teacher}) %>");
|
||||
<% if @user_activity_id != @homework_common.id %>
|
||||
sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity");
|
||||
<% else %>
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
$("#reply_banner_<%=@syllabus.id %>").replaceWith("<%=escape_javascript(render :partial => 'users/reply_banner', :locals => {:count => @count, :activity => @syllabus, :user_activity_id => @syllabus.id}) %>");
|
||||
$("#reply_div_<%=@syllabus.id %>").html("<%=escape_javascript(render :partial => 'users/news_replies', :locals => {:comments => @comments, :type => 'Syllabus', :activity_id => @syllabus.id}) %>");
|
||||
$("#activity_post_reply_<%= @syllabus.id %>").html("<%= escape_javascript(render :partial => 'syllabuses/syllabus_post_reply', :locals => {:activity => @syllabus, :user_activity_id => @syllabus.id}) %>");
|
||||
sd_create_editor_from_data(<%= @syllabus.id%>,"","100%", "<%=@syllabus.class.to_s%>");
|
||||
|
|
|
@ -573,12 +573,15 @@ RedmineApp::Application.routes.draw do
|
|||
post "user_new_homework"
|
||||
get 'new_user_commit_homework'
|
||||
get 'reply_to'
|
||||
get 'reply_to_comment'
|
||||
get 'show_all_replies'
|
||||
get 'user_messages_unviewed'
|
||||
post "user_commit_homework"
|
||||
post 'user_select_homework'
|
||||
post 'check_homework'
|
||||
get 'all_journals'
|
||||
get 'user_archive_courses'
|
||||
post 'reply_detail'
|
||||
end
|
||||
|
||||
member do
|
||||
|
|
|
@ -1407,7 +1407,7 @@ function expand_all_reply(container, btnid, id, type, div_id) {
|
|||
}
|
||||
}
|
||||
|
||||
function expand_message_reply(container, btnid, id, type, div_id, is_course, is_board) {
|
||||
function expand_reply_homework(container, btnid, id, type, div_id, user_activity_id) {
|
||||
var target = $(container);
|
||||
var btn = $(btnid);
|
||||
if (btn.data('init') == '0') {
|
||||
|
@ -1418,76 +1418,6 @@ function expand_message_reply(container, btnid, id, type, div_id, is_course, is_
|
|||
type: type,
|
||||
id: id,
|
||||
div_id: div_id,
|
||||
is_course: is_course,
|
||||
is_board: is_board
|
||||
},
|
||||
function(data) {
|
||||
|
||||
}
|
||||
);
|
||||
btn.html('收起回复');
|
||||
//target.show();
|
||||
} else if(btn.data('init') == '1') {
|
||||
btn.data('init', 3);
|
||||
btn.html('展开更多');
|
||||
target.hide();
|
||||
target.eq(0).show();
|
||||
target.eq(1).show();
|
||||
target.eq(2).show();
|
||||
}
|
||||
else {
|
||||
btn.data('init', 1);
|
||||
btn.html('收起回复');
|
||||
target.show();
|
||||
}
|
||||
}
|
||||
|
||||
function expand_blog_comment_reply(container, btnid, id, type, div_id, homepage) {
|
||||
var target = $(container);
|
||||
var btn = $(btnid);
|
||||
if (btn.data('init') == '0') {
|
||||
btn.data('init', 1);
|
||||
$.get(
|
||||
'/users/all_journals',
|
||||
{
|
||||
type: type,
|
||||
id: id,
|
||||
div_id: div_id,
|
||||
homepage: homepage
|
||||
},
|
||||
function(data) {
|
||||
|
||||
}
|
||||
);
|
||||
btn.html('收起回复');
|
||||
//target.show();
|
||||
} else if(btn.data('init') == '1') {
|
||||
btn.data('init', 3);
|
||||
btn.html('展开更多');
|
||||
target.hide();
|
||||
target.eq(0).show();
|
||||
target.eq(1).show();
|
||||
target.eq(2).show();
|
||||
}
|
||||
else {
|
||||
btn.data('init', 1);
|
||||
btn.html('收起回复');
|
||||
target.show();
|
||||
}
|
||||
}
|
||||
|
||||
function expand_reply_homework(container, btnid, id, type, div_id, hw_status, user_activity_id) {
|
||||
var target = $(container);
|
||||
var btn = $(btnid);
|
||||
if (btn.data('init') == '0') {
|
||||
btn.data('init', 1);
|
||||
$.get(
|
||||
'/users/all_journals',
|
||||
{
|
||||
type: type,
|
||||
id: id,
|
||||
div_id: div_id,
|
||||
hw_status: hw_status,
|
||||
user_activity_id: user_activity_id
|
||||
},
|
||||
function(data) {
|
||||
|
@ -2253,3 +2183,19 @@ function getIssueStatistics(url){
|
|||
|
||||
}
|
||||
|
||||
function archive_course(id, type, source){
|
||||
if(type == 0){
|
||||
var htmlvalue = '<div id="muban_popup_box" style="width:400px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||
'<div class="clear muban_popup_con"><div class="newupload_conbox newupload_tishi"><p>您是否确定归档此班级</p>' +
|
||||
'<a href="javascript:void(0);" class="btn btn-grey mt10 mr10" onclick="hideModal();">取 消</a>' +
|
||||
'<a href="/courses/'+ id +'/archive_course?source='+ source +'&type=0" class="btn btn-blue mt10" onclick="hideModal();" data-remote="true">确 定</a></div></div></div>';
|
||||
pop_box_new(htmlvalue, 400, 132);
|
||||
} else{
|
||||
var htmlvalue = '<div id="muban_popup_box" style="width:400px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||
'<div class="clear muban_popup_con"><div class="newupload_conbox newupload_tishi"><p>您和您的学生将可以重新在此班级中互动<br/>此班级的动态会在首页中显示<br/><br/>' +
|
||||
'您是否确定恢复此班级</p><a href="javascript:void(0);" class="btn btn-grey mt10 mr10" onclick="hideModal();">取 消</a>' +
|
||||
'<a href="/courses/'+ id +'/archive_course?source='+ source +'&type=1" class="btn btn-blue mt10" onclick="hideModal();" data-remote="true">确 定</a></div></div></div>';
|
||||
pop_box_new(htmlvalue, 400, 200);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -598,3 +598,9 @@ a.ex_icon_de{ background:url(/images/course/icons.png) 0px -342px no-repeat; wid
|
|||
a:hover.ex_icon_de{ background:url(/images/course/icons.png) -20px -342px no-repeat;}
|
||||
.ex_icon_edit{ background:url(/images/course/icons.png) 0px -276px no-repeat; width:16px; height:27px; display:block;float:right; margin-right:10px;}
|
||||
a:hover.ex_icon_edit{ background:url(/images/course/icons.png) -21px -276px no-repeat;}
|
||||
|
||||
/*首页课程列表归档按钮提示*/
|
||||
/*分组作业评分提示框*/
|
||||
.archive_course_notice {width:220px; position:absolute; padding:5px 10px; white-space:nowrap; background-color:#fff; right:-265px; top:-15px; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);}
|
||||
.archive_course_notice em {display:block; border-width:10px; position:absolute;top:26px; left:-20px; border-style:dashed solid dashed dashed; border-color:transparent #eaeaea transparent transparent; font-size:0; line-height:0;}
|
||||
.archive_course_notice span {display:block; border-width:10px; position:absolute;top:26px; left:-18px; border-style:dashed solid dashed dashed; border-color:transparent #fff transparent transparent; font-size:0; line-height:0;}
|
||||
|
|
|
@ -1377,6 +1377,7 @@ a.content-username:hover{ color:#297fb8;}
|
|||
.orig_user img{width:32px; height:32px;}
|
||||
.reply-right{ float:right; position:relative;}
|
||||
.reply_iconup02{ position:absolute; top:16px; left:4px; color:#d4d4d4; font-size:16px; background:#f1f1f1; line-height:13px;}
|
||||
.reply_iconup03{ position:absolute; top:16px; left:4px; color:#d4d4d4; font-size:16px; background:#FFFEF4; line-height:13px;}
|
||||
.comment_orig_content{margin:10px 0; color:#999;}
|
||||
.comment_orig_content .comment_orig_content{margin-top:0;}
|
||||
.orig_cont{ border:solid 1px #F3DDB3; background:#FFFEF4; padding:4px;color:#999;margin-top:-1px;}
|
||||
|
@ -1386,7 +1387,7 @@ a.content-username:hover{ color:#297fb8;}
|
|||
.orig_user span{ color:#999; padding-right:5px;}
|
||||
.orig_content{padding:5px 0px 5px 0px;line-height:24px; color:#333; word-wrap:break-word; }
|
||||
.orig_content img {max-width:100%;}
|
||||
.orig_right{ width:80%; margin-top:5px;}
|
||||
.orig_right{ width:90%; margin-top:5px;}
|
||||
a.comment_ding_link{ height:24px;line-height:24px;display:inline-block;padding-left:2px;vertical-align:middle; color:#333; }
|
||||
a:hover.comment_ding_link{ color:#269ac9;}
|
||||
.comment_ding_link span{display: inline-block;padding: 0 0px 0 8px;}
|
||||
|
@ -1395,7 +1396,7 @@ a:hover.comment_ding_link{ color:#269ac9;}
|
|||
.comment_reply_link:link,.comment_reply_link:visited{color:#333;text-decoration: none;}
|
||||
.comment_content{ color:#333;}
|
||||
.t_txt{ margin-top:10px;}
|
||||
.orig_reply_box{border-top:1px solid #e3e3e3; width:95%; padding:15px 0px 15px 25px;}
|
||||
.orig_reply_box{border-top:1px solid #e3e3e3; width:100%; padding:15px 0px 15px 0;}
|
||||
.orig_reply_box2{border-top:1px solid #e3e3e3; width:95%; padding:10px 25px 10px 0;}
|
||||
.orig_textarea{width:90%; margin-bottom:10px;}
|
||||
.orig_sub{ float:right; background-color:#269ac9; color:#fff; height:25px; line-height:25px; text-align:center; width:80px; border:none;}
|
||||
|
|
|
@ -65,7 +65,7 @@ input.syllabus_input_min{
|
|||
.syllabus_class_list_more{padding:8px; text-align:center;border-left:1px solid #e7e7e7;border-bottom:1px solid #e7e7e7;}
|
||||
.syllabus_class_list_more:hover{ background:#ececec;}
|
||||
.syllabus_class_list_more a{ color:#ff7e00;}
|
||||
a.syllabus_class_title{ font-size:14px; color:#333; max-width:480px; margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
|
||||
a.syllabus_class_title{ font-size:14px; color:#333; max-width:520px; margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
|
||||
.syllabus_class_w{ width:650px;}
|
||||
.syllabus_class_property {font-size:12px; padding:0 5px; border-radius:3px; line-height:14px;}
|
||||
.syllabus_class_private {color:#ff4a1b; border:1px solid #ff4a1b;}
|
||||
|
|
Loading…
Reference in New Issue