Merge branch 'develop' into weixin_guange
This commit is contained in:
commit
51918e1340
|
@ -82,7 +82,7 @@ class AdminController < ApplicationController
|
|||
syllabus.update_attributes(:title => params[:title], :eng_name => params[:eng_name], :user_id => @user.id)
|
||||
syllabus.description = Message.where("id = 19412").first.nil? ? nil : Message.where("id = 19412").first.content
|
||||
if syllabus.save
|
||||
course.update_attribute('syllabus_id', syllabus.id)
|
||||
course.update_column('syllabus_id', syllabus.id)
|
||||
@flag = params[:flag].to_i
|
||||
@course = course
|
||||
respond_to do |format|
|
||||
|
@ -96,7 +96,7 @@ class AdminController < ApplicationController
|
|||
def courses
|
||||
@name = params[:name].to_s.strip.downcase
|
||||
if @name && @name != ""
|
||||
@courses = Course.select{ |course| (course.teacher[:lastname].to_s.downcase + course.teacher[:firstname].to_s.downcase).include?(@name) || course.name.include?(@name)}
|
||||
@courses = Course.select{ |course| course.teacher && ((course.teacher.show_name).include?(@name) || course.name.include?(@name))}
|
||||
@courses = @courses.sort{|x, y| y.created_at <=> x.created_at}
|
||||
else
|
||||
@courses = Course.order('created_at desc')
|
||||
|
@ -135,6 +135,17 @@ class AdminController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
#修改课程名称
|
||||
def update_syllabus_title
|
||||
@syllabus = Syllabus.where("id = #{params[:syllabus_id].to_i}").first
|
||||
unless @syllabus.nil?
|
||||
@syllabus.update_column("title", params[:name])
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#管理员界面精品课程列表
|
||||
def excellent_courses
|
||||
@courses = Course.where("is_excellent =? or excellent_option =?", 1, 1 )
|
||||
|
|
|
@ -47,6 +47,8 @@ class AtController < ApplicationController
|
|||
find_journals_for_message(id)
|
||||
when 'Principal'
|
||||
find_principal(id)
|
||||
when 'BlogComment'
|
||||
find_blog_comment(id)
|
||||
when 'All'
|
||||
nil
|
||||
else
|
||||
|
@ -166,8 +168,8 @@ class AtController < ApplicationController
|
|||
|
||||
#BlogComment
|
||||
def find_blog_comment(id)
|
||||
blog = BlogComment.find(id).blog
|
||||
blog.users
|
||||
blog = BlogComment.find(id)
|
||||
blog.author.watcher_users
|
||||
end
|
||||
|
||||
end
|
|
@ -70,6 +70,10 @@ class BlogCommentsController < ApplicationController
|
|||
@course.outline = 0
|
||||
@course.save
|
||||
redirect_to course_path(:id=>params[:course_id])
|
||||
elsif params[:user_activity_id]
|
||||
@article.children.destroy
|
||||
@article.destroy
|
||||
redirect_to user_path(User.current.id)
|
||||
else
|
||||
@article.children.destroy
|
||||
@article.destroy
|
||||
|
@ -80,6 +84,17 @@ class BlogCommentsController < ApplicationController
|
|||
if params[:course_id] #如果带了course_id过来了,那么这是要跳到课程大纲去的
|
||||
@article.destroy
|
||||
redirect_to syllabus_course_path(:id=>params[:course_id])
|
||||
elsif params[:user_activity_id]
|
||||
if params[:homepage] && params[:homepage] == "1"
|
||||
@in_user_homepage = true
|
||||
end
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
@blog_comment = @article.root
|
||||
@article.destroy
|
||||
respond_to do |format|
|
||||
format.js
|
||||
return
|
||||
end
|
||||
else
|
||||
root = @article.root
|
||||
@article.destroy
|
||||
|
@ -102,13 +117,9 @@ class BlogCommentsController < ApplicationController
|
|||
|
||||
def quote
|
||||
@blogComment = BlogComment.find(params[:id])
|
||||
@subject = @blogComment.title
|
||||
@subject = "RE: #{@subject}" unless @subject.starts_with?('RE:')
|
||||
|
||||
@content = "> #{ll(Setting.default_language, :text_user_wrote, @blogComment.author.realname)}\n> "
|
||||
@temp = BlogComment.new
|
||||
@course_id = params[:course_id]
|
||||
@temp.content = "<blockquote>#{ll(Setting.default_language, :text_user_wrote, @blogComment.author.realname)} <br/>#{@blogComment.content.html_safe}</blockquote>".html_safe
|
||||
respond_to do | format|
|
||||
format.js
|
||||
end
|
||||
|
@ -116,23 +127,30 @@ class BlogCommentsController < ApplicationController
|
|||
|
||||
#回复
|
||||
def reply
|
||||
if params[:homepage]
|
||||
if params[:homepage] && params[:homepage] == "1"
|
||||
@in_user_homepage = true
|
||||
end
|
||||
if params[:in_user_center]
|
||||
@in_user_center = true
|
||||
end
|
||||
@article = BlogComment.find(params[:id]).root
|
||||
@quote = params[:quote][:quote]
|
||||
@blogComment = BlogComment.new
|
||||
@blogComment.author = User.current
|
||||
@blogComment.blog = Blog.find(params[:blog_id])
|
||||
params[:blog_comment][:sticky] = params[:blog_comment][:sticky] || 0
|
||||
params[:blog_comment][:locked] = params[:blog_comment][:locked] || 0
|
||||
@blogComment.safe_attributes = params[:blog_comment]
|
||||
@blogComment.content = @quote + @blogComment.content
|
||||
@blogComment.title = "RE: #{@article.title}" unless params[:blog_comment][:title]
|
||||
if params[:parent_id]
|
||||
@blogComment.content = params[:blog_comment][:content]
|
||||
parent = BlogComment.find params[:parent_id]
|
||||
@blogComment.reply_id = params[:reply_id]
|
||||
parent.children << @blogComment
|
||||
else
|
||||
@quote = params[:quote][:quote] || ""
|
||||
@blogComment.content = @quote + @blogComment.content
|
||||
@article.children << @blogComment
|
||||
end
|
||||
@article.save
|
||||
# @article.update_attribute(:updated_on, @blogComment.updated_on)
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
|
|
|
@ -971,7 +971,7 @@ class CoursesController < ApplicationController
|
|||
|
||||
@homework = HomeworkCommon.find params[:homework]
|
||||
#order("#{@order} #{@b_sort}"
|
||||
@student_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").order("simi_value desc"),@name
|
||||
@student_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").order("simi_value desc").has_committed,@name
|
||||
|
||||
@works_hash = {}
|
||||
|
||||
|
|
|
@ -432,14 +432,15 @@ class IssuesController < ApplicationController
|
|||
|
||||
def add_journal
|
||||
if User.current.logged?
|
||||
jour = Journal.new
|
||||
jour.user_id = User.current.id
|
||||
jour.notes = params[:notes]
|
||||
jour.journalized = @issue
|
||||
jour.save_attachments(params[:attachments])
|
||||
jour.save
|
||||
@jour = Journal.new
|
||||
@jour.user_id = User.current.id
|
||||
@jour.notes = params[:notes]
|
||||
@jour.journalized = @issue
|
||||
@jour.save_attachments(params[:attachments])
|
||||
@jour.save
|
||||
update_user_activity(@issue.class,@issue.id)
|
||||
update_forge_activity(@issue.class,@issue.id)
|
||||
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
|
||||
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
if params[:issue_id]
|
||||
|
@ -492,7 +493,7 @@ class IssuesController < ApplicationController
|
|||
update_forge_activity(@issue.class,@issue.id)
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html{redirect_to issue_url(@issue)}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -502,7 +503,7 @@ class IssuesController < ApplicationController
|
|||
@issue = Issue.find(params[:id])
|
||||
Journal.destroy(params[:journal_id])
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html{redirect_to issue_url(@issue)}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -123,10 +123,14 @@ class OrgDocumentCommentsController < ApplicationController
|
|||
def destroy
|
||||
@org_document_comment = OrgDocumentComment.find(params[:id])
|
||||
@org_sub_id = @org_document_comment.org_subfield_id
|
||||
org = @org_document_comment.organization
|
||||
org = @org_document_comment.root.organization
|
||||
if @org_document_comment.id == org.home_id
|
||||
org.update_attributes(:home_id => nil)
|
||||
end
|
||||
if params[:user_activity_id]
|
||||
@act = OrgActivity.find(params[:user_activity_id])
|
||||
@document = @org_document_comment.root
|
||||
end
|
||||
if @org_document_comment.destroy
|
||||
end
|
||||
respond_to do |format|
|
||||
|
@ -145,48 +149,26 @@ class OrgDocumentCommentsController < ApplicationController
|
|||
end
|
||||
def quote
|
||||
@org_comment = OrgDocumentComment.find(params[:id])
|
||||
@subject = @org_comment.content
|
||||
@subject = "RE: #{@subject}" unless @subject.starts_with?('RE:')
|
||||
|
||||
@content = "> #{ll(Setting.default_language, :text_user_wrote, User.find(@org_comment.creator_id).realname)}\n> "
|
||||
@temp = OrgDocumentComment.new
|
||||
#@course_id = params[:course_id]
|
||||
@temp.content = "<blockquote>#{ll(Setting.default_language, :text_user_wrote, User.find(@org_comment.creator_id).realname)} <br/>#{@org_comment.content.html_safe}</blockquote>".html_safe
|
||||
respond_to do | format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def reply
|
||||
@document = OrgDocumentComment.find(params[:id]).root
|
||||
@quote = params[:quote][:quote]
|
||||
@document = OrgDocumentComment.find(params[:id])
|
||||
@org_document = OrgDocumentComment.new(:creator_id => User.current.id, :reply_id => params[:id])
|
||||
|
||||
# params[:blog_comment][:sticky] = params[:blog_comment][:sticky] || 0
|
||||
# params[:blog_comment][:locked] = params[:blog_comment][:locked] || 0
|
||||
@org_document.title = params[:org_document_comment][:title]
|
||||
@org_document.content = params[:org_document_comment][:content]
|
||||
@org_document.content = @quote + @org_document.content
|
||||
#@org_document.title = "RE: #{@article.title}" unless params[:blog_comment][:title]
|
||||
|
||||
@document.children << @org_document
|
||||
# @user_activity_id = params[:user_activity_id]
|
||||
# user_activity = UserActivity.where("act_type='BlogComment' and act_id =#{@article.id}").first
|
||||
# if user_activity
|
||||
# user_activity.updated_at = Time.now
|
||||
# user_activity.save
|
||||
# end
|
||||
# attachments = Attachment.attach_files(@org_document, params[:attachments])
|
||||
# render_attachment_warning_if_needed(@org_document)
|
||||
#@article.save
|
||||
# redirect_to user_blogs_path(:user_id=>params[:user_id])
|
||||
@document = @document.root
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
@act = OrgActivity.find(@user_activity_id) if @user_activity_id
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
# if params[:course_id] #如果呆了course_id过来了,那么这是要跳到课程大纲去的
|
||||
# redirect_to syllabus_course_path(:id=>params[:course_id])
|
||||
# else
|
||||
redirect_to org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id)
|
||||
# end
|
||||
|
||||
}
|
||||
format.js
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@ class QualityAnalysisController < ApplicationController
|
|||
before_filter :find_project_by_project_id#, :except => [:getattachtype]
|
||||
before_filter :find_quality_analysis, :only => [:edit, :update_jenkins_job]
|
||||
before_filter :authorize
|
||||
before_filter :connect_jenkins, :only => [:create, :edit, :update_jenkins_job, :index]
|
||||
before_filter :connect_jenkins, :only => [:create, :edit, :update_jenkins_job, :index, :delete]
|
||||
layout "base_projects"
|
||||
include ApplicationHelper
|
||||
include QualityAnalysisHelper
|
||||
|
@ -33,7 +33,6 @@ class QualityAnalysisController < ApplicationController
|
|||
arr = JSON.parse(projects_date).map {|m| m["nm"]} # eg: ["Hjqreturn:cc_rep", "Hjqreturn:putong", "Hjqreturn:sonar_rep2", "shitou:sonar_rep"]
|
||||
quality_an = QualityAnalysis.where(:sonar_name => sonar_name).first
|
||||
if @client.job.exists?(job_name) && QualityAnalysis.where(:sonar_name => sonar_name).select{|qa| arr.include?(qa.sonar_name)}.blank?
|
||||
logger.info("88888888888888888888")
|
||||
aa = @client.job.delete("#{job_name}")
|
||||
quality_an.delete unless quality_an.blank?
|
||||
end
|
||||
|
@ -84,7 +83,7 @@ class QualityAnalysisController < ApplicationController
|
|||
end
|
||||
|
||||
# sonar 缓冲,取数据
|
||||
sleep(5)
|
||||
sleep(3)
|
||||
|
||||
# 获取sonar output结果
|
||||
console_build = @client.job.get_console_output("#{job_name}", build_num = 0, start = 0, mode = 'text')["output"]
|
||||
|
@ -152,11 +151,31 @@ class QualityAnalysisController < ApplicationController
|
|||
@gitlab_default_branch = @g.project(@project.gpid).default_branch
|
||||
end
|
||||
|
||||
# 删除的时候主要删除三方面数据:1/Trustie数据 2/jenkins数据 3/sonar数据
|
||||
# 如果只删除数据1,则新建的时候会有冲突
|
||||
def delete
|
||||
begin
|
||||
qa = QualityAnalysis.find(params[:id])
|
||||
rep_id = Repository.where(:project_id => @project.id, :identifier => qa.rep_identifier).first.try(:id)
|
||||
job_name = "#{qa.author_login}-#{rep_id}"
|
||||
logger.info("result: job_name ###################==>#{job_name}")
|
||||
logger.info("result: @client.job ###################==>#{@client.job}")
|
||||
|
||||
d_job = @client.job.delete(job_name)
|
||||
logger.info("result: delete job ###################==>#{d_job}")
|
||||
qa.delete
|
||||
respond_to do |format|
|
||||
format.html{redirect_to project_quality_analysis_path(:project_id => @project.id)}
|
||||
end
|
||||
rescue Exception => e
|
||||
puts e
|
||||
end
|
||||
end
|
||||
|
||||
# 更新Jenkins job,主要包括相关配置文件参数的更新,Trustie平台数据的更新
|
||||
def update_jenkins_job
|
||||
begin
|
||||
rep_id = Repository.where(:project_id => @project.id).first.try(:id)
|
||||
logger.error("#############################===>666")
|
||||
sonar_name = @quality_analysis.sonar_name
|
||||
job_name = "#{@quality_analysis.author_login}-#{rep_id}"
|
||||
version = @quality_analysis.sonar_version
|
||||
|
@ -223,7 +242,7 @@ class QualityAnalysisController < ApplicationController
|
|||
if key == "sqale_index"
|
||||
value = com["frmt_val"]
|
||||
else
|
||||
value = com["val"].to_i
|
||||
value = com["val"]
|
||||
end
|
||||
@ha.store(key,value)
|
||||
end
|
||||
|
@ -260,9 +279,11 @@ class QualityAnalysisController < ApplicationController
|
|||
def connect_jenkins
|
||||
@gitlab_address = Redmine::Configuration['gitlab_address']
|
||||
@jenkins_address = Redmine::Configuration['jenkins_address']
|
||||
jenkins_username = Redmine::Configuration['jenkins_username']
|
||||
jenkins_password = Redmine::Configuration['jenkins_password']
|
||||
|
||||
# connect jenkins
|
||||
@client = JenkinsApi::Client.new(:server_url => @jenkins_address, :username => "temp", :password => '123123')
|
||||
@client = JenkinsApi::Client.new(:server_url => @jenkins_address, :username => jenkins_username, :password => jenkins_password)
|
||||
rescue => e
|
||||
logger.error("failed to connect Jenkins ==> #{e}")
|
||||
end
|
||||
|
|
|
@ -271,7 +271,7 @@ class StudentWorkController < ApplicationController
|
|||
|
||||
all_studentwork = find_all_student_work_by_homeid()
|
||||
|
||||
@work_count = all_studentwork.count
|
||||
@work_count = all_studentwork.has_committed.count
|
||||
end
|
||||
|
||||
#代码查重 status: 0完成 -2不需要查重 -1查重失败不支持该语言
|
||||
|
@ -282,7 +282,7 @@ class StudentWorkController < ApplicationController
|
|||
|
||||
@homework = HomeworkCommon.find params[:homework]
|
||||
|
||||
all_studentwork = find_all_student_work_by_homeid()
|
||||
all_studentwork = find_all_student_work_by_homeid().has_committed
|
||||
|
||||
if all_studentwork == nil
|
||||
resultObj[:status] = -2
|
||||
|
|
|
@ -109,7 +109,11 @@ class SyllabusesController < ApplicationController
|
|||
sort_name = "updated_on"
|
||||
sort_type = @c_sort == 1 ? "asc" : "desc"
|
||||
|
||||
if User.current == @syllabus.user || User.current.admin?
|
||||
@courses = @syllabus.courses.where("is_delete = 0").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS #{sort_name}").order("#{sort_name} #{sort_type}")
|
||||
else
|
||||
@courses = User.current.courses.visible.where("is_delete =? and syllabus_id =?", 0, @syllabus.id).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS #{sort_name}").order("#{sort_name} #{sort_type}")
|
||||
end
|
||||
|
||||
#根据 作业+资源数排序
|
||||
if @order.to_i == 2
|
||||
|
|
|
@ -92,6 +92,8 @@ class UsersController < ApplicationController
|
|||
@comment = JournalsForMessage.find params[:comment].to_i
|
||||
when 'Message'
|
||||
@comment = Message.find params[:comment].to_i
|
||||
when 'BlogComment'
|
||||
@comment = BlogComment.find params[:comment].to_i
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -120,6 +122,17 @@ class UsersController < ApplicationController
|
|||
@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]
|
||||
@type = 'BlogComment'
|
||||
when 'OrgDocumentComment'
|
||||
@reply = OrgDocumentComment.find params[:reply_id]
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
@activity_id = params[:activity_id]
|
||||
@type = 'OrgDocumentComment'
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
|
@ -556,12 +569,12 @@ class UsersController < ApplicationController
|
|||
@order,@b_sort = params[:order] || "created_at",params[:sort] || "desc"
|
||||
@user = User.current
|
||||
@r_sort = @b_sort == "desc" ? "asc" : "desc"
|
||||
if(params[:type].blank? || params[:type] == "1") #题库
|
||||
if(params[:type].blank? || params[:type] == "1") #我的题库
|
||||
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
|
||||
elsif params[:type] == "2" #题库
|
||||
visible_course = Course.where("is_delete = 0")
|
||||
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
|
||||
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
|
||||
elsif params[:type] == "2" #我的题库
|
||||
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
|
||||
end
|
||||
@type = params[:type]
|
||||
@limit = 25
|
||||
|
@ -715,7 +728,11 @@ class UsersController < ApplicationController
|
|||
@order,@b_sort = params[:order] || "created_at",params[:sort] || "desc"
|
||||
@r_sort = @b_sort == "desc" ? "asc" : "desc"
|
||||
@user = User.current
|
||||
if(params[:type].blank? || params[:type] == "1") #题库
|
||||
if(params[:type].blank? || params[:type] == "1") #我的题库
|
||||
courses = @user.courses.where("is_delete = 1")
|
||||
course_ids = courses.empty? ? "(-1)" : "(" + courses.map{|course| course.id}.join(",") + ")"
|
||||
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and course_id not in #{course_ids}").order("#{@order} #{@b_sort}")
|
||||
elsif params[:type] == "2" #题库
|
||||
if params[:is_import].to_i == 1
|
||||
visible_course = Course.where("is_public = 1 && is_delete = 0")
|
||||
elsif params[:is_import].to_i == 0
|
||||
|
@ -723,10 +740,6 @@ class UsersController < ApplicationController
|
|||
end
|
||||
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
|
||||
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
|
||||
elsif params[:type] == "2" #我的题库
|
||||
courses = @user.courses.where("is_delete = 1")
|
||||
course_ids = courses.empty? ? "(-1)" : "(" + courses.map{|course| course.id}.join(",") + ")"
|
||||
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and course_id not in #{course_ids}").order("#{@order} #{@b_sort}")
|
||||
elsif params[:type] == "3" #申请题库
|
||||
none_visible_course = Course.where("is_delete = 1")
|
||||
none_visible_course_ids = none_visible_course.empty? ? "(-1)" : "(" + none_visible_course.map{|course| course.id}.join(",") + ")"
|
||||
|
@ -793,7 +806,18 @@ class UsersController < ApplicationController
|
|||
@user = User.current
|
||||
search = params[:name].to_s.strip.downcase
|
||||
type_ids = params[:property]=="" || params[:property].nil? ? "(1, 2, 3)" : "(" + params[:property] + ")"
|
||||
if(params[:type].blank? || params[:type] == "1") #全部
|
||||
if(params[:type].blank? || params[:type] == "1") #我的题库
|
||||
courses = @user.courses.where("is_delete = 1")
|
||||
course_ids = courses.empty? ? "(-1)" : "(" + courses.map{|course| course.id}.join(",") + ")"
|
||||
if @order == "course_name"
|
||||
sql = "SELECT homework_commons.* FROM homework_commons INNER JOIN courses ON homework_commons.course_id = courses.id where homework_commons.course_id not in #{course_ids} and homework_commons.user_id = #{@user.id} and homework_type in #{type_ids} and publish_time <= '#{Date.today}' and (homework_commons.name like '%#{search}%') order by CONVERT (courses.name USING gbk) COLLATE gbk_chinese_ci #{@b_sort}"
|
||||
@homeworks = HomeworkCommon.find_by_sql(sql)
|
||||
elsif @order == "user_name"
|
||||
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and course_id not in #{course_ids} and publish_time <= '#{Date.today}' and (name like '%#{search}%') and homework_type in #{type_ids}").joins(:user).order("CONVERT (lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, CONVERT (firstname USING gbk) COLLATE gbk_chinese_ci #{@b_sort},login #{@b_sort}")
|
||||
else
|
||||
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and course_id not in #{course_ids} and publish_time <= '#{Date.today}' and (name like '%#{search}%') and homework_type in #{type_ids}").order("#{@order} #{@b_sort}")
|
||||
end
|
||||
elsif params[:type] == "2" #题库
|
||||
if params[:is_import].to_i == 1
|
||||
visible_course = Course.where("is_public = 1 && is_delete = 0")
|
||||
elsif params[:is_import].to_i == 0
|
||||
|
@ -812,17 +836,6 @@ class UsersController < ApplicationController
|
|||
else
|
||||
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}' and homework_type in #{type_ids} and (name like '%#{search}%' or user_id in #{user_ids})").order("#{@order} #{@b_sort}")
|
||||
end
|
||||
elsif params[:type] == "2" #我的题库
|
||||
courses = @user.courses.where("is_delete = 1")
|
||||
course_ids = courses.empty? ? "(-1)" : "(" + courses.map{|course| course.id}.join(",") + ")"
|
||||
if @order == "course_name"
|
||||
sql = "SELECT homework_commons.* FROM homework_commons INNER JOIN courses ON homework_commons.course_id = courses.id where homework_commons.course_id not in #{course_ids} and homework_commons.user_id = #{@user.id} and homework_type in #{type_ids} and publish_time <= '#{Date.today}' and (homework_commons.name like '%#{search}%') order by CONVERT (courses.name USING gbk) COLLATE gbk_chinese_ci #{@b_sort}"
|
||||
@homeworks = HomeworkCommon.find_by_sql(sql)
|
||||
elsif @order == "user_name"
|
||||
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and course_id not in #{course_ids} and publish_time <= '#{Date.today}' and (name like '%#{search}%') and homework_type in #{type_ids}").joins(:user).order("CONVERT (lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, CONVERT (firstname USING gbk) COLLATE gbk_chinese_ci #{@b_sort},login #{@b_sort}")
|
||||
else
|
||||
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and course_id not in #{course_ids} and publish_time <= '#{Date.today}' and (name like '%#{search}%') and homework_type in #{type_ids}").order("#{@order} #{@b_sort}")
|
||||
end
|
||||
elsif params[:type] == "3" #申请题库
|
||||
apply_homeworks = ApplyHomework.where("user_id = ?",@user.id)
|
||||
homework_ids = apply_homeworks.empty? ? "(-1)" : "(" + apply_homeworks.map{|ah| ah.homework_common_id}.join(",") + ")"
|
||||
|
@ -1410,8 +1423,13 @@ class UsersController < ApplicationController
|
|||
@all_count = @user.courses.visible.where("is_delete =?", 0).count
|
||||
elsif @type == 'Syllabus'
|
||||
@syllabus = Syllabus.where("id = #{params[:syllabus]}").first
|
||||
@courses = User.current.courses.visible.where("is_delete =? and syllabus_id =?", 0, @syllabus.id).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5).offset(@page * 5)
|
||||
@all_count = User.current.courses.visible.where("is_delete =? and syllabus_id =?", 0, @syllabus.id).count
|
||||
if User.current == @syllabus.user || User.current.admin?
|
||||
all_courses = @syllabus.courses.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")
|
||||
else
|
||||
all_courses = User.current.courses.visible.where("is_delete =? and syllabus_id =?", 0, @syllabus.id).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc")
|
||||
end
|
||||
@courses = all_courses.limit(5).offset(@page * 5)
|
||||
@all_count = all_courses.count
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -2132,6 +2150,7 @@ class UsersController < ApplicationController
|
|||
# 添加资源到对应的项目
|
||||
def add_exist_file_to_project
|
||||
@flag = true
|
||||
# 发送单个资源
|
||||
if params[:send_id].present?
|
||||
send_id = params[:send_id]
|
||||
project_ids = params[:projects_ids]
|
||||
|
@ -2168,6 +2187,8 @@ class UsersController < ApplicationController
|
|||
quotes = ori.quotes.to_i + 1
|
||||
ori.update_attribute(:quotes, quotes) unless ori.nil?
|
||||
ori.forwards << Forward.new(:to_type => attach_copied_obj.class.name, :to_id => attach_copied_obj.id,:created_at => Time.now)
|
||||
# 项目中添加动态
|
||||
ForgeActivity.create(:user_id => User.current.id, :project_id => project_id, :forge_act_id => attach_copied_obj.id, :forge_act_type => "Attachment" )
|
||||
end
|
||||
unless Project.find(project_id).project_score.nil?
|
||||
Project.find(project_id).project_score.update_attribute(:attach_num,
|
||||
|
@ -2176,6 +2197,7 @@ class UsersController < ApplicationController
|
|||
end
|
||||
@ori = ori
|
||||
end
|
||||
# 发送多个资源
|
||||
elsif params[:send_ids].present?
|
||||
send_ids = params[:send_ids].split(",")
|
||||
project_ids = params[:projects_ids]
|
||||
|
@ -2214,6 +2236,8 @@ class UsersController < ApplicationController
|
|||
quotes = ori.quotes.to_i + 1
|
||||
ori.update_attribute(:quotes, quotes) unless ori.nil?
|
||||
ori.forwards << Forward.new(:to_type => attach_copied_obj.class.name, :to_id => attach_copied_obj.id,:created_at => Time.now)
|
||||
# 项目中添加动态
|
||||
ForgeActivity.create(:user_id => User.current.id, :project_id => project_id, :forge_act_id => attach_copied_obj.id, :forge_act_type => "Attachment" )
|
||||
end
|
||||
unless Project.find(project_id).project_score.nil?
|
||||
Project.find(project_id).project_score.update_attribute(:attach_num, Project.find(project_id).project_score.attach_num + 1)
|
||||
|
@ -3273,7 +3297,10 @@ class UsersController < ApplicationController
|
|||
case params[:type]
|
||||
when 'OrgDocumentComment'
|
||||
obj = OrgDocumentComment.where('id = ?', params[:id].to_i).first
|
||||
@journals = obj.children.reorder("created_at desc")
|
||||
@user_activity_id = params[:div_id].to_i if params[:div_id]
|
||||
@type = 'OrgDocumentComment'
|
||||
comments = []
|
||||
@journals = get_all_children(comments, obj)
|
||||
when 'Message'
|
||||
obj = Message.where('id = ?', params[:id].to_i).first
|
||||
@type = 'Message'
|
||||
|
@ -3300,7 +3327,11 @@ class UsersController < ApplicationController
|
|||
@journals = obj.journals.reorder("created_on desc")
|
||||
when 'BlogComment'
|
||||
obj = BlogComment.where('id = ?', params[:id].to_i).first
|
||||
@journals = obj.children.reorder("created_on desc")
|
||||
@user_activity_id = params[:div_id].to_i if params[:div_id]
|
||||
@homepage = params[:homepage].to_i
|
||||
@type = 'BlogComment'
|
||||
comments = []
|
||||
@journals = get_all_children(comments, obj)
|
||||
when 'HomeworkCommon'
|
||||
obj = HomeworkCommon.where('id = ?', params[:id].to_i).first
|
||||
@journals = obj.journals_for_messages.reorder("created_on desc")
|
||||
|
|
|
@ -385,6 +385,7 @@ module ApplicationHelper
|
|||
subject = truncate(subject, :length => 60)
|
||||
end
|
||||
end
|
||||
# status_id:3、已解决 5、已关闭
|
||||
if issue.status_id == 3
|
||||
s = link_to text, issue_path(issue), :class => "text_line_s", :title => title
|
||||
elsif issue.status_id == 5
|
||||
|
@ -1765,20 +1766,21 @@ module ApplicationHelper
|
|||
link_to_function(l(:button_uncheck_all), "checkAll('#{form_name}', false)")
|
||||
end
|
||||
|
||||
# 本次修改,修改为只显示关闭的所占%比
|
||||
def progress_bar(pcts, options={})
|
||||
pcts = [pcts, pcts] unless pcts.is_a?(Array)
|
||||
pcts = [pcts] unless pcts.is_a?(Array)
|
||||
pcts = pcts.collect(&:round)
|
||||
pcts[1] = pcts[1] - pcts[0]
|
||||
pcts << (100 - pcts[1] - pcts[0])
|
||||
# pcts[1] = pcts[1] + pcts[0]
|
||||
pcts << (100 - pcts[0])
|
||||
width = options[:width] || '100px;'
|
||||
legend = options[:legend] || ''
|
||||
content_tag('table',
|
||||
content_tag('tr',
|
||||
(pcts[0] > 0 ? content_tag('td', '', :style => "width: #{pcts[0]}%;", :class => 'closed') : ''.html_safe) +
|
||||
(pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1]}%;", :class => 'done') : ''.html_safe) +
|
||||
(pcts[2] > 0 ? content_tag('td', '', :style => "width: #{pcts[2]}%;", :class => 'todo') : ''.html_safe)
|
||||
), :class => 'progress', :style => "width: #{width};").html_safe +
|
||||
content_tag('p', legend, :class => 'percent').html_safe
|
||||
(pcts[0] > 0 ? content_tag('td', '', :style => "width: #{pcts[0]}%;", :class => 'closed', :title => "已关闭:#{pcts[0]}%") : ''.html_safe) +
|
||||
# (pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1]}%;", :class => 'done', :title => "开发中:#{pcts[1]}%") : ''.html_safe) +
|
||||
(pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1]}%;", :class => 'todo', :title => "未完成:#{pcts[1]}%") : ''.html_safe), :style => "width: #{width}"
|
||||
), :class => 'progress').html_safe
|
||||
# + content_tag('p', legend, :class => 'percent').html_safe
|
||||
end
|
||||
|
||||
def checked_image(checked=true)
|
||||
|
@ -2990,6 +2992,7 @@ int main(int argc, char** argv){
|
|||
unless projects.empty?
|
||||
project_ids = '('+projects.map{|pro|pro.project_id}.join(',')+')'
|
||||
sort_projects = ForgeActivity.find_by_sql("SELECT MAX(updated_at) AS updated_at,user_id, project_id FROM forge_activities WHERE project_id IN #{project_ids} GROUP BY project_id ORDER BY MAX(updated_at) DESC")
|
||||
#sort_projects = sort_projects.sort_by{|sp| (!sp.project.project_score.nil? && !sp.project.project_score.commit_time.nil?) ? '' : sp.project.project_score.commit_time}
|
||||
return sort_projects
|
||||
end
|
||||
end
|
||||
|
@ -3141,13 +3144,18 @@ end
|
|||
|
||||
#获取所有子节点
|
||||
def get_all_children result, jour
|
||||
if (jour.kind_of? JournalsForMessage) || (jour.kind_of? Message)
|
||||
if (jour.kind_of? JournalsForMessage) || (jour.kind_of? Message) || (jour.kind_of? BlogComment) || (jour.kind_of? OrgDocumentComment)
|
||||
jour.children.each do |jour_child|
|
||||
result << jour_child
|
||||
get_all_children result, jour_child
|
||||
end
|
||||
end
|
||||
if jour.respond_to?(:created_on)
|
||||
result.sort! { |a,b| b.created_on <=> a.created_on }
|
||||
elsif jour.respond_to?(:created_at)
|
||||
result.sort! { |a,b| b.created_at <=> a.created_at }
|
||||
end
|
||||
result
|
||||
end
|
||||
|
||||
#将有置顶属性的提到数组前面
|
||||
|
@ -3284,7 +3292,7 @@ def strip_html(text,len=0,endss="...")
|
|||
ss = ""
|
||||
if !text.nil? && text.length>0
|
||||
ss=text.gsub(/<\/?.*?>/, '').strip
|
||||
ss = ss.gsub(/ /, ' ')
|
||||
ss = ss.gsub(/ */, ' ')
|
||||
|
||||
if len > 0 && ss.length > len
|
||||
ss = ss[0, len] + endss
|
||||
|
@ -3296,6 +3304,15 @@ def strip_html(text,len=0,endss="...")
|
|||
return ss
|
||||
end
|
||||
|
||||
def message_content content
|
||||
content = (strip_html content).strip
|
||||
content = content.gsub(/\s+/, " ")
|
||||
if content.gsub(" ", "") == ""
|
||||
content = "[非文本消息]"
|
||||
end
|
||||
content
|
||||
end
|
||||
|
||||
def get_hw_index(hw,is_teacher)
|
||||
if is_teacher
|
||||
homeworks = hw.course.homework_commons.order("created_at asc")
|
||||
|
|
|
@ -1148,17 +1148,17 @@ class User < Principal
|
|||
|
||||
#为新注册用户发送留言
|
||||
def add_new_jour
|
||||
if Message.where("id=19278").any? and Message.where("id=19291").any? and Message.where("id=19292").any?
|
||||
lead_message1 = Message.find(19278)
|
||||
if Message.where("id=19504").any? and Message.where("id=19291").any? and Message.where("id=19292").any?
|
||||
lead_message1 = Message.find(19292)
|
||||
notes1 = lead_message1.content
|
||||
# lead_message2 = Message.find(19292)
|
||||
# notes2 = lead_message2.content
|
||||
# lead_message3 = Message.find(19291)
|
||||
# notes3 = lead_message3.content
|
||||
# # user_id 默认为课程使者创建
|
||||
lead_message2 = Message.find(19291)
|
||||
notes2 = lead_message2.content
|
||||
lead_message3 = Message.find(19504)
|
||||
notes3 = lead_message3.content
|
||||
#user_id 默认为课程使者创建
|
||||
self.journals_for_messages << JournalsForMessage.new(:user_id => 1, :notes => notes1, :reply_id => 0, :status => true, :is_readed => false, :private => 0)
|
||||
# self.journals_for_messages << JournalsForMessage.new(:user_id => 1, :notes => notes2, :reply_id => 0, :status => true, :is_readed => false, :private => 0)
|
||||
# self.journals_for_messages << JournalsForMessage.new(:user_id => 1, :notes => notes3, :reply_id => 0, :status => true, :is_readed => false, :private => 0)
|
||||
self.journals_for_messages << JournalsForMessage.new(:user_id => 1, :notes => notes2, :reply_id => 0, :status => true, :is_readed => false, :private => 0)
|
||||
self.journals_for_messages << JournalsForMessage.new(:user_id => 1, :notes => notes3, :reply_id => 0, :status => true, :is_readed => false, :private => 0)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
});
|
||||
|
||||
$mail.blur(function (event) {
|
||||
if (/^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(this.value) == false){
|
||||
if (/^[a-zA-Z0-9]+([._\\]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(this.value) == false){
|
||||
$('#mail_req').html( '<span style="color: #c00202">邮件格式不对</span>').show();
|
||||
$mail_correct = false;
|
||||
return ;
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
<span>
|
||||
<a title="<%= syllabus.title %>" id="rename_syllabus_title_<%= syllabus.id %>" ondblclick="rename_syllabus_title($(this),'<%=syllabus.title %>','<%=syllabus.id %>');"><%= syllabus.title %></a>
|
||||
</span>
|
|
@ -46,10 +46,8 @@
|
|||
<td style="text-align: center;">
|
||||
<%= syllabus.id %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=syllabus.title%>'>
|
||||
<span>
|
||||
<%= link_to(syllabus.title, syllabus_path(syllabus.id)) %>
|
||||
</span>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=syllabus.title%>' id="syllabus_title_<%=syllabus.id %>">
|
||||
<%= render :partial => 'admin/rename_syllabus_title', :locals => {:syllabus => syllabus} %>
|
||||
</td>
|
||||
<td class="center">
|
||||
</td>
|
||||
|
@ -89,23 +87,24 @@
|
|||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var tagNameHtml; //当前双击的链接的父节点的html
|
||||
var parentCssBorder; //当前双击的链接的父节点
|
||||
var ele; //当前双击的链接
|
||||
var tagId; //班级的id
|
||||
var tagName; //班级名称
|
||||
var CourseTagNameHtml; //当前双击的链接的父节点的html
|
||||
var CourseParentCssBorder; //当前双击的链接的父节点
|
||||
var CourseEle; //当前双击的链接
|
||||
var CourseTagId; //班级的id
|
||||
var CourseTagName; //班级名称
|
||||
var CourseIsdb;
|
||||
|
||||
function rename_course_name(domEle,name,id){
|
||||
isdb = true; //这是双击
|
||||
CourseIsdb = true; //这是双击
|
||||
//clearTimeout(clickFunction);
|
||||
if (domEle.children().get(0) != undefined) { //已经是编辑框的情况下不要动
|
||||
return;
|
||||
}
|
||||
tagNameHtml = domEle.parent().html();
|
||||
parentCssBorder = domEle.parent().css("border");
|
||||
ele = domEle;
|
||||
tagId = id;
|
||||
tagName = name;
|
||||
CourseTagNameHtml = domEle.parent().html();
|
||||
CourseParentCssBorder = domEle.parent().css("border");
|
||||
CourseEle = domEle;
|
||||
CourseTagId = id;
|
||||
CourseTagName = name;
|
||||
domEle.html('<input name="" id="renameCourseName" maxlength="120" minlength="1" style="width:125px;" value="' + name + '"/>');
|
||||
domEle.parent().css("border", "1px solid #ffffff");
|
||||
$("#renameCourseName").focus();
|
||||
|
@ -119,20 +118,66 @@
|
|||
updateCourseName();
|
||||
}
|
||||
});
|
||||
$("#renameSyllabusTitle").live("blur",function(){
|
||||
updateSyllabusTitle();
|
||||
}).live("keypress",function(e){
|
||||
if (e.keyCode == '13') {
|
||||
updateSyllabusTitle();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//执行修改TAGName方法
|
||||
function updateCourseName(){
|
||||
if(isdb){
|
||||
isdb = false;
|
||||
if($("#renameCourseName").val() == tagName){ //如果值一样,则恢复原来的状态
|
||||
if(CourseIsdb){
|
||||
CourseIsdb = false;
|
||||
if($("#renameCourseName").val() == CourseTagName){ //如果值一样,则恢复原来的状态
|
||||
ele.parent().css("border","");
|
||||
ele.parent().html(tagNameHtml);
|
||||
ele.parent().html(CourseTagNameHtml);
|
||||
}
|
||||
else{
|
||||
$.post(
|
||||
'<%= admin_update_course_name_path %>',
|
||||
{"course_id": tagId, "name": $("#renameCourseName").val().trim()}
|
||||
{"course_id": CourseTagId, "name": $("#renameCourseName").val().trim()}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var SyllabusTagNameHtml; //当前双击的链接的父节点的html
|
||||
var SyllabusParentCssBorder; //当前双击的链接的父节点
|
||||
var SyllabusEle; //当前双击的链接
|
||||
var SyllabusTagId; //课程的id
|
||||
var SyllabusTagName; //课程名称
|
||||
var SyllabusIsdb;
|
||||
function rename_syllabus_title(domEle,name,id){
|
||||
SyllabusIsdb = true; //这是双击
|
||||
//clearTimeout(clickFunction);
|
||||
if (domEle.children().get(0) != undefined) { //已经是编辑框的情况下不要动
|
||||
return;
|
||||
}
|
||||
SyllabusTagNameHtml = domEle.parent().html();
|
||||
SyllabusParentCssBorder = domEle.parent().css("border");
|
||||
SyllabusEle = domEle;
|
||||
SyllabusTagId = id;
|
||||
SyllabusTagName = name;
|
||||
domEle.html('<input name="" id="renameSyllabusTitle" maxlength="120" minlength="1" style="width:125px;" value="' + name + '"/>');
|
||||
domEle.parent().css("border", "1px solid #ffffff");
|
||||
$("#renameSyllabusTitle").focus();
|
||||
}
|
||||
|
||||
//执行修改TAGName方法
|
||||
function updateSyllabusTitle(){
|
||||
if(SyllabusIsdb){
|
||||
SyllabusIsdb = false;
|
||||
if($("#renameSyllabusTitle").val() == SyllabusTagName){ //如果值一样,则恢复原来的状态
|
||||
ele.parent().css("border","");
|
||||
ele.parent().html(SyllabusTagNameHtml);
|
||||
}
|
||||
else{
|
||||
$.post(
|
||||
'<%= admin_update_syllabus_title_path %>',
|
||||
{"syllabus_id": SyllabusTagId, "name": $("#renameSyllabusTitle").val().trim()}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
$("#syllabus_title_<%=@syllabus.id %>").html("<%=escape_javascript(render :partial => 'admin/rename_syllabus_title', :locals => {:syllabus => @syllabus}) %>");
|
|
@ -3,12 +3,15 @@
|
|||
<div class="ReplyToMessageInputContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= reply.id%>'>
|
||||
<%= form_for @blog_comment, :as => :reply, :url => {:controller => 'blog_comments',:action => 'reply', :id => @blogComment.id}, :html => {:multipart => true, :id => 'new_form'} do |f| %>
|
||||
<input type="hidden" name="quote[quote]" id="quote_quote">
|
||||
<%= form_for('new_form', :url => {:controller => 'blog_comments',:action => 'reply', :id => reply.id, :blog_id => reply.blog.id, :user_id => User.current.id}, :method => "post", :html => {:multipart => true}) do |f| %>
|
||||
|
||||
<%#= form_for @blog_comment, :as => :reply, :url => {:controller => 'blog_comments',:action => 'reply', :id => @blogComment.id}, :html => {:multipart => true, :id => 'new_form'} do |f| %>
|
||||
<input type="hidden" name="quote[quote]" value="" id="quote_quote">
|
||||
<% if course_id%>
|
||||
<input type="hidden" name="course_id" id="" value="<%= course_id%>">
|
||||
<% end %>
|
||||
<input type="hidden" name="blog_comment[title]" id="reply_subject">
|
||||
<%= hidden_field_tag 'parent_id', params[:parent_id], :value => reply.id %>
|
||||
<%= hidden_field_tag 'reply_id', params[:reply_id], :value => reply.author_id %>
|
||||
<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,7 @@
|
|||
<% if @in_user_homepage %>
|
||||
<% homepage = BlogComment.find(User.current.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 %>
|
||||
sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", 'UserActivity');
|
|
@ -1,8 +1,6 @@
|
|||
if($("#reply_message_<%= @blogComment.id%>").length > 0) {
|
||||
$("#reply_message_<%= @blogComment.id%>").replaceWith("<%= escape_javascript(render :partial => 'blog_comments/simple_ke_reply_form', :locals => {:reply => @blogComment,:temp =>@temp,:subject =>@subject,:course_id=>@course_id}) %>");
|
||||
$("#reply_message_<%= @blogComment.id%>").replaceWith("<%= escape_javascript(render :partial => 'blog_comments/simple_ke_reply_form', :locals => {:reply => @blogComment,:temp =>@temp,:course_id=>@course_id}) %>");
|
||||
$(function(){
|
||||
$('#reply_subject').val("<%= raw escape_javascript(@subject) %>");
|
||||
$('#quote_quote').val("<%= raw escape_javascript(@temp.content.html_safe) %>");
|
||||
sd_create_editor_from_data(<%= @blogComment.id%>,null,"100%", "<%=@blogComment.class.to_s%>");
|
||||
});
|
||||
}else if($("#reply_to_message_<%= @blogComment.id%>").length >0) {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
$("#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 => 'blogs/article', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
|
||||
$("#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 %>
|
||||
sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", 'UserActivity');
|
|
@ -91,9 +91,7 @@
|
|||
</div>
|
||||
<div class="postDetailDate mb5"><%= format_time( @article.created_on)%></div>
|
||||
<div class="cl"></div>
|
||||
<!--<div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @article.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >-->
|
||||
<!--<%#= @article.content.html_safe%>-->
|
||||
<!--</div>-->
|
||||
|
||||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>@article.id, :content=>@article.content} %>
|
||||
<div class="cl"></div>
|
||||
<div class=" fl" style="width: 600px">
|
||||
|
@ -107,73 +105,84 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% count=0 %>
|
||||
<% if @article.parent %>
|
||||
<% count=@article.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=@article.children.count%>
|
||||
<% end %>
|
||||
<% all_comments = []%>
|
||||
<% count=get_all_children(all_comments, @article).count %>
|
||||
<div class="homepagePostReply">
|
||||
<%# unless count == 0 %>
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复
|
||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=@article.id %>">
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>@article, :user_activity_id=>@article.id,:type=>"activity"}%>
|
||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn>
|
||||
<span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%= @article.id %>">
|
||||
<%= render :partial => "praise_tread/praise", :locals => {:activity => @article, :user_activity_id => @article.id, :type => "activity"} %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"></div>
|
||||
</div>
|
||||
|
||||
<% all_comments = []%>
|
||||
<% comments = get_all_children(all_comments, @article) %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= @article.id %>">
|
||||
<%@article.children.reorder('created_on desc').each_with_index do |reply,i| %>
|
||||
<% comments.each do |comment| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||
autoUrl('reply_message_description_<%= reply.id %>');
|
||||
showNormalImage('reply_content_<%= comment.id %>');
|
||||
autoUrl('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
|
||||
<%= 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">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<%= link_to reply.author.show_name, user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||
<%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %>
|
||||
<%= time_from_now(comment.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyContent upload_img break_word" id="reply_message_description_<%= reply.id %>">
|
||||
<%= reply.content.html_safe%>
|
||||
<% if !comment.parent.nil? && !comment.parent.parent.nil? %>
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
|
||||
<% end %>
|
||||
<% if !comment.content_detail.blank? %>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
<%= comment.content_detail.html_safe %>
|
||||
</div>
|
||||
<div style="margin-top: -7px; margin-bottom: 5px">
|
||||
<%= format_time(reply.created_on) %>
|
||||
<span id="reply_praise_count_<%=reply.id %>">
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||
<div class="orig_reply mb10 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>
|
||||
<div class="fr mr10" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
||||
<span style="position: relative" class="fr mr20">
|
||||
<%= link_to(
|
||||
l(:button_reply),
|
||||
{:controller => 'blog_comments',:action => 'quote',:user_id=>reply.author_id,:blog_id=>reply.blog_id, :id => reply.id},
|
||||
{:controller => 'blog_comments', :action => 'quote', :user_id => comment.author_id, :blog_id => comment.blog_id, :id => comment.id},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:class => 'fr newsBlue',
|
||||
:title => l(:button_reply)) if !@article.locked? && User.current.logged? %>
|
||||
:title => l(:button_reply)) if !@article.locked? %>
|
||||
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
||||
</span>
|
||||
<% if comment.author == User.current %>
|
||||
<%= link_to(
|
||||
l(:button_delete),
|
||||
{:controller => 'blog_comments',:action => 'destroy', :id => reply.id},
|
||||
{:controller => 'blog_comments', :action => 'destroy', :id => comment.id},
|
||||
:method => :delete,
|
||||
:class => 'fr newsGrey mr10',
|
||||
:class => 'fr mr20',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)
|
||||
) if reply.author.id == User.current.id %>
|
||||
</div>
|
||||
</div>
|
||||
<p id="reply_message_<%= reply.id%>"></p>
|
||||
</div>
|
||||
) %>
|
||||
<% end %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<p id="reply_message_<%= comment.id%>"></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li><% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%# end %>
|
||||
<div class="cl"></div>
|
||||
<% if !@article.locked? && User.current.logged?%>
|
||||
<div class="talkWrapMsg" nhname="about_talk_reply">
|
||||
|
|
|
@ -48,14 +48,16 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% count=activity.children.count %>
|
||||
<% all_comments = []%>
|
||||
<% count=get_all_children(all_comments, activity).count %>
|
||||
<div class="homepagePostReply">
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
|
||||
<%= render :partial => 'users/blog_comment_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :homepage => 1} %>
|
||||
|
||||
<% comments = activity.children.reorder("created_on desc").limit(3) %>
|
||||
<% all_comments = []%>
|
||||
<% comments = get_all_children(all_comments, activity)[0..2] %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
|
||||
<%= render :partial => 'users/blog_comments_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'BlogComment', :activity_id =>activity.id, :homepage => 1}%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -53,8 +53,8 @@
|
|||
</li>
|
||||
<li class="ml45 mb10">
|
||||
<label><span class="c_red">*</span> <%= l(:label_tags_syllabus_name)%> :</label>
|
||||
<%= select_tag :syllabus_id,options_for_select(syllabus_option,@course.syllabus_id), {:id=>"new_syllabus_id", :class=>"syllabus_input"} %>
|
||||
<span class="c_red" id="new_syllabus_notice" style="display: none;">请选择课程大纲</span>
|
||||
<%= select_tag :syllabus_id,options_for_select(course_syllabus_option,@course.syllabus_id), {:id=>"new_syllabus_id", :class=>"syllabus_input"} %>
|
||||
<span class="c_red" id="new_syllabus_notice">如果列表中没有对应的课程,请您先<%=link_to '创建课程', new_syllabus_path(),:target => '_blank', :class => 'ml5 green_btn_share c_white'%></span>
|
||||
</li>
|
||||
<li class="ml45">
|
||||
<label><span class="c_red">*</span> <%= l(:label_tags_course_name)%> :</label>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<span><%=@syllabus.title %></span>
|
||||
<input style="display: none;" name="syllabus_id" value="<%=@syllabus.id %>" />
|
||||
<% end %>
|
||||
<span class="c_red" id="new_syllabus_notice" style="display: none;">如果列表中没有对应的课程,请您先<%=link_to '创建课程', new_syllabus_path(),:target => '_blank', :class => 'ml5 green_btn_share c_white'%></span>
|
||||
<span class="c_red" id="new_syllabus_notice">如果列表中没有对应的课程,请您先<%=link_to '创建课程', new_syllabus_path(),:target => '_blank', :class => 'ml5 green_btn_share c_white'%></span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ml45">
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<li class="ml45 mb10">
|
||||
<label><span class="c_red">*</span> <%= l(:label_tags_syllabus_name)%> :</label>
|
||||
<%= select_tag :syllabus_id,options_for_select(course_syllabus_option,@course.syllabus_id), {:id=>"edit_syllabus_id", :class=>"syllabus_input", :style=>'width:280px'} %>
|
||||
<span class="c_red" id="edit_syllabus_notice" style="display: none;">如果列表中没有对应的课程,请您先<%=link_to '创建课程', new_syllabus_path(),:target => '_blank', :class => 'ml5 green_btn_share c_white'%></span>
|
||||
<span class="c_red" id="edit_syllabus_notice">如果列表中没有对应的课程,请您先<%=link_to '创建课程', new_syllabus_path(),:target => '_blank', :class => 'ml5 green_btn_share c_white'%></span>
|
||||
</li>
|
||||
<li class="ml45">
|
||||
<label><span class="c_red">*</span> <%= l(:label_tags_course_name)%> :</label>
|
||||
|
|
|
@ -93,6 +93,6 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
|
@ -4,15 +4,15 @@
|
|||
<ul class="fl">
|
||||
<li>
|
||||
<label class="label"><span class="c_red f12">*</span><%= l(:field_status) %>:</label>
|
||||
<% if @issue.safe_attribute?('status_id') && @allowed_statuses.present? %>
|
||||
<%# if @issue.safe_attribute?('status_id') && @allowed_statuses.present? %>
|
||||
<%= f.select :status_id, (@allowed_statuses.collect { |p| [p.name, p.id] }),
|
||||
{:no_label => true},
|
||||
# ajax 刷新
|
||||
#:onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')",
|
||||
:class => "w150" %>
|
||||
<% else %>
|
||||
<%= h(@issue.status.name) %>
|
||||
<% end %>
|
||||
<%# else %>
|
||||
<%#= h(@issue.status.name) %>
|
||||
<%# end %>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li>
|
||||
|
|
|
@ -58,13 +58,6 @@
|
|||
</ul>
|
||||
</div>
|
||||
<li>
|
||||
<%# if @copy_from && @copy_from.attachments.any? %>
|
||||
<!--<p>-->
|
||||
<!-- 去除附件复制功能 -->
|
||||
<!-- <label for="copy_attachments"><#%= l(:label_copy_attachments) %></label>
|
||||
<#%= check_box_tag 'copy_attachments', '1', @copy_attachments %> -->
|
||||
<!--</p>-->
|
||||
<%# end %>
|
||||
<% if @copy_from && !@copy_from.leaf? %>
|
||||
<p>
|
||||
<label for="copy_subtasks"><%= l(:label_copy_subtasks) %></label>
|
||||
|
@ -83,23 +76,6 @@
|
|||
<%= render :partial => 'issues/attributes' %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<!--<div class="newpro_box02 ">-->
|
||||
<!--<label class="label"> <%#= l(:label_issue_watchers) %>:</label>-->
|
||||
<!--<input id="" name="" size="22" class="fl mb10 h26" type="text" placeholder="搜索添加跟踪者">-->
|
||||
<!--<span class="search_for_watchers">-->
|
||||
<%#= link_to "",
|
||||
# {:controller => 'watchers', :action => 'new', :project_id => @issue.project},
|
||||
# :remote => true,
|
||||
# :method => 'get',
|
||||
:class => "pic_sch mt5 ml5" %>
|
||||
<!--</span>-->
|
||||
<%#= javascript_tag "observeSearchfield('user_search', 'users_for_watcher', '#{ escape_javascript watchers_autocomplete_for_user_path(:user => @available_watchers, :format => 'js', :flag => 'ture') }')" %>
|
||||
<!--<div class="cl"></div>-->
|
||||
<!--<span id="watchers_inputs">-->
|
||||
<!--<%#= watchers_checkboxes(@issue, @available_watchers) %>-->
|
||||
<!--</span>-->
|
||||
<!--<div class="cl"></div>-->
|
||||
<!--</div>-->
|
||||
<%= call_hook(:view_issues_form_details_bottom, {:issue => @issue, :form => f}) %>
|
||||
<% end %>
|
||||
<a href="javascript:void(0);" onclick="issue_desc_editor.sync();$('#issue-form').submit();" class="blue_btn fl ml80"> 确定</a>
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
l(:button_delete),
|
||||
{:controller => 'issues',:action => 'delete_journal', :id => issue.id,:journal_id=>reply.id},
|
||||
:method => :get,
|
||||
:remote=>true,
|
||||
:class => 'fr newsGrey mr10',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)
|
||||
|
@ -73,9 +72,9 @@
|
|||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @issue.id %>' name="notes"></textarea>
|
||||
<div class="cl"></div>
|
||||
<div class="mt5 fl">
|
||||
<%= render :partial => 'attachments/issue_reply', :locals => {:container => @issue} %>
|
||||
<%= render :partial => 'attachments/issue_reply', :locals => {:container => @jour.nil? ? @issue : @jour} %>
|
||||
</div>
|
||||
<span nhname='contentmsg_<%= @issue.id %>' class="fl"></span>
|
||||
<span nhname='contentmsg_<%= @issue.id %>' class="fl mt8"></span>
|
||||
<a id="new_message_submit_btn_<%= @issue.id %>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr mt5" style="display:none;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<div class="ReplyToMessageInputContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= @issue.id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => add_reply_issue_path(@issue.id),:method => "post", :remote => true) do |f|%>
|
||||
<%= form_for('new_form',:url => add_reply_issue_path(@issue.id),:method => "post") do |f|%>
|
||||
<%#= kindeditor_tag :notes,"",:height=>"33",:minHeight=>"33",:editor_id=>"issues_reply_editor"%>
|
||||
<!--<div class="cl"></div>-->
|
||||
<input type="hidden" name="quote" value=""/>
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<% if @issue_id %> //issue详情中回复
|
||||
$("#reply_div_<%= @issue_id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => Issue.find( @issue_id),:replies_all_i=>0}) %>");
|
||||
$("#div_issue_attachment_<%=@issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_attachments', :locals => {:issue => Issue.find( @issue_id)}) %>");
|
||||
$("#issue_edit").replaceWith('<%= escape_javascript(render :partial => 'issues/edit') %>')
|
||||
sd_create_editor_from_data(<%= @issue.id%>, null, "100%", "<%=@issue.class.name%>");
|
||||
$("#issue_detail_show").html('<%= escape_javascript(render :partial => 'issues/detail') %>')
|
||||
$("#issue_edit_show").html('<%= escape_javascript(render :partial => 'issues/edit') %>')
|
||||
sd_create_editor_from_data(<%= @issue.id %>, null, "100%", "<%= @issue.class.name %>");
|
||||
issue_desc_editor = KindEditor.create('#issue_description',
|
||||
{"width":"85%",
|
||||
"resizeType":0,
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
}
|
||||
});
|
||||
</script>
|
||||
<div class="homepageRight mt0 ml10" >
|
||||
<div class="homepageRight mt0 ml10" id =issue_show_total"">
|
||||
<div class="homepageRightBanner">
|
||||
<div class="NewsBannerName">问题跟踪</div>
|
||||
</div>
|
||||
|
@ -23,9 +23,13 @@
|
|||
<div class="resources mt10" >
|
||||
<div class="pro_page_box">
|
||||
<div class="problem_main borderBottomNone">
|
||||
<div id="issue_detail_show">
|
||||
<%= render :partial => 'issues/detail'%>
|
||||
</div>
|
||||
<div id="issue_edit_show">
|
||||
<%= render :partial => 'issues/edit'%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--problem_main end-->
|
||||
<div style="clear: both;"></div>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<ul class="shadowbox_news_list">
|
||||
<% messages.each do |ma| %>
|
||||
<% if ma.class == SystemMessage %>
|
||||
<li><a href="<%=user_system_messages_path(User.current) %>" target="_blank" title="Trustie平台 发布新消息:<%= ma.subject.blank? ? (ma.content.nil? ? ma.description.html_safe : ma.content.html_safe) : ma.subject%>"><span class="shadowbox_news_user">Trustie平台 </span>发布新消息:<%= ma.subject.blank? ? (ma.content.nil? ? ma.description.html_safe : ma.content.html_safe) : ma.subject%></a></li>
|
||||
<li><a href="<%=user_system_messages_path(User.current) %>" target="_blank" title="Trustie平台 发布新消息:<%= ma.subject.blank? ? (ma.content.nil? ? message_content(ma.description) : message_content(ma.content)) : ma.subject%>"><span class="shadowbox_news_user">Trustie平台 </span>发布新消息:<%= ma.subject.blank? ? (ma.content.nil? ? message_content(ma.description) : message_content(ma.content)) : ma.subject%></a></li>
|
||||
<% elsif ma.class == CourseMessage %>
|
||||
<% if ma.course_message_type == "News" %>
|
||||
<li><a href="<%=news_path(ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.author.show_name %> 发布了通知:<%= ma.course_message.title%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span>发布了通知:<%= ma.course_message.title%></a></li>
|
||||
|
@ -50,18 +50,18 @@
|
|||
<% elsif ma.course_message_type == "Poll" %>
|
||||
<li><a href="<%= poll_path(ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> 发布了问卷:<%= ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name %>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>发布了问卷:<%= ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name%></a></li>
|
||||
<% elsif ma.course_message_type == "Message" %>
|
||||
<% content = ma.course_message.parent_id.nil? ? ma.course_message.subject : ma.course_message.content.html_safe %>
|
||||
<% content = ma.course_message.parent_id.nil? ? ma.course_message.subject : message_content(ma.course_message.content) %>
|
||||
<% href = board_message_path(ma.course_message.board_id, ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id) %>
|
||||
<li><a href="<%= href %>" target="_blank" title="<%=ma.course_message.author.show_name %> <%= ma.course_message.parent_id.nil? ? "发布了班级帖子:" : "评论了班级帖子:" %><%= content%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span><%= ma.course_message.parent_id.nil? ? "发布了班级帖子:" : "评论了班级帖子:" %><%= content%></a></li>
|
||||
<% elsif ma.course_message_type == "StudentWorksScore" %>
|
||||
<li><a href="<%= student_work_index_path(:homework => ma.course_message.student_work.homework_common_id) %>" target="_blank" title="<%=ma.course_message.reviewer_role == 3 ? '匿名用户' : ma.course_message.user.show_name+"老师" %> <%= ma.status == 0 ? "评阅了您的作品:" : "重新评阅了您的作品:" %><%= ma.content.html_safe if !ma.content.nil?%>"><span class="shadowbox_news_user"><%=ma.course_message.reviewer_role == 3 ? '匿名用户' : ma.course_message.user.show_name+"老师" %> </span><%= ma.status == 0 ? "评阅了您的作品:" : "重新评阅了您的作品:" %><%= ma.content.html_safe if !ma.content.nil?%></a></li>
|
||||
<li><a href="<%= student_work_index_path(:homework => ma.course_message.student_work.homework_common_id) %>" target="_blank" title="<%=ma.course_message.reviewer_role == 3 ? '匿名用户' : ma.course_message.user.show_name+"老师" %> <%= ma.status == 0 ? "评阅了您的作品:" : "重新评阅了您的作品:" %><%= message_content(ma.content) if !ma.content.nil?%>"><span class="shadowbox_news_user"><%=ma.course_message.reviewer_role == 3 ? '匿名用户' : ma.course_message.user.show_name+"老师" %> </span><%= ma.status == 0 ? "评阅了您的作品:" : "重新评阅了您的作品:" %><%= message_content(ma.content) if !ma.content.nil?%></a></li>
|
||||
<% elsif ma.course_message_type == "JournalsForMessage" %>
|
||||
<% if ma.course_message.jour_type == 'Course' %>
|
||||
<li><a href="<%= course_feedback_path(ma.course_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> 在班级中留言了:<%= ma.course_message.notes.html_safe%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>在班级中留言了:<%= ma.course_message.notes.html_safe%></a></li>
|
||||
<li><a href="<%= course_feedback_path(ma.course_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> 在班级中留言了:<%= message_content(ma.course_message.notes)%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>在班级中留言了:<%= message_content(ma.course_message.notes)%></a></li>
|
||||
<% elsif ma.course_message.jour_type == 'HomeworkCommon' %>
|
||||
<li><a href="<%= homework_common_index_url_in_org(ma.course_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> <%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= ma.course_message.notes.html_safe%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span><%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= ma.course_message.notes.html_safe%></a></li>
|
||||
<li><a href="<%= homework_common_index_url_in_org(ma.course_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> <%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= message_content(ma.course_message.notes)%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span><%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= message_content(ma.course_message.notes)%></a></li>
|
||||
<% else %>
|
||||
<li><a href="<%= student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id,:show_work_id => ma.course_message.jour.student_work_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %><%=ma.course_message.user.allowed_to?(:as_teacher, ma.course) ? '老师' : '同学' %> 回复了作品评论:<%= ma.course_message.notes%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %><%=ma.course_message.user.allowed_to?(:as_teacher, ma.course) ? '老师' : '同学' %> </span>回复了作品评论:<%= ma.course_message.notes%></a></li>
|
||||
<li><a href="<%= student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id,:show_work_id => ma.course_message.jour.student_work_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %><%=ma.course_message.user.allowed_to?(:as_teacher, ma.course) ? '老师' : '同学' %> 回复了作品评论:<%= message_content(ma.course_message.notes)%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %><%=ma.course_message.user.allowed_to?(:as_teacher, ma.course) ? '老师' : '同学' %> </span>回复了作品评论:<%= message_content(ma.course_message.notes)%></a></li>
|
||||
<% end %>
|
||||
<% elsif ma.course_message_type == "StudentWork" && !ma.course_message.homework_common.nil? && !User.current.allowed_to?(:as_teacher, ma.course_message.homework_common.course) %>
|
||||
<li><a href="<%=student_work_index_path(:homework => ma.course_message.homework_common_id) %>" target="_blank" title="<%=ma.course_message.homework_common.user.show_name %>老师 发布的作业:<%=ma.course_message.homework_common.name %>,由于迟交作业,您及您的作品都不能参与该作业的匿评"><span class="shadowbox_news_user"><%=ma.course_message.homework_common.user.show_name %>老师 </span>发布的作业:<%=ma.course_message.homework_common.name %>,由于迟交作业,您及您的作品都不能参与该作业的匿评</a></li>
|
||||
|
@ -112,11 +112,11 @@
|
|||
<% end %>
|
||||
<% elsif ma.class == MemoMessage %>
|
||||
<% if ma.memo_type == "Memo" %>
|
||||
<li><a href="<%=forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id) %>" target="_blank" title="<%=ma.memo.author.show_name %> <%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %><%= ma.memo.parent_id.nil? ? ma.memo.subject : ma.memo.content.html_safe%>"><span class="shadowbox_news_user"><%=ma.memo.author.show_name %> </span><%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %><%= ma.memo.parent_id.nil? ? ma.memo.subject : ma.memo.content.html_safe%></a></li>
|
||||
<li><a href="<%=forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id) %>" target="_blank" title="<%=ma.memo.author.show_name %> <%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %><%= ma.memo.parent_id.nil? ? ma.memo.subject : message_content(ma.memo.content)%>"><span class="shadowbox_news_user"><%=ma.memo.author.show_name %> </span><%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %><%= ma.memo.parent_id.nil? ? ma.memo.subject : message_content(ma.memo.content)%></a></li>
|
||||
<% end %>
|
||||
<% elsif ma.class == UserFeedbackMessage %>
|
||||
<% if ma.journals_for_message_type == "JournalsForMessage" %>
|
||||
<li><a href="<%=feedback_path(ma.journals_for_message.jour_id) %>" target="_blank" title="<%=ma.journals_for_message.user.show_name %> <%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %><%= ma.journals_for_message.notes.gsub("<p>","").gsub("</p>","").gsub("<br />","").html_safe%>"><span class="shadowbox_news_user"><%=ma.journals_for_message.user.show_name %> </span><%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %><%= ma.journals_for_message.notes.gsub("<p>","").gsub("</p>","").gsub("<br />","").html_safe%></a></li>
|
||||
<li><a href="<%=feedback_path(ma.journals_for_message.jour_id) %>" target="_blank" title="<%=ma.journals_for_message.user.show_name %> <%= ma.journals_for_message.reply_id == 0 || ma.journals_for_message.reply_id.nil? ? "给你留言了:" : "回复了你的留言:" %><%= message_content(ma.journals_for_message.notes)%>"><span class="shadowbox_news_user"><%=ma.journals_for_message.user.show_name %> </span><%= ma.journals_for_message.reply_id == 0 || ma.journals_for_message.reply_id.nil? ? "给你留言了:" : "回复了你的留言:" %><%= message_content(ma.journals_for_message.notes)%></a></li>
|
||||
<% end %>
|
||||
<% elsif ma.class == OrgMessage %>
|
||||
<% if ma.message_type == 'ApplySubdomain' %>
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
<% else%>
|
||||
<span class="fontGrey">课程英文名称</span>
|
||||
<% end %>
|
||||
<% if User.current == syllabus.user %>
|
||||
<% if User.current == syllabus.user || User.current.admin? %>
|
||||
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);",:id => "syllabus_edit_ng_name_png", :class => "none", :onclick => "show_edit_eng_name();"%>
|
||||
<% end %>
|
|
@ -8,14 +8,14 @@
|
|||
<div id="syllabus_title_show" class="homepageSyllabusName mb5">
|
||||
<%= render :partial => 'layouts/syllabus_title', :locals => {:syllabus => @syllabus}%>
|
||||
</div>
|
||||
<textarea class="syllabusTitleTextarea none" placeholder="请编辑课程名称" id="syllabus_title_edit" onblur="edit_syllabus_title('<%= edit_syllabus_title_syllabus_path(@syllabus.id)%>');"><%= @syllabus.title %></textarea>
|
||||
<textarea class="syllabusTitleTextarea none" placeholder="请编辑课程名称" id="syllabus_title_edit"></textarea>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<div class="mb5" id="syllabus_eng_name_show" style="word-break:normal;word-wrap:normal;">
|
||||
<%= render :partial => 'layouts/syllabus_eng_name', :locals => {:syllabus => @syllabus}%>
|
||||
</div>
|
||||
<textarea class="homepageSignatureTextarea none" placeholder="请编辑英文名称" id="syllabus_eng_name_edit" onblur="edit_syllabus_eng_name('<%= edit_syllabus_eng_name_syllabus_path(@syllabus.id)%>');"><%= @syllabus.eng_name %></textarea>
|
||||
<textarea class="homepageSignatureTextarea none" placeholder="请编辑英文名称" id="syllabus_eng_name_edit"></textarea>
|
||||
</div>
|
||||
<!--
|
||||
<div class="pr_info_foot ">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<span style="word-break: normal; word-wrap: break-word;"><%=@syllabus.title %></span>
|
||||
|
||||
<% if User.current == syllabus.user %>
|
||||
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);",:id => "syllabus_edit_title_png", :class => "none", :onclick => "show_edit_title();"%>
|
||||
<% if User.current == syllabus.user || User.current.admin? %>
|
||||
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);",:id => "syllabus_edit_title_png", :class => "none", :onclick => "show_edit_title('#{@syllabus.title}');"%>
|
||||
<% end %>
|
|
@ -75,8 +75,13 @@
|
|||
<% end%>
|
||||
<% end%>
|
||||
</div>
|
||||
<% courses = User.current.courses.visible.where("is_delete =? and syllabus_id =?", 0, @syllabus.id).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5) %>
|
||||
<% all_count = User.current.courses.visible.where("is_delete =? and syllabus_id =?", 0, @syllabus.id).count%>
|
||||
<% if User.current == @syllabus.user || User.current.admin?
|
||||
all_courses = @syllabus.courses.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")
|
||||
else
|
||||
all_courses = User.current.courses.visible.where("is_delete =? and syllabus_id =?", 0, @syllabus.id).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc")
|
||||
end %>
|
||||
<% courses = all_courses.limit(5) %>
|
||||
<% all_count = all_courses.count%>
|
||||
<div class="homepageLeftMenuCourses <%= courses.empty? ? 'none' : ''%>">
|
||||
<div class = "leftCoursesList" id="homepageLeftMenuCourses">
|
||||
<ul>
|
||||
|
@ -116,16 +121,22 @@
|
|||
<span><%= l(:label_loading) %></span>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$(function() {
|
||||
$('#user_hide_course').hide();
|
||||
$("#syllabus_title_edit").live("blur", function () {
|
||||
edit_syllabus_title('<%= edit_syllabus_title_syllabus_path(@syllabus.id)%>');
|
||||
});
|
||||
$("#syllabus_eng_name_edit").live("blur", function () {
|
||||
edit_syllabus_eng_name('<%= edit_syllabus_eng_name_syllabus_path(@syllabus.id)%>');
|
||||
});
|
||||
|
||||
$("#courseMenu").mouseenter(function(){
|
||||
$("#courseMenu").mouseenter(function () {
|
||||
$("#topnav_course_menu").show();
|
||||
});
|
||||
$("#courseMenu").mouseleave(function(){
|
||||
$("#courseMenu").mouseleave(function () {
|
||||
$("#topnav_course_menu").hide();
|
||||
});
|
||||
});
|
||||
function leftCourseslistChange(){
|
||||
$('#homepageLeftMenuCourses').slideToggle();
|
||||
$('#hide_show_courseicon').toggleClass("homepageLeftMenuHideIcon");
|
||||
|
|
|
@ -4,22 +4,22 @@
|
|||
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$(function () {
|
||||
$("#RSide").removeAttr("id");
|
||||
$("#Container").css("width","1000px");
|
||||
$("#Container").css("width", "1000px");
|
||||
$(".postRightContainer").css("margin-left", "0px");
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
function expand_reply(container,btnid){
|
||||
function expand_reply(container, btnid) {
|
||||
var target = $(container).children();
|
||||
var btn = $(btnid);
|
||||
if(btn.data('init')=='0'){
|
||||
btn.data('init',1);
|
||||
if (btn.data('init') == '0') {
|
||||
btn.data('init', 1);
|
||||
btn.html('收起回复');
|
||||
target.show();
|
||||
}else{
|
||||
btn.data('init',0);
|
||||
} else {
|
||||
btn.data('init', 0);
|
||||
btn.html('展开更多');
|
||||
target.hide();
|
||||
target.eq(0).show();
|
||||
|
@ -28,15 +28,12 @@
|
|||
}
|
||||
}
|
||||
|
||||
function course_board_canel_message_replay()
|
||||
{
|
||||
function course_board_canel_message_replay() {
|
||||
message_content_editor.html("");
|
||||
}
|
||||
|
||||
function course_board_submit_message_replay()
|
||||
{
|
||||
if(MessageReplayVevify())
|
||||
{
|
||||
function course_board_submit_message_replay() {
|
||||
if (MessageReplayVevify()) {
|
||||
message_content_editor.sync();//提交内容之前要sync,不然服务器端取不到值
|
||||
$("#message_form").submit();
|
||||
|
||||
|
@ -57,20 +54,20 @@
|
|||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$(function () {
|
||||
//init_activity_KindEditor_data(<%= @topic.id%>,null,"94%", "<%=@topic.class.to_s%>");
|
||||
sd_create_editor_from_data(<%= @topic.id%>,null,"100%", "<%=@topic.class.to_s%>");
|
||||
sd_create_editor_from_data(<%= @topic.id%>, null, "100%", "<%=@topic.class.to_s%>");
|
||||
showNormalImage('message_description_<%= @topic.id %>');
|
||||
});
|
||||
</script>
|
||||
<div class="postRightContainer ml10" onmouseover="$('#message_setting_<%= @topic.id%>').show();" onmouseout="$('#message_setting_<%= @topic.id%>').hide();">
|
||||
<div class="postThemeContainer">
|
||||
<div class="postDetailPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(@topic.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@topic.author) %>
|
||||
<%= link_to image_tag(url_to_avatar(@topic.author), :width => 50, :height => 50, :alt => '图像'), user_path(@topic.author) %>
|
||||
</div>
|
||||
<div class="postThemeWrap">
|
||||
<% if User.current.logged? %>
|
||||
<div class="homepagePostSetting" id="message_setting_<%= @topic.id%>" style="display: none">
|
||||
<div class="homepagePostSetting" id="message_setting_<%= @topic.id %>" style="display: none">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
|
@ -90,29 +87,29 @@
|
|||
:class => 'postOptionLink'
|
||||
) if @message.org_subfield_editable_by?(User.current) %>
|
||||
</li>
|
||||
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id}, #{User.current.id}, 'message');",:class => 'postOptionLink'%></li>
|
||||
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{@message.id}, #{User.current.id}, 'message');", :class => 'postOptionLink' %></li>
|
||||
<!--<li> <%#= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %></li>-->
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<%end%>
|
||||
<% end %>
|
||||
<div class="postDetailTitle fl">
|
||||
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">主题: <%= @topic.subject%></a>
|
||||
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">主题: <%= @topic.subject %></a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="postDetailCreater">
|
||||
<%= link_to @topic.author.show_name, user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
|
||||
<%= link_to @topic.author.show_name, user_path(@topic.author, :host => Setting.host_user), :class => "linkBlue2", :target => "_blank" %>
|
||||
</div>
|
||||
<div class="postDetailDate mb5"><%= format_time( @topic.created_on)%></div>
|
||||
<div class="postDetailDate mb5"><%= format_time(@topic.created_on) %></div>
|
||||
<div class="cl"></div>
|
||||
<div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @topic.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
|
||||
<%= @topic.content.html_safe%>
|
||||
<div class="homepagePostIntro memo-content upload_img break_word" id="message_description_<%= @topic.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;">
|
||||
<%= @topic.content.html_safe %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @topic} %>
|
||||
<%= render :partial => "attachments/activity_attach", :locals => {:activity => @topic} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
@ -121,49 +118,69 @@
|
|||
<div class="homepagePostReply">
|
||||
<% unless @replies.empty? %>
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复(<%=@reply_count %>)</div>
|
||||
<div class="homepagePostReplyBannerCount">回复
|
||||
<sapn class="mr15"><%= @reply_count>0 ? "(#{@reply_count})" : "" %></sapn>
|
||||
<span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%= @topic.id %>">
|
||||
<%= render :partial => "praise_tread/praise", :locals => {:activity => @topic, :user_activity_id => @topic.id, :type => "activity"} %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"></div>
|
||||
</div>
|
||||
<% all_comments = [] %>
|
||||
<% comments = get_all_children(all_comments, @topic) %>
|
||||
<div class="" id="reply_div_<%= @topic.id %>">
|
||||
<% @replies.each_with_index do |reply,i| %>
|
||||
<% comments.each_with_index do |reply, i| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$(function () {
|
||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||
autoUrl('reply_message_description_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
|
||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33, :height => 33), user_path(reply.author) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<%= link_to reply.author.show_name, user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||
<%= link_to reply.creator_user.show_name, user_url_in_org(reply.creator_user.id), :class => "newsBlue mr10 f14" %>
|
||||
<%= time_from_now(reply.created_on) %>
|
||||
</div>
|
||||
<% if !reply.parent.nil? && !reply.parent.parent.nil? %>
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => reply} %>
|
||||
<% end %>
|
||||
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
|
||||
<%= reply.content.html_safe%>
|
||||
<%= reply.content.html_safe %>
|
||||
</div>
|
||||
<div style="margin-top: -7px; margin-bottom: 5px">
|
||||
<%= format_time(reply.created_on) %>
|
||||
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
||||
<div class="orig_reply mb10 mt-10">
|
||||
<div class="reply">
|
||||
<span class="reply-right">
|
||||
<span id="reply_praise_count_<%= reply.id %>">
|
||||
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
|
||||
</span>
|
||||
<span style="position: relative" class="fr mr20">
|
||||
<%= link_to(
|
||||
l(:button_reply),
|
||||
{:action => 'quote', :id => reply},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:class => 'fr newsBlue',
|
||||
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
|
||||
<span id="reply_iconup_<%= reply.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
||||
</span>
|
||||
<%= link_to(
|
||||
l(:button_delete),
|
||||
{:action => 'destroy', :id => reply},
|
||||
:method => :post,
|
||||
:class => 'fr newsGrey mr10',
|
||||
:class => 'fr mr20',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)
|
||||
) if reply.org_subfield_editable_by?(User.current) %>
|
||||
) if reply.course_destroyable_by?(User.current) %>
|
||||
</span>
|
||||
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<p id="reply_message_<%= reply.id%>"></p>
|
||||
<p id="reply_message_<%= reply.id %>"></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
@ -175,6 +192,7 @@
|
|||
<% if !@topic.locked? && authorize_for_course('messages', 'reply') %>
|
||||
<div class="talkWrapMsg" nhname="about_talk_reply">
|
||||
<em class="talkWrapArrow"></em>
|
||||
|
||||
<div class="cl"></div>
|
||||
<div class="talkConIpt ml5 mb10" id="reply<%= @topic.id %>">
|
||||
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
|
||||
|
@ -189,13 +207,13 @@
|
|||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#message_description_<%= @topic.id %> p,#message_description_<%= @topic.id %> span,#message_description_<%= @topic.id %> em").each(function(){
|
||||
$(function () {
|
||||
$("#message_description_<%= @topic.id %> p,#message_description_<%= @topic.id %> span,#message_description_<%= @topic.id %> em").each(function () {
|
||||
var postContent = $(this).html();
|
||||
postContent = postContent.replace(/ /g," ");
|
||||
postContent= postContent.replace(/ {2}/g," ");
|
||||
postContent=postContent.replace(/ /g," ");
|
||||
postContent=postContent.replace(/ /g," ");
|
||||
postContent = postContent.replace(/ /g, " ");
|
||||
postContent = postContent.replace(/ {2}/g, " ");
|
||||
postContent = postContent.replace(/ /g, " ");
|
||||
postContent = postContent.replace(/ /g, " ");
|
||||
$(this).html(postContent);
|
||||
});
|
||||
autoUrl('message_description_<%= @topic.id %>');
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= reply.id%>'>
|
||||
<%= form_for @org_comment, :as => :reply, :url => {:controller => 'org_document_comments',:action => 'reply', :id => @org_comment.id}, :method => 'post', :html => {:multipart => true, :id => 'new_form'} do |f| %>
|
||||
<input type="hidden" name="quote[quote]" id="quote_quote">
|
||||
<input type="hidden" name="org_document_comment[title]" id="reply_subject">
|
||||
<input type="hidden" name="org_document_comment[title]" value="RE:<%=(OrgDocumentComment.find @org_comment).root.title %>" id="reply_subject">
|
||||
<div nhname='toolbar_container_<%= reply.id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="org_document_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>
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
//location.reload();
|
||||
<% if params[:detail_page] %>
|
||||
<% if @act %>
|
||||
$("#organization_document_<%= @document.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document,:flag => 2, :act => @act}) %>");
|
||||
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 )%>';
|
||||
<% else %>
|
||||
window.location.reload();
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
if($("#reply_message_<%= @org_comment.id%>").length > 0) {
|
||||
$("#reply_message_<%= @org_comment.id%>").replaceWith("<%= escape_javascript(render :partial => 'org_document_comments/simple_ke_reply_form', :locals => {:reply => @org_comment,:temp =>@temp,:subject =>@subject}) %>");
|
||||
$(function(){
|
||||
$('#reply_subject').val("<%= raw escape_javascript(@subject) %>");
|
||||
$('#quote_quote').val("<%= raw escape_javascript(@temp.content.html_safe) %>");
|
||||
sd_create_editor_from_data(<%= @org_comment.id%>,null,"100%", "<%=@org_comment.class.to_s%>");
|
||||
});
|
||||
}else if($("#reply_to_message_<%= @org_comment.id %>").length >0) {
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
//location.reload();
|
||||
<% if @user_activity_id %>
|
||||
$("#organization_document_<%= @document.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document,:flag => 2, :act => @act}) %>");
|
||||
<% end %>
|
||||
sd_create_editor_from_data(<%= @act.id %>,"","100%", "<%=@act.class.to_s%>");
|
||||
|
|
|
@ -74,8 +74,8 @@
|
|||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% comments_for_doc = @document.children.reorder("created_at desc") %>
|
||||
<% count = @document.children.count() %>
|
||||
<% all_comments = []%>
|
||||
<% count=get_all_children(all_comments, @document).count %>
|
||||
|
||||
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= @document.id %>">
|
||||
<%# if count > 0 %>
|
||||
|
@ -87,54 +87,70 @@
|
|||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% all_comments = []%>
|
||||
<% comments = get_all_children(all_comments, @document) %>
|
||||
<div class="" id="reply_div_<%= @document.id %>">
|
||||
<% comments_for_doc.each_with_index do |reply,i| %>
|
||||
<% comments.each do |comment| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_message_description_<%= reply.id %>');
|
||||
autoUrl('reply_message_description_<%= reply.id %>');
|
||||
showNormalImage('reply_content_<%= comment.id %>');
|
||||
autoUrl('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<% user = User.find(reply.creator_id) %>
|
||||
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id %>').hide();">
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(user), :width => 33,:height => 33), user_url_in_org(user.id) %>
|
||||
<%= 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">
|
||||
<%= link_to User.find(reply.creator_id).realname, user_url_in_org(reply.creator_id), :class => "newsBlue mr10 f14" %>
|
||||
<div class="homepagePostReplyContent upload_img break_word" id="reply_message_description_<%= reply.id %>">
|
||||
<%= reply.content.html_safe unless reply.content.nil? %>
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %>
|
||||
<%= time_from_now(comment.created_at) %>
|
||||
</div>
|
||||
<div style="margin-top: -7px; margin-bottom: 5px">
|
||||
<%= format_time(reply.created_at) %>
|
||||
<span id="reply_praise_count_<%=reply.id %>">
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
|
||||
<% if !comment.parent.nil? && !comment.parent.parent.nil? %>
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
|
||||
<% end %>
|
||||
<% if !comment.content_detail.blank? %>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
<%= comment.content_detail.html_safe %>
|
||||
</div>
|
||||
<div class="orig_reply mb10 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>
|
||||
<div class="fr" id="reply_edit_menu_<%= reply.id%>" style="display: none">
|
||||
<span style="position: relative" class="fr mr20">
|
||||
<%= link_to(
|
||||
l(:button_reply),
|
||||
{:controller => 'org_document_comments',:action => 'quote',:user_id=>reply.creator_id, :id => reply.id},
|
||||
{:controller => 'org_document_comments',:action => 'quote',:user_id=>comment.creator_id, :id => comment.id},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:class => 'fr newsBlue mr10',
|
||||
:title => l(:button_reply)) if User.current.logged? %>
|
||||
:title => l(:button_reply)) %>
|
||||
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
||||
</span>
|
||||
<% if comment.creator_user == User.current %>
|
||||
<%= link_to(
|
||||
l(:button_delete),
|
||||
{:controller => 'org_document_comments',:action => 'delete_reply', :id => reply.id},
|
||||
{:controller => 'org_document_comments',:action => 'delete_reply', :id => comment.id},
|
||||
:method => :delete,
|
||||
:class => 'fr newsGrey mr10',
|
||||
:class => 'fr mr20',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)
|
||||
) if reply.creator_id == User.current.id %>
|
||||
</div>
|
||||
</div>
|
||||
<p id="reply_message_<%= reply.id %>"></p>
|
||||
</div>
|
||||
:title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<p id="reply_message_<%= comment.id%>"></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<%# end %>
|
||||
<%# if User.current.logged?%>
|
||||
<div class="talkWrapMsg" nhname="about_talk_reply">
|
||||
|
|
|
@ -69,20 +69,16 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% count = 0 %>
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<% all_comments = []%>
|
||||
<% count=get_all_children(all_comments, activity).count %>
|
||||
<div class="homepagePostReply">
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
|
||||
<%= render :partial => 'users/message_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id,:is_course => 0,:is_board =>0} %>
|
||||
|
||||
<% activity= activity.parent_id.nil? ? activity : activity.parent %>
|
||||
<% comments = activity.children.reorder("created_on desc").limit(3) %>
|
||||
<% all_comments = []%>
|
||||
<% comments = get_all_children(all_comments, activity)[0..2] %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
|
||||
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'Message', :activity_id =>activity.id, :is_course => 0, :is_board =>0}%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -67,15 +67,20 @@
|
|||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% comments_for_doc = document.children.reorder("created_at desc").limit(3) %>
|
||||
<% count = document.children.count() %>
|
||||
<% all_comments = []%>
|
||||
<% count=get_all_children(all_comments, document).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 => document.id} %>
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => document, :user_activity_id => act.id} %>
|
||||
|
||||
<div class="homepagePostReplyContainer" id="reply_div_<%= document.id %>" style="display:<%= count == 0 ? 'none' : 'block' %>">
|
||||
<%= render :partial => 'users/all_replies', :locals => {:comments => comments_for_doc}%>
|
||||
<% all_comments = []%>
|
||||
<% comments = get_all_children(all_comments, document)[0..2] %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= act.id %>">
|
||||
<%= render :partial => 'users/org_document_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) %>
|
||||
|
@ -84,7 +89,6 @@
|
|||
<% 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| %>
|
||||
<input type="hidden" name="org_activity_id" value="<%= act.id %>"/>
|
||||
<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>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<%= link_to "(#{@project.project_score.attach_num})", project_files_path(@project), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %>
|
||||
<% end %>
|
||||
<% if User.current.member_of?(@project) %>
|
||||
<%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
|
||||
<%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml105" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
|
@ -32,6 +32,25 @@
|
|||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
<% if User.current.logged? %>
|
||||
<div class="homepagePostSetting">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<% if User.current.logged? %>
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}',#{User.current.id},'news')") %></li>
|
||||
<li>
|
||||
<%= link_to(l(:button_edit), {:controller => 'news', :action => 'edit', :id => activity}, :class => 'postOptionLink') if activity.author == User.current %>
|
||||
</li>
|
||||
<li>
|
||||
<%= delete_link(news_path(activity), :data => {:confirm => l(:text_are_you_sure)}, :class => 'postOptionLink') if activity.author == User.current %>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
<%= link_to "(#{@project.project_score.attach_num})", project_files_path(@project), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %>
|
||||
<% end %>
|
||||
<% if User.current.member_of?(@project) %>
|
||||
<%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
|
||||
<%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml105" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end%>
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
<!--<%#= f.text_field :wiki_page_title, :size =>60, :label => :label_wiki_page, :disabled => @project.wiki.nil? %>-->
|
||||
<!--</li>-->
|
||||
<li >
|
||||
<label class="label02"><%=l(:label_date)%>:</label>
|
||||
<label class="label02"><%=l(:field_deadline)%>:</label>
|
||||
<%= f.text_field :effective_date, :size => 10, :readonly => true,:class=>" fl" %>
|
||||
<%= calendar_for('version_effective_date') %>
|
||||
</li>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<li class="analysis-result-version fl fontBlue2" >分支</li>
|
||||
<li class="analysis-result-loc fl fontBlue2" >语言</li>
|
||||
<li class="analysis-result-debt fl fontBlue2" >路径</li>
|
||||
<li class="analysis-result-time fl fontBlue2" >编辑</li>
|
||||
<li class="analysis-result-time fl fontBlue2" ></li>
|
||||
<!--<li class="analysis-result-time fl fontBlue2" >bianji</li>-->
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
|
@ -21,16 +21,17 @@
|
|||
<li class="analysis-result-version fl fontBlue2 hidden" title="分支名"><%= qa.branch %></li>
|
||||
<li class="analysis-result-loc fl fontBlue2 hidden" title="语言"><%= qa.language %></li>
|
||||
<li class="analysis-result-debt fl fontBlue2 hidden" title="路径"><%= qa.path %></li>
|
||||
<% if User.current.try(:login) == qa.author_login %>
|
||||
<% if User.current.try(:login) == qa.author_login || User.current.admin? || is_project_manager?(User.current.id, @project.id) %>
|
||||
<li class="analysis-result-time fl" title="编辑">
|
||||
<%=link_to "编辑", edit_project_quality_analysi_path(qa, :project_id => @project.id), :remote => true, :class => "fontBlue2" %>
|
||||
<%=link_to "编辑", edit_project_quality_analysi_path(qa, :project_id => @project.id), :remote => true, :class => "fontBlue2" %><span style="color: #888"> / </span>
|
||||
<%=link_to "删除", delete_project_quality_analysi_path(qa, :project_id => @project.id), :method => "delete", :confirm => "删除会一并删除分析结果,确定删除吗?", :class => "fontBlue2" %>
|
||||
</li>
|
||||
<% else %>
|
||||
<li class="analysis-result-time fl" style="color: #888" title="编辑">编辑</li>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%#= 数据为空时候界面,待完善 %>
|
||||
<% end %>
|
||||
|
||||
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
<% if @build_console_result == false %>
|
||||
分析超时
|
||||
<% else %>
|
||||
<%= h @error_list.output %>
|
||||
<%= h @error_list.try(:output).html_safe %>
|
||||
<% end %>
|
||||
</div>
|
|
@ -1,3 +1,4 @@
|
|||
$("#syllabus_title_show").html("<%= escape_javascript render :partial => 'layouts/syllabus_title', :locals => {:syllabus => @syllabus} %>");
|
||||
$("#syllabus_title_edit").text("");
|
||||
$("#syllabus_title_show").show();
|
||||
$("#syllabus_title_edit").hide();
|
|
@ -0,0 +1,18 @@
|
|||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">
|
||||
<span>回复</span>
|
||||
<span class="reply_iconup" > ︿</span>
|
||||
<sapn class="mr15"><%= count>0 ? "(#{count})" : "" %></sapn><span style="color: #cecece;">▪</span>
|
||||
<span id="praise_count_<%=user_activity_id %>">
|
||||
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||
<%if count>3 %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<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>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
|
@ -0,0 +1,60 @@
|
|||
<ul>
|
||||
<% comments.each do |comment| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= comment.id %>');
|
||||
autoUrl('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= 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">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %>
|
||||
<%= time_from_now(comment.created_on) %>
|
||||
</div>
|
||||
<% if !comment.parent.nil? && !comment.parent.parent.nil? %>
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
|
||||
<% end %>
|
||||
<% if !comment.content_detail.blank? %>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
<%= comment.content_detail.html_safe %>
|
||||
</div>
|
||||
<div class="orig_reply mb10 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', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id, :homepage => homepage},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:title => l(:button_reply)) if !comment.root.locked? %>
|
||||
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
|
||||
</span>
|
||||
<% 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},
|
||||
:method => :delete,
|
||||
:remote => true,
|
||||
:class => 'fr mr20',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<p id="reply_message_<%= comment.id%>"></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
|
@ -3,7 +3,7 @@
|
|||
</div>
|
||||
<div class="orig_right fl">
|
||||
<%= link_to comment.creator_user.show_name, user_path(comment.creator_user.id), :class => "content-username" %>
|
||||
<span class="orig_area"><%= time_from_now(comment.created_on) %></span>
|
||||
<span class="orig_area"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
|
||||
<div class="orig_content "><%= comment.content_detail.html_safe %></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
|
@ -198,10 +198,8 @@
|
|||
<%# first_pro = sort_projects.first %>
|
||||
<% first_pro = Project.find sort_projects.first.project_id %>
|
||||
<% commit_time = first_pro.project_score.commit_time %>
|
||||
<% one_time = first_pro.updated_on %>
|
||||
<% one_forge_time=ForgeActivity.where("project_id=?",first_pro.id).last.updated_at if ForgeActivity.where("project_id=?",first_pro.id).last %>
|
||||
<% one_time= one_time > one_forge_time ? one_time : one_forge_time %>
|
||||
# <%=time_from_now !commit_time.nil? && format_time(commit_time) > format_time(one_time) ? commit_time : one_time %><%= link_to User.find(first_pro.user_id).show_name, user_activities_path(first_pro.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新:
|
||||
# <%=time_from_now !commit_time.nil? && format_time(commit_time) > format_time(one_forge_time) ? commit_time : one_forge_time %><%= link_to User.find(first_pro.user_id).show_name, user_activities_path(first_pro.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新:
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% sort_projects.each_with_index do |pro, i| %>
|
||||
|
@ -223,15 +221,13 @@
|
|||
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像") %>
|
||||
<% end %>
|
||||
<% com_time = project.project_score.commit_time %>
|
||||
<% time=project.updated_on %>
|
||||
<% forge_time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
|
||||
<% time= time > forge_time ? time : forge_time %>
|
||||
<p class="mh18"><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p>
|
||||
<p class="mh18"><%=time_from_now !com_time.nil? && format_time(com_time) > format_time(time) ? com_time : time %> <%= project.project_score.changeset_num %>提交</p>
|
||||
<p class="mh18"><%=time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %> <%= project.project_score.changeset_num %>提交</p>
|
||||
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=activity.id %>">
|
||||
项目名称:<%=project.name %><br />
|
||||
创建者:<%=(User.find project.user_id).show_name %>(组长)<br />
|
||||
更新时间:<%=time_from_now !com_time.nil? && format_time(com_time) > format_time(time) ? com_time : time %>
|
||||
更新时间:<%=time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %>
|
||||
</div>
|
||||
</div>
|
||||
<% if i == 9 && projects.count > 10 %>
|
||||
|
|
|
@ -80,8 +80,6 @@
|
|||
</div>
|
||||
<% all_comments = []%>
|
||||
<% count=get_all_children(all_comments, activity).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/message_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id,:is_course => is_course,:is_board =>is_board} %>
|
||||
|
||||
|
|
|
@ -18,8 +18,7 @@
|
|||
<p>真实姓名:<%= User.find(ma.course_message_id).realname %></p>
|
||||
<p>申请课程:<%= Course.find(ma.course_id).name%></p>
|
||||
<div class="fl">课程描述:</div>
|
||||
<div class="ml60"><%= Course.find(ma.course_id).description %></div>
|
||||
<p>申请职位:<%= ma.content == '9' ? "教师" : "教辅"%></p>
|
||||
<div class="ml60"><%= Course.find(ma.course_id).description.html_safe if Course.find(ma.course_id).description %></div> <p>申请职位:<%= ma.content == '9' ? "教师" : "教辅"%></p>
|
||||
</div>
|
||||
<li class="<%=(ma.status == 0 || ma.status.nil?) ? 'homepageHomeworkContentWarn2' : 'homepageHomeworkContentWarn' %> fl">
|
||||
<span id="deal_info_<%=ma.id%>">
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
<ul>
|
||||
<% comments.each do |comment| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= comment.id %>');
|
||||
autoUrl('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= 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">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %>
|
||||
<%= time_from_now(comment.created_at) %>
|
||||
</div>
|
||||
<% if !comment.parent.nil? && !comment.parent.parent.nil? %>
|
||||
<%= render :partial => 'users/message_contents', :locals => {:comment => comment}%>
|
||||
<% end %>
|
||||
<% if !comment.content_detail.blank? %>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||
<%= comment.content_detail.html_safe %>
|
||||
</div>
|
||||
<div class="orig_reply mb10 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', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => 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 comment.creator_user == User.current %>
|
||||
<%= link_to(
|
||||
l(:button_delete),
|
||||
{:controller => 'org_document_comments',:action => 'destroy', :id => comment.id, :user_activity_id => user_activity_id},
|
||||
:method => :delete,
|
||||
:remote => true,
|
||||
:class => 'fr mr20',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete)) %>
|
||||
<% end %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<p id="reply_message_<%= comment.id%>"></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
|
@ -51,7 +51,7 @@
|
|||
<% when 5%>
|
||||
<span class="fl" title="周报">【周报】</span>
|
||||
<% end %>
|
||||
<%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey ml5" %>
|
||||
<%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey ml5", :target => "_blank" %>
|
||||
<span class='<%= get_issue_priority(activity.priority_id)[0] %>'>
|
||||
<%= get_issue_priority(activity.priority_id)[1] %>
|
||||
</span>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>" onmouseover="$('#message_setting_<%= user_activity_id%>').show();" onmouseout="$('#message_setting_<%= user_activity_id%>').hide();">
|
||||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
|
||||
|
@ -46,7 +46,7 @@
|
|||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
<% if User.current.logged? %>
|
||||
<div class="homepagePostSetting" id="message_setting_<%= user_activity_id%>" style="display: none">
|
||||
<div class="homepagePostSetting" id="message_setting_<%= user_activity_id%>" style="display: block">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
|
|
|
@ -36,14 +36,35 @@
|
|||
<%= hidden_field_tag 'reply_id', params[:reply_id], :value => reply.author.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 %>
|
||||
<!--<input type="hidden" name="quote[quote]" id="quote_quote">
|
||||
<input type="hidden" name="reply[subject]" id="reply_subject">-->
|
||||
<div nhname='toolbar_container_<%= reply.id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="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:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<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.current.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 'reply_id', params[:reply_id], :value => reply.author_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>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= reply.id%>'></p>
|
||||
<% end%>
|
||||
<% elsif @type == 'OrgDocumentComment' %>
|
||||
<%= form_for('new_form', :url => {:controller => 'org_document_comments',:action => 'reply', :id => reply.id}, :method => "post", :remote => true) do |f| %>
|
||||
<input type="hidden" name="org_document_comment[title]" value="RE:<%=(OrgDocumentComment.find @activity_id).title %>" id="reply_subject">
|
||||
<%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>@user_activity_id %>
|
||||
<div nhname='toolbar_container_<%= reply.id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= reply.id%>' name="org_document_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>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= reply.id%>'></p>
|
||||
<% end%>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<% send_ids = send_ids.class == String ? send_ids : send_ids.join(",") %>
|
||||
<% end %>
|
||||
<select class="resourcesSendType" onclick="chooseSendType2('<%= send_id%>','<%= send_ids%>','<%= User.current.id %>','file', '<%= @type %>');">
|
||||
<option value="1">课程</option>
|
||||
<option value="1">班级</option>
|
||||
<option value="2">项目</option>
|
||||
<option value="3" selected>组织</option>
|
||||
</select>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<% send_ids = send_ids.class == String ? send_ids : send_ids.join(",") %>
|
||||
<% end %>
|
||||
<select class="resourcesSendType" onclick="chooseSendType2('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','file', '<%= @type %>');">
|
||||
<option value="1">课程</option>
|
||||
<option value="1">班级</option>
|
||||
<option value="2" selected>项目</option>
|
||||
<option value="3">组织</option>
|
||||
</select>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
function send_submit() {
|
||||
var checkboxs = $("input[name='course_ids[]']:checked");
|
||||
if(checkboxs.length == 0) {
|
||||
$("#choose_courses_notice").text("请先选择课程");
|
||||
$("#choose_courses_notice").text("请先选择班级");
|
||||
} else{
|
||||
$("#choose_courses_notice").text("");
|
||||
$("#choose_course_list_form").submit();
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<div class="sendText fl mr10" style="width: auto">发送到</div>
|
||||
<div class="resourcesSendTo">
|
||||
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id%>','<%= send_ids%>','<%= User.current.id %>','message');">
|
||||
<option value="1">课程</option>
|
||||
<option value="1">班级</option>
|
||||
<option value="2">项目</option>
|
||||
<option value="3">组织</option>
|
||||
</select>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="relateText fl mb10 mr5">发送到</div>
|
||||
<div class="resourcesSendTo mr15">
|
||||
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id%>','<%= send_ids%>','<%= User.current.id %>','message');">
|
||||
<option value="1">课程</option>
|
||||
<option value="1">班级</option>
|
||||
<option value="2">项目</option>
|
||||
<option value="3" selected>组织</option>
|
||||
</select>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="sendText fl mr10" style="width: auto">发送到</div>
|
||||
<div class="resourcesSendTo">
|
||||
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','message');">
|
||||
<option value="1">课程</option>
|
||||
<option value="1">班级</option>
|
||||
<option value="2" selected>项目</option>
|
||||
<option value="3">组织</option>
|
||||
</select>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<div class="sendText fl mr10" style="width: auto">发送到</div>
|
||||
<div class="resourcesSendTo">
|
||||
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id%>','<%= send_ids%>','<%= User.current.id %>','news');">
|
||||
<option value="1">课程</option>
|
||||
<option value="1">班级</option>
|
||||
<option value="2">项目</option>
|
||||
<option value="3">组织</option>
|
||||
</select>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="relateText fl mb10 mr5">发送到</div>
|
||||
<div class="resourcesSendTo mr15">
|
||||
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id%>','<%= send_ids%>','<%= User.current.id %>','news');">
|
||||
<option value="1">课程</option>
|
||||
<option value="1">班级</option>
|
||||
<option value="2">项目</option>
|
||||
<option value="3" selected>组织</option>
|
||||
</select>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="sendText fl mr10" style="width: auto">发送到</div>
|
||||
<div class="resourcesSendTo">
|
||||
<select class="resourcesSendType" onclick="chooseSendType('<%= send_id %>','<%= send_ids %>','<%= User.current.id %>','news');">
|
||||
<option value="1">课程</option>
|
||||
<option value="1">班级</option>
|
||||
<option value="2" selected>项目</option>
|
||||
<option value="3">组织</option>
|
||||
</select>
|
||||
|
|
|
@ -41,14 +41,16 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% count=activity.children.count %>
|
||||
<% all_comments = []%>
|
||||
<% count=get_all_children(all_comments, activity).count %>
|
||||
<div class="homepagePostReply">
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
|
||||
<%= render :partial => 'users/blog_comment_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :homepage => 0} %>
|
||||
|
||||
<% comments = activity.children.reorder("created_on desc").limit(3) %>
|
||||
<% all_comments = []%>
|
||||
<% comments = get_all_children(all_comments, activity)[0..2] %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
|
||||
<%= render :partial => 'users/blog_comments_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'BlogComment', :activity_id =>activity.id, :homepage => 0}%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -208,10 +208,8 @@
|
|||
<div class="mr5 fontGrey2">
|
||||
<% first_pro = Project.find sort_projects.first.project_id %>
|
||||
<% commit_time = first_pro.project_score.commit_time %>
|
||||
<% one_time = first_pro.updated_on %>
|
||||
<% one_forge_time=ForgeActivity.where("project_id=?",first_pro.id).last.updated_at if ForgeActivity.where("project_id=?",first_pro.id).last %>
|
||||
<% one_time= one_time > one_forge_time ? one_time : one_forge_time %>
|
||||
# <%=time_from_now !commit_time.nil? && format_time(commit_time) > format_time(one_time) ? commit_time : one_time %><%= link_to User.find(first_pro.user_id).show_name, user_activities_path(first_pro.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新:
|
||||
# <%=time_from_now !commit_time.nil? && format_time(commit_time) > format_time(one_forge_time) ? commit_time : one_forge_time %><%= link_to User.find(first_pro.user_id).show_name, user_activities_path(first_pro.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新:
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% sort_projects.each_with_index do |pro, i| %>
|
||||
|
@ -233,15 +231,13 @@
|
|||
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage",:id=>"project_img_"+project.id.to_s+"_"+homework_common.id.to_s,:alt =>"项目头像") %>
|
||||
<% end %>
|
||||
<% com_time = project.project_score.commit_time %>
|
||||
<% time=project.updated_on %>
|
||||
<% forge_time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
|
||||
<% time= time > forge_time ? time : forge_time %>
|
||||
<p class="mh18"><span class="captainName" title="<%=(User.find project.user_id).show_name %>"><%=(User.find project.user_id).show_name %></span><span style="vertical-align: top;">(组长)</span></p>
|
||||
<p class="mh18"><%=time_from_now !com_time.nil? && format_time(com_time) > format_time(time) ? com_time : time %> <%= project.project_score.changeset_num %>提交</p>
|
||||
<p class="mh18"><%=time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %> <%= project.project_score.changeset_num %>提交</p>
|
||||
<div class="relatePInfo" id="relatePInfo_<%=project.id %>_<%=homework_common.id %>">
|
||||
项目名称:<%=project.name %><br />
|
||||
创建者:<%=(User.find project.user_id).show_name %>(组长)<br />
|
||||
更新时间:<%=time_from_now !com_time.nil? && format_time(com_time) > format_time(time) ? com_time : time %>
|
||||
更新时间:<%=time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %>
|
||||
</div>
|
||||
</div>
|
||||
<% if i == 9 && projects.count > 10 %>
|
||||
|
|
|
@ -309,7 +309,7 @@
|
|||
</div>
|
||||
<% else %>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.course_message.content.html_safe, board_message_path(ma.course_message.board_id, ma.course_message.parent_id),
|
||||
<%= link_to message_content(ma.course_message.content), board_message_path(ma.course_message.board_id, ma.course_message.parent_id),
|
||||
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
|
@ -348,7 +348,7 @@
|
|||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<% unless ma.content.nil? %>
|
||||
<%= link_to ma.content.html_safe, student_work_index_path(:homework => ma.course_message.student_work.homework_common_id),
|
||||
<%= link_to message_content(ma.content), student_work_index_path(:homework => ma.course_message.student_work.homework_common_id),
|
||||
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
|
@ -387,7 +387,7 @@
|
|||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">在班级中留言了:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.course_message.notes.html_safe, course_feedback_path(:id => ma.course_id),
|
||||
<%= link_to message_content(ma.course_message.notes), course_feedback_path(:id => ma.course_id),
|
||||
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
|
@ -414,7 +414,7 @@
|
|||
</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.course_message.notes.html_safe, homework_common_index_url_in_org( ma.course_id),
|
||||
<%= link_to message_content(ma.course_message.notes), homework_common_index_url_in_org( ma.course_id),
|
||||
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
|
@ -437,7 +437,7 @@
|
|||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">回复了作品评论:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.course_message.notes, student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id,:show_work_id => ma.course_message.jour.student_work_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
|
||||
<%= link_to message_content(ma.course_message.notes), student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id,:show_work_id => ma.course_message.jour.student_work_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
|
||||
<!--:onmouseover => "message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</li>
|
||||
<% else %>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.memo.content.html_safe, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
|
||||
<%= link_to message_content(ma.memo.content), forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
</a>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<span style="color: red;float: left">【系统消息】</span>
|
||||
<li class="homepageSystenMessageContent fl">
|
||||
|
||||
<%= link_to ma.subject.blank? ? (ma.content.nil? ? ma.description.html_safe : ma.content.html_safe) : ma.subject, user_system_messages_path(User.current),
|
||||
<%= link_to ma.subject.blank? ? (ma.content.nil? ? ma.description.html_safe : ma.content.html_safe) : ma.subject, user_system_messages_path(User.current, :anchor => "position_#{ma.id}"),
|
||||
:id => "content_link_#{ma.id}", :target => '_blank' %>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event);",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this));"-->
|
||||
|
|
|
@ -9,9 +9,7 @@
|
|||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %></span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= link_to ma.journals_for_message.notes.gsub("<p>","").gsub("</p>","").gsub("<br />","").html_safe, feedback_path(ma.journals_for_message.jour_id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank'%>
|
||||
<!--:onmouseover =>"message_titile_show($(this),event)",-->
|
||||
<!--:onmouseout => "message_titile_hide($(this))" %>-->
|
||||
<%= link_to message_content(ma.journals_for_message.notes), feedback_path(ma.journals_for_message.jour_id, :anchor => "user_activity_#{ma.journals_for_message.id}"), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank'%>
|
||||
</li>
|
||||
<div style="display: none" class="message_title_red system_message_style" >
|
||||
<% if ma.journals_for_message.reply_id == 0 %>
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
<div class="fl">
|
||||
<div class="syllabus_class_w ">
|
||||
<p class="syllabus_class_title fl"><%=course.name %></p>
|
||||
<span class="fr sy_p_grey">主讲老师:<%=course.teacher.show_name %></span>
|
||||
<span class="fr sy_p_grey hidden" style="max-width: 120px;">主讲老师:<%=course.teacher.show_name %></span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="">
|
||||
|
|
|
@ -3,7 +3,11 @@ $('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :p
|
|||
<% elsif params[:type] == 'JournalsForMessage' %>
|
||||
$('#reply_div_<%= @user_activity_id %>').html('<%=escape_javascript(render :partial => 'users/journal_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :allow_delete => @allow_delete, :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,:is_course => @is_course, :is_board => @is_board}) %>');
|
||||
<% elsif params[:type] == 'BlogComment' %>
|
||||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/blog_comments_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i, :homepage => @homepage}) %>');
|
||||
<% elsif params[:type] == 'OrgDocumentComment' %>
|
||||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/org_document_replies', :locals => {:comments => @journals, :user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i}) %>');
|
||||
<% else %>
|
||||
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/all_replies', :locals => {:comments => @journals}) %>');
|
||||
<% end %>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<% 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})%>");
|
||||
<% elsif @comment.class.to_s == 'Message' %>
|
||||
<% elsif (@comment.class.to_s == 'Message' || @comment.class.to_s == 'BlogComment' ) %>
|
||||
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/journal_comment_reply', :locals => {:comment => @comment.parent})%>");
|
||||
<% else %>
|
||||
$('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/comment_reply', :locals => {:comment => @comment.parent})%>");
|
||||
|
|
|
@ -39,10 +39,10 @@
|
|||
<div class="resource-wrapper mb10">
|
||||
<ul class="resource-banner">
|
||||
<li class="fl resource-switch">
|
||||
<a href="<%= user_homework_type_user_path(@user,:is_import => 0) %>" id="public_homeworks_choose" class="resource-tab resource-tab-active" data-remote="true">题库</a>
|
||||
<a href="<%= user_homework_type_user_path(@user,:is_import => 0) %>" id="public_homeworks_choose" class="resource-tab resource-tab-active" data-remote="true">我的题库</a>
|
||||
</li>
|
||||
<li class="fl resource-switch">
|
||||
<a href="<%= user_homework_type_user_path(@user,:type=>'2',:is_import => 0) %>" id="user_homeworks_choose" class="resource-tab" data-remote="true">我的题库</a>
|
||||
<a href="<%= user_homework_type_user_path(@user,:type=>'2',:is_import => 0) %>" id="user_homeworks_choose" class="resource-tab" style="text-align: center;" data-remote="true">题库</a>
|
||||
</li>
|
||||
<li class="fl resource-switch">
|
||||
<a href="<%= user_homework_type_user_path(@user,:type=>'3',:is_import => 0) %>" id="apply_homeworks_choose" class="resource-tab" data-remote="true">申请题库</a>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<%= render :partial => 'users/selector_for_messages'%>
|
||||
|
||||
<% @sytem_messages.each do |system_message| %>
|
||||
<div class="resources mt10">
|
||||
<div class="resources mt10" id="position_<%= system_message.id %>">
|
||||
<div class="homepagePostBrief break_word">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= image_tag("/images/trustie_logo1.png", :width => "50", :height => "50") %>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!--Modified by young-->
|
||||
<% if version.issues_count > 0 %>
|
||||
<p class="f14 mb5">»<%= l(:label_versions_progress)%></p>
|
||||
<%= progress_bar([version.closed_percent, version.completed_percent], :width => '82%', :legend => ('%0.0f%' % version.completed_percent)) %>
|
||||
<%= progress_bar([version.closed_percent], :width => '648px;', :legend => ('%0.0f%' % version.completed_percent)) %>
|
||||
<p class="progress-info">
|
||||
<%= link_to(l(:label_x_issues, :count => version.issues_count),
|
||||
project_issues_path(version.project, :status_id => '*', :fixed_version_id => version, :set_filter => 1), :class =>"c_dblue",) %>
|
||||
|
|
|
@ -19,13 +19,12 @@
|
|||
<% end %>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<% if @versions.empty? %>
|
||||
<% if @versions.empty? %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% else %>
|
||||
<% else %>
|
||||
<% @versions.each do |version| %>
|
||||
|
||||
<div class="roadmap_box">
|
||||
<div class="roadmap_box">
|
||||
<p><a href="javascript:void(0)" class=" f16 fb c_dblue " target="_blank">
|
||||
<%= link_to_version_show version, :name => version_anchor(version) %>
|
||||
<% if version.completed? %>
|
||||
|
@ -37,7 +36,7 @@
|
|||
</p>
|
||||
<div class="roadmap_pro mb10">
|
||||
<%= render :partial => 'versions/overview', :locals => {:version => version} %>
|
||||
<%= render(:partial => "wiki/content", :locals => {:content => version.wiki_page.content}) if version.wiki_page %>
|
||||
<%#= render(:partial => "wiki/content", :locals => {:content => version.wiki_page.content}) if version.wiki_page %>
|
||||
|
||||
</div><!--roadmap_pro end-->
|
||||
<% if (issues = @issues_by_version[version]) && issues.size > 0 %>
|
||||
|
|
|
@ -790,12 +790,13 @@ RedmineApp::Application.routes.draw do
|
|||
end
|
||||
end
|
||||
|
||||
resources :quality_analysis, :only => [:index, :create, :edit, :update] do
|
||||
resources :quality_analysis, :only => [:index, :create, :edit, :update, :delete] do
|
||||
collection do
|
||||
end
|
||||
member do
|
||||
match 'update_jenkins_job'
|
||||
match 'edit'
|
||||
match 'delete'
|
||||
match 'create'
|
||||
get 'error_list'
|
||||
end
|
||||
|
@ -1039,6 +1040,7 @@ RedmineApp::Application.routes.draw do
|
|||
get 'admin/syllabuses', as: :all_syllabuses
|
||||
get 'admin/non_syllabus_courses', as: :non_syllabus_courses
|
||||
post 'admin/update_course_name'
|
||||
post 'admin/update_syllabus_title'
|
||||
get 'admin/excellent_courses', as: :excellent_courses
|
||||
get 'admin/excellent_all_courses', as: :excellent_all_courses
|
||||
match 'admin/set_excellent_course/:id', :to => 'admin#set_excellent_course'
|
||||
|
|
|
@ -8,12 +8,12 @@ default: &default
|
|||
#secret: "743e038392f1d89540e95f8f7645849a"
|
||||
|
||||
#production
|
||||
#appid: "wx8e1ab05163a28e37"
|
||||
#secret: "beb4d3bc4b32b3557811680835357841"
|
||||
appid: "wx8e1ab05163a28e37"
|
||||
secret: "beb4d3bc4b32b3557811680835357841"
|
||||
|
||||
#test
|
||||
appid: "wxc09454f171153c2d"
|
||||
secret: "dff5b606e34dcafe24163ec82c2715f8"
|
||||
# appid: "wxc09454f171153c2d"
|
||||
# secret: "dff5b606e34dcafe24163ec82c2715f8"
|
||||
|
||||
token: "123456"
|
||||
access_token: "1234567"
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
class DeleteNoneCourseHomework < ActiveRecord::Migration
|
||||
def up
|
||||
count = HomeworkCommon.all.count / 30 + 2
|
||||
transaction do
|
||||
for i in 1 ... count do i
|
||||
HomeworkCommon.page(i).per(30).each do |h|
|
||||
if h.course_id.nil? || h.course.nil?
|
||||
h.destroy
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20160709015740) do
|
||||
ActiveRecord::Schema.define(:version => 20160715091215) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
|
|
@ -15,11 +15,9 @@ namespace :update_homework do
|
|||
unless student_works.nil?
|
||||
student_works.each do |s|
|
||||
project = Project.find s.project_id
|
||||
unless project.nil? && project.gpid.blank?
|
||||
if !project.nil? && !project.gpid.blank?
|
||||
project_time=project.updated_on
|
||||
project_time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last
|
||||
puts "the time is =========================> #{time}"
|
||||
puts "the project_time is =========================> #{project_time}"
|
||||
if time.strftime('%Y-%m-%d %H:%M:%S') < project_time.strftime('%Y-%m-%d %H:%M:%S')
|
||||
#if format_time(time) < format_time(project_time)
|
||||
time = project_time
|
||||
|
@ -31,9 +29,12 @@ namespace :update_homework do
|
|||
changesets = g.commits(project.gpid, :ref_name => default_branch)
|
||||
changesets_latest_coimmit = changesets[0]
|
||||
unless changesets[0].blank?
|
||||
puts "the time is =========================> #{time}"
|
||||
puts "the changesets_latest_coimmit is =========================> #{changesets_latest_coimmit.created_at}"
|
||||
puts "the distance time is =========================> #{changesets_latest_coimmit.created_at.to_time > Time.now}"
|
||||
project_score = project.project_score
|
||||
if project_score.nil?
|
||||
ProjectScore.create(:project_id => project.id, :score => false)
|
||||
else
|
||||
project_score.update_column(:commit_time, changesets_latest_coimmit.created_at.to_time)
|
||||
end
|
||||
if time.strftime('%Y-%m-%d %H:%M:%S') < changesets_latest_coimmit.created_at.to_time.strftime('%Y-%m-%d %H:%M:%S')
|
||||
#if format_time(time) < format_time(changesets_latest_coimmit.created_at)
|
||||
time = changesets_latest_coimmit.created_at.to_time
|
||||
|
|
|
@ -60,8 +60,6 @@ module Trustie
|
|||
|
||||
def get_gitlab_role m
|
||||
case m.roles.first.position
|
||||
when 1,2
|
||||
GUEST
|
||||
when 5
|
||||
REPORTER
|
||||
when 4
|
||||
|
|
|
@ -1409,6 +1409,40 @@ function expand_message_reply(container, btnid, id, type, div_id, is_course, is_
|
|||
}
|
||||
}
|
||||
|
||||
function expand_blog_comment_reply(container, btnid, id, type, div_id, homepage) {
|
||||
var target = $(container);
|
||||
var btn = $(btnid);
|
||||
if (btn.data('init') == '0') {
|
||||
btn.data('init', 1);
|
||||
$.get(
|
||||
'/users/all_journals',
|
||||
{
|
||||
type: type,
|
||||
id: id,
|
||||
div_id: div_id,
|
||||
homepage: homepage
|
||||
},
|
||||
function(data) {
|
||||
|
||||
}
|
||||
);
|
||||
btn.html('收起回复');
|
||||
//target.show();
|
||||
} else if(btn.data('init') == '1') {
|
||||
btn.data('init', 3);
|
||||
btn.html('展开更多');
|
||||
target.hide();
|
||||
target.eq(0).show();
|
||||
target.eq(1).show();
|
||||
target.eq(2).show();
|
||||
}
|
||||
else {
|
||||
btn.data('init', 1);
|
||||
btn.html('收起回复');
|
||||
target.show();
|
||||
}
|
||||
}
|
||||
|
||||
function expand_reply_homework(container, btnid, id, type, div_id, is_in_course, course_activity, user_activity_id) {
|
||||
var target = $(container);
|
||||
var btn = $(btnid);
|
||||
|
|
|
@ -188,10 +188,8 @@ function regex_syllabus_option(str) {
|
|||
var obj = document.getElementById(str + "_syllabus_id");
|
||||
var syllabus = obj.options[obj.selectedIndex];
|
||||
if(parseInt(syllabus.value) == 0) {
|
||||
$("#"+str+"_syllabus_notice").show();
|
||||
return false;
|
||||
} else{
|
||||
$("#"+str+"_syllabus_notice").hide();
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -32,6 +32,7 @@ function submit_syllabus() {
|
|||
|
||||
//编辑英文名称
|
||||
function show_edit_eng_name() {
|
||||
EngEdit = true;
|
||||
$("#syllabus_eng_name_show").hide();
|
||||
$("#syllabus_eng_name_edit").show();
|
||||
$("#syllabus_eng_name_edit").focus();
|
||||
|
@ -39,6 +40,8 @@ function show_edit_eng_name() {
|
|||
|
||||
//编辑英文名称之后提交
|
||||
function edit_syllabus_eng_name(url){
|
||||
if(EngEdit) {
|
||||
EngEdit = false;
|
||||
$.get(
|
||||
url,
|
||||
{ eng_name: $("#syllabus_eng_name_edit").val() },
|
||||
|
@ -46,17 +49,22 @@ function edit_syllabus_eng_name(url){
|
|||
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//编辑课程名称
|
||||
function show_edit_title() {
|
||||
function show_edit_title(str) {
|
||||
IsEdit = true;
|
||||
$("#syllabus_title_show").hide();
|
||||
$("#syllabus_title_edit").show();
|
||||
$("#syllabus_title_edit").text(str);
|
||||
$("#syllabus_title_edit").focus();
|
||||
}
|
||||
|
||||
//编辑课程名称之后提交
|
||||
function edit_syllabus_title(url){
|
||||
if(IsEdit) {
|
||||
IsEdit = false;
|
||||
$.get(
|
||||
url,
|
||||
{ title: $("#syllabus_title_edit").val().trim() },
|
||||
|
@ -64,6 +72,7 @@ function edit_syllabus_title(url){
|
|||
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//展开所有属性
|
||||
|
|
|
@ -605,14 +605,15 @@ img.ui-datepicker-trigger {
|
|||
|
||||
/* 里程碑 */
|
||||
.roadmap_box{ background:#f8f8f8; width:648px; padding:10px; margin-top:5px; border:1px solid #ddd; color:#555;}
|
||||
.progress{ width:520px; height:20px; margin-bottom:5px; background:#e9e9e9;}
|
||||
.closed{ background:#bae0ba; display:block;height:20px; float:left;}
|
||||
.progress{ width:648px; height:20px; margin-bottom:5px; background:#e9e9e9;}
|
||||
.closed{ background:#bae0ba; height:20px;}
|
||||
.done{ background:#d3edd3; display:block;height:20px;float:left;}
|
||||
.roadmap_box{ margin-bottom:10px;}
|
||||
.roadmap_list_ul{border:1px solid #ddd; border-bottom:none; margin-bottom:10px;}
|
||||
.roadmap_list_ul li{border-bottom:1px solid #ddd; height:21px; padding-top:5px; padding-left:10px;}
|
||||
.roadmap_list_ul li:hover{background:#ffffdd;}
|
||||
.text_line_s{ text-decoration:line-through; color:#999;}
|
||||
.del_line{ text-decoration:line-through !important; color:#999;}
|
||||
.roadmap_list_w{ width:555px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
|
||||
|
||||
.wiki_text{ width:663px; height:300px; margin-bottom:10px;}
|
||||
|
|
Loading…
Reference in New Issue