Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into dai_ao
This commit is contained in:
commit
636721699e
|
@ -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]
|
||||
|
|
|
@ -601,6 +601,13 @@ class ProjectsController < ApplicationController
|
|||
def member_forked
|
||||
@forked_projects = Project.where(:forked_from_project_id => @project.id)
|
||||
|
||||
@limit = 20
|
||||
@is_remote = true
|
||||
@forked_count = @project.forked_count
|
||||
@forked_pages = Paginator.new @forked_count, @limit, params['page'] || 1
|
||||
@offset ||= @forked_pages.offset
|
||||
@forked_projects = paginateHelper @forked_projects, @limit
|
||||
|
||||
# @forked_members = User.find_by_sql("SELECT u.* FROM `projects` p,`users` u where p.user_id = u.id and p.forked_from_project_id = #{@project.id} ;")
|
||||
end
|
||||
|
||||
|
@ -664,7 +671,13 @@ class ProjectsController < ApplicationController
|
|||
end
|
||||
|
||||
def statistics
|
||||
|
||||
@watchers = @project.watcher_users
|
||||
@limit = 20
|
||||
@is_remote = true
|
||||
@watchers_count = @watchers.count
|
||||
@watcher_pages = Paginator.new @watchers_count, @limit, params['page'] || 1
|
||||
@offset ||= @watcher_pages.offset
|
||||
@watchers = paginateHelper @watchers, 20
|
||||
end
|
||||
#end
|
||||
|
||||
|
@ -972,14 +985,6 @@ class ProjectsController < ApplicationController
|
|||
else
|
||||
@users -= watched.watcher_users if @watched
|
||||
end
|
||||
@watchers = @project.watcher_users
|
||||
@limit = 20
|
||||
@is_remote = true
|
||||
@watchers_count = @watchers.count
|
||||
@watcher_pages = Paginator.new @watchers_count, @limit, params['page'] || 1
|
||||
@offset ||= @watcher_pages.offset
|
||||
#@curse_attachments_all = @all_attachments[@offset, @limit]
|
||||
@watchers = paginateHelper @watchers,20
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -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?
|
||||
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' %>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class = "cl"> </div>
|
||||
<div id="blog-list">
|
||||
<div class="listbox mt10" >
|
||||
<h2 class="list-h2">博客列表</h2>
|
||||
<p class="list-h2">博客列表</p>
|
||||
<div class="category">
|
||||
<span class="grayTxt ">排序:</span>
|
||||
<%= link_to "时间", {:controller => 'blogs', :action => 'index', :id =>@user, :type => @type, :sort => @b_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
|
||||
|
@ -21,9 +21,9 @@
|
|||
<ul class="list-file">
|
||||
<li><span class="item_list fl"></span>
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.title.to_s.html_safe, user_blog_blog_comment_path(:user_id=> activity.author, :blog_id=>activity.blog.id,:id=>activity), :class=> "list-title fl" %>
|
||||
<%= link_to activity.title.to_s.html_safe, user_blog_blog_comment_path(:user_id=> activity.author, :blog_id=>activity.blog.id,:id=>activity), :class=> "list-title-normal fl" %>
|
||||
<% else %>
|
||||
<%= link_to activity.title.subject.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author, :blog_id=>activity.blog.id,:id=>activity), :class=> "list-title fl"%>
|
||||
<%= link_to activity.title.subject.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author, :blog_id=>activity.blog.id,:id=>activity), :class=> "list-title-normal fl"%>
|
||||
<% end %>
|
||||
<%# if activity.blog.homepage_id and activity.id == activity.blog.homepage_id %>
|
||||
<!--<span class="font_normal ml10 fr">[已设为首页]</span>-->
|
||||
|
@ -36,7 +36,8 @@
|
|||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% count=BlogComment.where("root_id = #{activity.id}").count%> <li class="ml15">
|
||||
<% count=BlogComment.where("root_id = #{activity.id}").count%>
|
||||
<li class="ml15">
|
||||
<span class="grayTxt">发布:<%= format_time(activity.created_on) %></span>
|
||||
<span class="grayTxt">更新:<%= format_time(activity.updated_on) %></span>
|
||||
<p class="list-info fr grayTxt">
|
||||
|
|
|
@ -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 %>
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
<h2 class="project_h2 fl"><%= @subPage_title%></h2>
|
||||
<% if User.current.allowed_to?(:as_teacher,@course) %>
|
||||
<span class="fr f14 fontGrey2" style="height: 40px; line-height: 40px; margin-right: 15px;">
|
||||
<%=link_to "成员管理", :controller => 'courses', :action => 'settings', :id => @course.id, :tab=>'member', :class => 'hw_more_li' %>
|
||||
<%=link_to "成员管理", {:controller => 'courses', :action => 'settings', :id => @course.id, :tab=>'member'}, :class => 'hw_more_li' %>
|
||||
</span>
|
||||
<% end %>
|
||||
</div>
|
||||
|
@ -13,21 +13,12 @@
|
|||
<% else %>
|
||||
<div class="sy_class_r sy_class_nobg fr ml10">
|
||||
<div class="sy_class_r_head mb10">
|
||||
<h3><%= @subPage_title %></h3>
|
||||
<div class="hw_more_box">
|
||||
<ul>
|
||||
<li class="hw_more_icons">
|
||||
<ul class="hw_more_txt">
|
||||
<li><%= link_to l(:label_export_excel), export_course_member_excel_course_path(@course,:format => 'xls'), :class => 'hw_more_li'%></li>
|
||||
<h3 class="fl"><%= @subPage_title %></h3>
|
||||
<% if User.current.allowed_to?(:as_teacher,@course) %>
|
||||
<li>
|
||||
<%=link_to "成员管理", {:controller => 'courses', :action => 'settings', :id => @course.id, :tab => 'member'}, :class => 'hw_more_li' %>
|
||||
</li>
|
||||
<%=link_to "成员管理", {:controller => 'courses', :action => 'settings', :id => @course.id, :tab => 'member'}, :class => 'link-blue ml10 fr mt5' %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%= link_to l(:label_export_excel), export_course_member_excel_course_path(@course,:format => 'xls'), :class => 'link-blue fr mt5'%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<%= render :partial => 'course_student', :locals => {:members => @members} %>
|
||||
</div>
|
||||
|
|
|
@ -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,8 +11,6 @@
|
|||
<span>测验时长:<%= exercise.time %>分钟</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<pre class="fontGrey2 font_cus" style="white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:pre-wrap;white-space:-o-pre-wrap;word-break:normal;word-wrap: break-word;">
|
||||
<%= exercise.exercise_description.nil? ? "" :exercise.exercise_description.html_safe%>
|
||||
</pre>
|
||||
<pre class="fontGrey2 font_cus" style="white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:pre-wrap;white-space:-o-pre-wrap;word-break:normal;word-wrap: break-word;"><%= exercise.exercise_description.nil? ? "" :exercise.exercise_description.html_safe%></pre>
|
||||
<div class="cl"></div>
|
||||
</div>
|
|
@ -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 id="activity_post_reply_<%=user_activity_id %>">
|
||||
<%=render :partial => 'organizations/org_message_post_reply', :locals => {:activity => activity, :user_activity_id => user_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=>'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>
|
||||
|
||||
</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 id="activity_post_reply_<%=user_activity_id %>">
|
||||
<%=render :partial => 'projects/project_message_post_reply', :locals => {:activity => activity, :user_activity_id => user_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_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>
|
||||
</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 %>
|
||||
|
|
|
@ -14,4 +14,14 @@
|
|||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div style="text-align:center;">
|
||||
<div class="pages" style="width:auto; display:inline-block;">
|
||||
<ul id="homework_pository_ref_pages">
|
||||
<%= pagination_links_full @forked_pages, @forked_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -18,10 +18,12 @@
|
|||
<span style="display: none" class="c_orange ml100" id="valid_repository_name">版本库名是无效的</span>
|
||||
</li>
|
||||
<li class="clear">
|
||||
<!-- <label class=" fl"> </label>-->
|
||||
<p class=" fl c_grey pro_new_grey">1.长度必须在1到254个字符之间<br/>
|
||||
<label class=" fl"> </label>
|
||||
<p class=" fl c_grey pro_new_grey">
|
||||
1.长度必须在1到254个字符之间<br/>
|
||||
2.仅限使用小写字母(a-z)、数字、破折号(-)和下划线(_)<br>
|
||||
3.一旦保存,标识无法修改</p>
|
||||
3.一旦保存,标识无法修改
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
<a href="javascript:void(0)" onclick="cancel_for_create();" class="fr sy_btn_grey"><%=l(:button_cancel)%></a>
|
||||
|
|
|
@ -14,15 +14,16 @@
|
|||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div style="text-align:center;">
|
||||
<div style="text-align:center;">
|
||||
<div class="pages" style="width:auto; display:inline-block;">
|
||||
<ul id="homework_pository_ref_pages">
|
||||
<%= pagination_links_full @watcher_pages, @watchers_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -27,7 +27,13 @@
|
|||
<div class="flex-cell student_work_<%= st.id%>">
|
||||
<div class="<%= score_color st.student_score%> student_score_info pr">
|
||||
<% if st.student_score.nil? %>
|
||||
<% if @homework.homework_detail_manual.comment_status == 2 && st.student_works_evaluation_distributions.count != 0 %>
|
||||
<span title="该作品未被匿评">待匿评</span>
|
||||
<% elsif @homework.homework_detail_manual.comment_status == 3 && st.student_works_evaluation_distributions.count != 0 %>
|
||||
<span title="该作品未被匿评">缺评</span>
|
||||
<% else %>
|
||||
<span title="该作品未被匿评">未参与</span>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= format("%.1f", st.student_score) %>
|
||||
<% end %>
|
||||
|
|
|
@ -14,28 +14,31 @@
|
|||
<div class="pr">
|
||||
<span class="fl ml25 fontGrey2">关联项目:</span>
|
||||
<div class="fl projectName">
|
||||
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? || User.current.allowed_to?(:as_teacher, @homework.course) %>
|
||||
<% if student_work.project.status != 9 && (student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? || User.current.allowed_to?(:as_teacher, @homework.course)) %>
|
||||
<%= link_to student_work.project.name, project_path(student_work.project.id), :class => 'link-blue fl hidden', :style => "max-width:550px;", :title => "项目名称", :target => "_blank" %>
|
||||
<% else %>
|
||||
<% elsif student_work.project.status != 9 %>
|
||||
<span class="fontBlue fr hidden" style="max-width:550px;" title="该项目是私有的"><%= student_work.project.name %></span>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<span class="fontGrey2 fr hidden" style="max-width:550px;" title="该项目已删除"><%= student_work.project.name %>(已删除)</span><% end %>
|
||||
<% project = student_work.project %>
|
||||
<div class="score-tip none tl f12" style="width:300px; top:-48px; right:-372px;">
|
||||
<em style="bottom:45px;"></em>
|
||||
<font style="bottom:45px;"></font>
|
||||
|
||||
<p class="fb break_word mw280"><%= project.name %></p>
|
||||
<p class="fb break_word mw280"><%= project.name %><%= project.status == 9 ? "(已删除)" : ""%></p>
|
||||
|
||||
<p class="mb10">
|
||||
<span class="mr15">创建者:<%= project.creater %></span><span>成员数量:<%= project.members.count %></span></p>
|
||||
<% project_score = project.project_score %>
|
||||
<p>项目综合得分:<%= static_project_score(project_score).to_i %></p>
|
||||
<p>项目综合得分:<%= project.status == 9 ? 0 : static_project_score(project_score).to_i %></p>
|
||||
|
||||
<% if project.status != 9 %>
|
||||
<p>= 代码提交得分 + issue得分 + 资源得分 + 帖子得分</p>
|
||||
|
||||
<p>= <%= (project_score.changeset_num||0) * 4 %>
|
||||
+ <%= project_score.issue_num * 4 + project_score.issue_journal_num %> + <%= project_score.attach_num * 5 %>
|
||||
+ <%= project_score.board_num * 2 + project_score.board_message_num + project_score.news_num %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -69,7 +69,13 @@
|
|||
<% if @homework.anonymous_comment == 0%>
|
||||
<td class="hworkList70 <%= score_color student_work.student_score%> student_score_info pr">
|
||||
<% if student_work.student_score.nil? %>
|
||||
<% if @homework.homework_detail_manual.comment_status == 2 && student_work.student_works_evaluation_distributions.count != 0 %>
|
||||
<span title="该作品未被匿评">待匿评</span>
|
||||
<% elsif @homework.homework_detail_manual.comment_status == 3 && student_work.student_works_evaluation_distributions.count != 0 %>
|
||||
<span title="该作品未被匿评">缺评</span>
|
||||
<% else %>
|
||||
<span title="该作品未被匿评">未参与</span>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%=format("%.1f",student_work.student_score) %>
|
||||
<% end %>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
<div class="syllabus_courses_box">
|
||||
<% projects.each do |project|%>
|
||||
<% allow_visit = project.is_public || User.current.member_of?(project) || User.current.admin? || User.current.allowed_to?(:as_teacher, @homework.course) %>
|
||||
<% allow_visit = project.status != 9 && (project.is_public || User.current.member_of?(project) || User.current.admin? || User.current.allowed_to?(:as_teacher, @homework.course)) %>
|
||||
<div class="syllabus_courses_list" style="cursor: default">
|
||||
<div class="sy_courses_open">
|
||||
<h3>
|
||||
<% if allow_visit %>
|
||||
<%= link_to "#{project.name}", project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
|
||||
<% else %>
|
||||
<% elsif project.status != 9 %>
|
||||
<a href="javascript:void(0)" class="new_project_title fl" title="私有项目不可访问"><%=project.name %></a>
|
||||
<% else %>
|
||||
<a href="javascript:void(0)" class="new_project_title fl" title="项目已删除"><%=project.name %></a>
|
||||
<% end %>
|
||||
</h3>
|
||||
<span class="<%= project.is_public? ? 'syllabus_class_open' : 'syllabus_class_private' %> fl ml10 mt3 syllabus_class_property"><%= project.is_public? ? '公开' : '私有' %></span>
|
||||
|
|
|
@ -36,8 +36,8 @@
|
|||
<% end %>
|
||||
<span class="<%= course.is_public == 0 ? 'hw_icon_private' : 'hw_icon_open' %> fl mr20 mt3"></span>
|
||||
<div class="cl"></div>
|
||||
<p class="sy_cgrey">
|
||||
<span class=" mr15">创建老师:<%=link_to course.teacher.show_name, user_path(course.teacher), :class => 'sy_cblue' %></span>
|
||||
<div class="sy_cgrey">
|
||||
<p class="mr15 hidden fl" style="max-width: 140px;">创建老师:<%=link_to course.teacher.show_name, user_path(course.teacher), :class => 'sy_cblue', :title => "#{course.teacher.show_name}" %></p>
|
||||
<% if User.current.admin? || User.current.allowed_to?(:as_teacher,course) %>
|
||||
<% homework_num = course.homework_commons.count %>
|
||||
<% else %>
|
||||
|
@ -59,7 +59,7 @@
|
|||
</span>
|
||||
<span class=" mr15">学期:<%= current_time_and_term course %></span>
|
||||
<span class=" mr15">更新时间:<%= format_date(course.updated_on) %></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<% if @list_type == 0 %>
|
||||
<% if User.current.member_of_course?(course) %>
|
||||
|
@ -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>
|
|
@ -1,7 +1,7 @@
|
|||
<div class = "cl"> </div>
|
||||
<div id="course-boardlist">
|
||||
<div class="listbox mt10" >
|
||||
<h2 class="list-h2">讨论区列表</h2>
|
||||
<p class="list-h2">讨论区列表</p>
|
||||
<div class="category">
|
||||
<span class="grayTxt ">排序:</span>
|
||||
<%= link_to "时间", {:controller => 'boards', :action => 'index', :board_id =>@board.id, :type => @type, :sort => @b_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
|
||||
|
@ -20,9 +20,9 @@
|
|||
<div class="list-file">
|
||||
<div><span class="item_list fl"></span>
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, User.current.logged? ? board_message_path(activity.board_id, activity) : signin_url_without_domain, :class => "list-title fl" %>
|
||||
<%= link_to activity.subject.to_s.html_safe, User.current.logged? ? board_message_path(activity.board_id, activity) : signin_url_without_domain, :class => "list-title-normal fl" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, User.current.logged? ? board_message_path(activity.board_id, activity) : signin_url_without_domain, :class => "list-title f1" %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, User.current.logged? ? board_message_path(activity.board_id, activity) : signin_url_without_domain, :class => "list-title-normal f1" %>
|
||||
<% end %>
|
||||
<% if activity.sticky == 1 %>
|
||||
<span class="fl ml10 red-cir-btn">顶</span>
|
||||
|
@ -30,20 +30,20 @@
|
|||
<% if activity.locked %>
|
||||
<span class="fl ml10 green-cir-btn" title="已锁定">锁</span>
|
||||
<% end %>
|
||||
<% u = User.where("id=?",activity.author_id).first%>
|
||||
<%# u = User.where("id=?",activity.author_id).first%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="massages-content ml15">
|
||||
<% if activity.parent_id.nil? %>
|
||||
<% content = activity.content %>
|
||||
<% else %>
|
||||
<% content = activity.parent.content %>
|
||||
<% end %>
|
||||
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>75, :maxwidth=>563} %></p>
|
||||
</div>
|
||||
<!--<div class="massages-content ml15">-->
|
||||
<!--<%# if activity.parent_id.nil? %>-->
|
||||
<!--<% content = activity.content %>-->
|
||||
<!--<%# else %>-->
|
||||
<!--<%# content = activity.parent.content %>-->
|
||||
<!--<%# end %>-->
|
||||
<!--<p><%#=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>75, :maxwidth=>563} %></p>-->
|
||||
<!--</div>-->
|
||||
<div class="ml15 mt10">
|
||||
<span class="grayTxt">
|
||||
发帖人: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
|
||||
<span class="grayTxt mr15">
|
||||
发帖人:<%= link_to activity.author.show_name, user_path(activity.author), :class => "link-blue" %>
|
||||
</span>
|
||||
<span class="grayTxt">更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %></span>
|
||||
<% all_comments = []%>
|
||||
|
|
|
@ -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 %>
|
||||
<% if !activity.end_time.nil? %>
|
||||
<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>
|
||||
<% 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 id="activity_post_reply_<%=user_activity_id %>">
|
||||
<%=render :partial => 'users/course_message_post_reply', :locals => {:activity => activity, :user_activity_id => user_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, :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>
|
||||
</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 id="activity_post_reply_<%=user_activity_id %>">
|
||||
<%=render :partial => 'users/course_news_post_reply', :locals => {:activity => activity, :user_activity_id => user_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>
|
||||
</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,7 +1,7 @@
|
|||
<div class = "cl"> </div>
|
||||
<div id="course-newslist">
|
||||
<div class="listbox mt10" >
|
||||
<h2 class="list-h2">通知列表</h2>
|
||||
<p class="list-h2">通知列表</p>
|
||||
<div class="category">
|
||||
<span class="grayTxt ">排序:</span>
|
||||
<%= link_to "时间", {:controller => 'news', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
|
||||
|
@ -19,18 +19,19 @@
|
|||
<% topics.each do |activity| %>
|
||||
<div class="list-file">
|
||||
<div><span class="item_list fl"></span>
|
||||
<%= link_to activity.title.to_s, User.current.logged? ? news_path(activity) : signin_url_without_domain, :class => "list-title fl" %>
|
||||
<%= link_to activity.title.to_s, User.current.logged? ? news_path(activity) : signin_url_without_domain, :class => "list-title-normal fl" %>
|
||||
<% if activity.sticky == 1 %>
|
||||
<span class="fl ml10 red-cir-btn">顶</span>
|
||||
<% end%>
|
||||
<% u = User.where("id=?",activity.author_id).first%> <div class="cl"></div>
|
||||
</div>
|
||||
<div class="massages-content ml15">
|
||||
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>activity.description, :maxheight=>54, :maxwordsnum=>100, :maxwidth=>563} %></p>
|
||||
<% u = User.where("id=?",activity.author_id).first%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<!--<div class="massages-content ml15">-->
|
||||
<!--<p><%#=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>activity.description, :maxheight=>54, :maxwordsnum=>100, :maxwidth=>563} %></p>-->
|
||||
<!--</div>-->
|
||||
<div class="ml15 mt10">
|
||||
<span class="grayTxt">
|
||||
发布者: <%= activity.author.show_name %>
|
||||
<span class="grayTxt mr15">
|
||||
发布者:<%= link_to activity.author.show_name, user_path(activity.author), :class => "link-blue" %>
|
||||
</span>
|
||||
<span class="grayTxt">更新:<%= format_time(activity.course_acts.first.try(:updated_at)) %></span>
|
||||
<% count=0 %>
|
||||
|
|
|
@ -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,7 +1,7 @@
|
|||
<div class = "cl"> </div>
|
||||
<div id="project-boardlist">
|
||||
<div class="container-big mt10" >
|
||||
<h2 class="list-h2">讨论区列表</h2>
|
||||
<p class="list-h2">讨论区列表</p>
|
||||
<div class="category">
|
||||
<span class="grayTxt ">排序:</span>
|
||||
<%= link_to "时间", {:controller => 'boards', :action => 'index', :type => @type, :sort => @b_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
|
||||
|
@ -20,9 +20,9 @@
|
|||
<div class="list-file">
|
||||
<div><span class="item_list fl"></span>
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, User.current.logged? ? board_message_path(activity.board_id, activity) : signin_url_without_domain, :class=> "list-title fl", :style => "max-width:950px;" %>
|
||||
<%= link_to activity.subject.to_s.html_safe, User.current.logged? ? board_message_path(activity.board_id, activity) : signin_url_without_domain, :class=> "list-title-normal fl", :style => "max-width:950px;" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, User.current.logged? ? board_message_path(activity.board_id, activity) : signin_url_without_domain, :class=> "list-title f1", :style => "max-width:950px;" %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, User.current.logged? ? board_message_path(activity.board_id, activity) : signin_url_without_domain, :class=> "list-title-normal f1", :style => "max-width:950px;" %>
|
||||
<% end %>
|
||||
<% if activity.sticky == 1 %>
|
||||
<span class="fl ml10 red-cir-btn">顶</span>
|
||||
|
@ -30,20 +30,20 @@
|
|||
<% if activity.locked %>
|
||||
<span class="fl ml10 green-cir-btn" title="已锁定">锁</span>
|
||||
<% end %>
|
||||
<% u = User.where("id=?",activity.author_id).first%>
|
||||
<%# u = User.where("id=?",activity.author_id).first%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="ml15">
|
||||
<% if activity.parent_id.nil? %>
|
||||
<% content = activity.content %>
|
||||
<% else %>
|
||||
<% content = activity.parent.content %>
|
||||
<% end %>
|
||||
<p><%=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>225, :maxwidth=>950} %></p>
|
||||
</div>
|
||||
<!--<div class="ml15">-->
|
||||
<!--<%# if activity.parent_id.nil? %>-->
|
||||
<!--<%# content = activity.content %>-->
|
||||
<!--<%# else %>-->
|
||||
<!--<%# content = activity.parent.content %>-->
|
||||
<!--<%# end %>-->
|
||||
<!--<p><%#=render :partial =>"users/intro_content_ex", :locals=>{:user_activity_id =>activity.id, :content=>content, :maxheight=>54, :maxwordsnum=>225, :maxwidth=>950} %></p>-->
|
||||
<!--</div>-->
|
||||
<div class="ml15 mt10 f12">
|
||||
<span class="grayTxt">
|
||||
发帖人:<%=(u.try(:realname) != " " ? u.try(:lastname) + u.try(:firstname) : u.try(:login)) unless u.nil? %>
|
||||
<span class="grayTxt mr15">
|
||||
发帖人:<%= link_to activity.author.show_name, user_path(activity.author), :class => "link-blue" %>
|
||||
</span>
|
||||
<span class="grayTxt">更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %></span>
|
||||
<% all_comments = []%>
|
||||
|
|
|
@ -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 id="activity_post_reply_<%=user_activity_id %>">
|
||||
<%=render :partial => 'users/course_message_post_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %>
|
||||
</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>
|
||||
</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 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 %>
|
||||
|
||||
<% 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 %>
|
||||
</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 %>
|
|
@ -1,5 +1,5 @@
|
|||
<div class="listbox" id="course-list">
|
||||
<h2 class="list-h2">课程列表</h2>
|
||||
<p class="list-h2">课程列表</p>
|
||||
<div class="category">
|
||||
<span class="grayTxt ">排序:</span>
|
||||
<%= link_to "时间", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
|
||||
|
@ -19,7 +19,7 @@
|
|||
<ul class="list-file">
|
||||
<li>
|
||||
<span class="item_list fl"></span>
|
||||
<%= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), :class => "list-title fl #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
|
||||
<%= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), :class => "list-title-normal fl #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
|
||||
:style => 'color:#000',:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+"("+current_time_and_term(course)+")"%>
|
||||
<% teacher = User.where("id=?",course.tea_id).first%>
|
||||
<span class="fr grayTxt">
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
|
||||
|
||||
<div class="listbox" id="project-list">
|
||||
<h2 class="list-h2">项目列表</h2>
|
||||
<p class="list-h2">项目列表</p>
|
||||
<div class="category">
|
||||
<span class="grayTxt ">排序:</span>
|
||||
<%= link_to "时间", {:controller => 'users', :action => 'user_projectlist', :id =>@user, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt", :remote => true %>
|
||||
|
@ -102,7 +102,7 @@
|
|||
<ul class="list-file">
|
||||
<li>
|
||||
<span class="item_list fl"></span>
|
||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "list-title fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
|
||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "list-title-normal fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
|
||||
<% projectUser = User.where("id=?",project.user_id).first%>
|
||||
<span class="fr grayTxt">
|
||||
<%='创建者:'+(projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)) %>
|
||||
|
|
|
@ -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}) %>');
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue