Merge branch 'develop' into hjq_new_course
This commit is contained in:
commit
85d277da0d
2
Gemfile
2
Gemfile
|
@ -44,8 +44,10 @@ group :development do
|
||||||
gem 'grape-swagger'
|
gem 'grape-swagger'
|
||||||
gem 'better_errors', '~> 1.1.0'
|
gem 'better_errors', '~> 1.1.0'
|
||||||
gem 'rack-mini-profiler', '~> 0.9.3'
|
gem 'rack-mini-profiler', '~> 0.9.3'
|
||||||
|
if RUBY_PLATFORM =~ /w32/
|
||||||
gem 'win32console'
|
gem 'win32console'
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
unless RUBY_PLATFORM =~ /w32/
|
unless RUBY_PLATFORM =~ /w32/
|
||||||
|
|
|
@ -418,6 +418,8 @@ class ApplicationController < ActionController::Base
|
||||||
@project = Project.find(params[:project_id])
|
@project = Project.find(params[:project_id])
|
||||||
elsif params[:course_id]
|
elsif params[:course_id]
|
||||||
@course = Course.find(params[:course_id])
|
@course = Course.find(params[:course_id])
|
||||||
|
elsif params[:org_subfield_id]
|
||||||
|
@org_subfield = OrgSubfield.find(params[:org_subfield_id])
|
||||||
end
|
end
|
||||||
rescue ActiveRecord::RecordNotFound
|
rescue ActiveRecord::RecordNotFound
|
||||||
render_404
|
render_404
|
||||||
|
|
|
@ -240,6 +240,8 @@ class AttachmentsController < ApplicationController
|
||||||
format.html { redirect_to_referer_or respond_path(@attachment.container) }
|
format.html { redirect_to_referer_or respond_path(@attachment.container) }
|
||||||
elsif !@attachment.container.nil? && @attachment.container.is_a?(PhoneAppVersion)
|
elsif !@attachment.container.nil? && @attachment.container.is_a?(PhoneAppVersion)
|
||||||
format.html { redirect_to_referer_or mobile_version_path }
|
format.html { redirect_to_referer_or mobile_version_path }
|
||||||
|
elsif !@attachment.container.nil? && @attachment.container.is_a?(OrgSubfield)
|
||||||
|
format.html {redirect_to_referer_or org_subfield_files_path(@attachment.container)}
|
||||||
else
|
else
|
||||||
if @project.nil?
|
if @project.nil?
|
||||||
format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) }
|
format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) }
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
class ExerciseController < ApplicationController
|
class ExerciseController < ApplicationController
|
||||||
layout "base_courses"
|
layout "base_courses"
|
||||||
|
|
||||||
before_filter :find_exercise_and_course, :only => [:create_exercise_question, :edit, :update, :show, :destroy, :commit_exercise, :commit_answer,:publish_exercise,:republish_exercise,:show_student_result]
|
before_filter :find_exercise_and_course, :only => [:create_exercise_question, :edit, :update, :show, :destroy,
|
||||||
before_filter :find_course, :only => [:index,:new,:create,:student_exercise_list]
|
:commit_exercise, :commit_answer,:publish_exercise,:republish_exercise,
|
||||||
|
:show_student_result,:student_exercise_list]
|
||||||
|
before_filter :find_course, :only => [:index,:new,:create]
|
||||||
include ExerciseHelper
|
include ExerciseHelper
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
@ -18,16 +20,16 @@ class ExerciseController < ApplicationController
|
||||||
end_exercises.each do |exercise|
|
end_exercises.each do |exercise|
|
||||||
exercise.update_column('exercise_status', 3)
|
exercise.update_column('exercise_status', 3)
|
||||||
end
|
end
|
||||||
if @course.is_public == 0 && !User.current.member_of_course?(@course)
|
if @course.is_public == 0 && !(User.current.member_of_course?(@course)||User.current.admin?)
|
||||||
render_403
|
render_403
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
remove_invalid_exercise(@course)
|
remove_invalid_exercise(@course)
|
||||||
@is_teacher = User.current.allowed_to?(:as_teacher,@course)
|
@is_teacher = User.current.allowed_to?(:as_teacher,@course)
|
||||||
if @is_teacher
|
if @is_teacher || User.current.admin?
|
||||||
exercises = @course.exercises.order("created_at asc")
|
exercises = @course.exercises.order("created_at asc")
|
||||||
else
|
else
|
||||||
exercises = @course.exercises.where(:exercise_status => 2).order("created_at asc")
|
exercises = @course.exercises.where("exercise_status <> 1").order("created_at asc")
|
||||||
end
|
end
|
||||||
@exercises = paginateHelper exercises,20 #分页
|
@exercises = paginateHelper exercises,20 #分页
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
@ -48,44 +50,29 @@ class ExerciseController < ApplicationController
|
||||||
end_exercises.each do |exercise|
|
end_exercises.each do |exercise|
|
||||||
exercise.update_column('exercise_status', 3)
|
exercise.update_column('exercise_status', 3)
|
||||||
end
|
end
|
||||||
unless User.current.member_of_course?(@course)
|
unless User.current.member_of_course?(@course) || User.current.admin?
|
||||||
render_403
|
render_403
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@exercise = Exercise.find params[:id]
|
@exercise = Exercise.find params[:id]
|
||||||
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
|
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
|
||||||
if @exercise.exercise_status != 2 && (!User.current.allowed_to?(:as_teacher,@course) || User.current.admin?)
|
|
||||||
render_403
|
|
||||||
return
|
|
||||||
end
|
|
||||||
exercise_end = @exercise.end_time > Time.now
|
exercise_end = @exercise.end_time > Time.now
|
||||||
if @exercise.time == -1
|
if @exercise.time == -1
|
||||||
@can_edit_excercise = exercise_end
|
@can_edit_excercise = exercise_end
|
||||||
else
|
else
|
||||||
@can_edit_excercise = (!has_commit_exercise?(@exercise.id,User.current.id)&& exercise_end) || User.current.admin?
|
@can_edit_excercise = !has_commit_exercise?(@exercise.id,User.current.id)&& exercise_end
|
||||||
end
|
end
|
||||||
|
unless @is_teacher
|
||||||
@exercise_user = ExerciseUser.where("user_id=? and exercise_id=?", User.current.id, @exercise.id).first
|
@exercise_user = ExerciseUser.where("user_id=? and exercise_id=?", User.current.id, @exercise.id).first
|
||||||
# 学生点击的时候即创建关联,自动保存
|
if @exercise_user.nil?
|
||||||
#eu = ExerciseUser.create(:user_id => User.current, :exercise_id => @exercise.id, :start_at => Time.now, :status => false)
|
|
||||||
|
|
||||||
# 已提交问卷的用户不能再访问该界面
|
|
||||||
=begin
|
|
||||||
if has_commit_exercise?(@exercise.id, User.current.id) && (!User.current.admin?)
|
|
||||||
respond_to do |format|
|
|
||||||
format.html {render :layout => 'base_courses'}
|
|
||||||
end
|
|
||||||
else
|
|
||||||
=end
|
|
||||||
if !@is_teacher && !has_click_exercise?(@exercise.id, User.current.id)
|
|
||||||
eu = ExerciseUser.create(:user_id => User.current.id, :exercise_id => @exercise.id, :start_at => Time.now, :status => false)
|
eu = ExerciseUser.create(:user_id => User.current.id, :exercise_id => @exercise.id, :start_at => Time.now, :status => false)
|
||||||
@exercise_user = ExerciseUser.where("user_id=? and exercise_id=?", User.current.id, @exercise.id).first
|
@exercise_user = ExerciseUser.where("user_id=? and exercise_id=?", User.current.id, @exercise.id).first
|
||||||
end
|
end
|
||||||
# @percent = get_percent(@exercise,User.current)
|
|
||||||
exercise_questions = @exercise.exercise_questions
|
|
||||||
@exercise_questions = paginateHelper exercise_questions,5 #分页
|
|
||||||
score = calculate_student_score(@exercise, User.current)
|
score = calculate_student_score(@exercise, User.current)
|
||||||
eu = get_exercise_user(@exercise.id, User.current.id)
|
@exercise_user.update_attributes(:score => score)
|
||||||
eu.update_attributes(:score => score)
|
end
|
||||||
|
# @percent = get_percent(@exercise,User.current)
|
||||||
|
@exercise_questions = @exercise.exercise_questions
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {render :layout => 'base_courses'}
|
format.html {render :layout => 'base_courses'}
|
||||||
end
|
end
|
||||||
|
@ -369,8 +356,20 @@ class ExerciseController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def student_exercise_list
|
def student_exercise_list
|
||||||
|
=begin
|
||||||
|
if @exercise.end_time <= Time.now
|
||||||
|
@course.student.each do |student|
|
||||||
|
if ExerciseUser.where("user_id = ? && exercise_id = ?",student.student_id,@exercise.id).empty?
|
||||||
|
ExerciseUser.create(:user_id => student.student_id, :exercise_id => @exercise.id, :start_at => @exercise.end_time, :status => true,:score=>0)
|
||||||
|
end
|
||||||
|
|
||||||
|
s_score = calculate_student_score(@exercise, student.student)
|
||||||
|
exercise_user = ExerciseUser.where("user_id =? and exercise_id=?", student.student_id, @exercise.id).first
|
||||||
|
exercise_user.update_attributes(:score => s_score)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
=end
|
||||||
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
|
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
|
||||||
@exercise = Exercise.find params[:id]
|
|
||||||
@all_exercises = @course.exercises.where("exercise_status > 1").order("created_at desc")
|
@all_exercises = @course.exercises.where("exercise_status > 1").order("created_at desc")
|
||||||
@exercise_count = @exercise.exercise_users.where('score is not NULL').count
|
@exercise_count = @exercise.exercise_users.where('score is not NULL').count
|
||||||
if @is_teacher || (!@exercise.exercise_users.where(:user_id => User.current.id).empty? && @exercise.end_time <= Time.now)
|
if @is_teacher || (!@exercise.exercise_users.where(:user_id => User.current.id).empty? && @exercise.end_time <= Time.now)
|
||||||
|
@ -537,11 +536,8 @@ class ExerciseController < ApplicationController
|
||||||
# @score = 100
|
# @score = 100
|
||||||
if @uncomplete_question.count < 1
|
if @uncomplete_question.count < 1
|
||||||
# 查看是否有已提交记录
|
# 查看是否有已提交记录
|
||||||
eu = get_exercise_user(@exercise.id, User.current.id)
|
cur_exercise_user.score = @score
|
||||||
eu.user_id = User.current.id
|
if cur_exercise_user.save
|
||||||
eu.exercise_id = @exercise.id
|
|
||||||
eu.score = @score
|
|
||||||
if eu.save
|
|
||||||
#redirect_to poll_index_path(:polls_group_id => @course.id,:polls_type => 'Course')
|
#redirect_to poll_index_path(:polls_group_id => @course.id,:polls_type => 'Course')
|
||||||
@status = 0 #提交成功
|
@status = 0 #提交成功
|
||||||
else
|
else
|
||||||
|
@ -550,6 +546,7 @@ class ExerciseController < ApplicationController
|
||||||
else
|
else
|
||||||
@status = 1 #有未做得必答题
|
@status = 1 #有未做得必答题
|
||||||
end
|
end
|
||||||
|
@save = params[:save].to_i if params[:save]
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
|
@ -560,11 +557,11 @@ class ExerciseController < ApplicationController
|
||||||
def show_student_result
|
def show_student_result
|
||||||
@user = User.find params[:user_id]
|
@user = User.find params[:user_id]
|
||||||
@can_edit_excercise = false
|
@can_edit_excercise = false
|
||||||
@exercise_user = ExerciseUser.where("user_id =? and exercise_id=?", @user.id, @exercise.id).first
|
|
||||||
@exercise_questions = @exercise.exercise_questions
|
@exercise_questions = @exercise.exercise_questions
|
||||||
score = calculate_student_score(@exercise, @user)
|
score = calculate_student_score(@exercise, @user)
|
||||||
eu = get_exercise_user(@exercise.id, @user.id)
|
eu = get_exercise_user(@exercise.id, @user.id)
|
||||||
eu.update_attributes(:score => score)
|
eu.update_attributes(:score => score)
|
||||||
|
@exercise_user = ExerciseUser.where("user_id =? and exercise_id=?", @user.id, @exercise.id).first
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {render :layout => 'base_courses'}
|
format.html {render :layout => 'base_courses'}
|
||||||
end
|
end
|
||||||
|
@ -582,15 +579,15 @@ class ExerciseController < ApplicationController
|
||||||
standard_answer = get_user_standard_answer(question, user)
|
standard_answer = get_user_standard_answer(question, user)
|
||||||
unless answer.empty?
|
unless answer.empty?
|
||||||
# 问答题有多个答案
|
# 问答题有多个答案
|
||||||
if question.question_type == 3
|
if question.question_type == 3 && !standard_answer.empty?
|
||||||
if standard_answer.include?(answer.first.answer_text)
|
if standard_answer.include?(answer.first.answer_text)
|
||||||
score1 = score1+ question.question_score unless question.question_score.nil?
|
score1 = score1+ question.question_score unless question.question_score.nil?
|
||||||
end
|
end
|
||||||
elsif question.question_type == 1
|
elsif question.question_type == 1 && !standard_answer.nil?
|
||||||
if answer.first.exercise_choice.choice_position == standard_answer.exercise_choice_id
|
if answer.first.exercise_choice.choice_position == standard_answer.exercise_choice_id
|
||||||
score2 = score2 + question.question_score unless question.question_score.nil?
|
score2 = score2 + question.question_score unless question.question_score.nil?
|
||||||
end
|
end
|
||||||
else
|
elsif question.question_type == 2 && !standard_answer.nil?
|
||||||
arr = get_mulscore(question, user)
|
arr = get_mulscore(question, user)
|
||||||
if arr.to_i == standard_answer.exercise_choice_id
|
if arr.to_i == standard_answer.exercise_choice_id
|
||||||
score3 = score3 + question.question_score unless question.question_score.nil?
|
score3 = score3 + question.question_score unless question.question_score.nil?
|
||||||
|
|
|
@ -186,7 +186,7 @@ class FilesController < ApplicationController
|
||||||
@order = ""
|
@order = ""
|
||||||
@is_remote = false
|
@is_remote = false
|
||||||
if params[:project_id]
|
if params[:project_id]
|
||||||
@isproject = true
|
@container_type = 0
|
||||||
|
|
||||||
if params[:sort]
|
if params[:sort]
|
||||||
params[:sort].split(",").each do |sort_type|
|
params[:sort].split(",").each do |sort_type|
|
||||||
|
@ -246,7 +246,7 @@ class FilesController < ApplicationController
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
elsif params[:course_id]
|
elsif params[:course_id]
|
||||||
@isproject = false
|
@container_type = 1
|
||||||
|
|
||||||
if params[:sort]
|
if params[:sort]
|
||||||
params[:sort].split(",").each do |sort_type|
|
params[:sort].split(",").each do |sort_type|
|
||||||
|
@ -297,6 +297,13 @@ class FilesController < ApplicationController
|
||||||
@tag_list = attachment_tag_list @all_attachments
|
@tag_list = attachment_tag_list @all_attachments
|
||||||
|
|
||||||
render :layout => 'base_courses'
|
render :layout => 'base_courses'
|
||||||
|
elsif params[:org_subfield_id]
|
||||||
|
@container_type = 2
|
||||||
|
@organization = Organization.find(params[:organization_id])
|
||||||
|
@containers = [ OrgSubfield.includes(:attachments).reorder(sort).find(@org_subfield.id)]
|
||||||
|
show_attachments @containers
|
||||||
|
render :layout => 'base_org'
|
||||||
|
# @subfield = params[:org_subfield_id]
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -421,8 +428,39 @@ class FilesController < ApplicationController
|
||||||
redirect_to course_files_url(@course)
|
redirect_to course_files_url(@course)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
elsif @org_subfield
|
||||||
|
@addTag=false
|
||||||
|
# if params[:in_org_subfield_toolbar]
|
||||||
|
# @in_org_subfield_toolbar = params[:in_org_subfield_toolbar]
|
||||||
|
# end
|
||||||
|
attachments = Attachment.attach_filesex(@org_subfield, params[:attachments], params[:org_subfield_attachment_type])
|
||||||
|
|
||||||
|
# if !attachments.empty? && !attachments[:files].blank? && Setting.notified_events.include?('file_added')
|
||||||
|
# Mailer.run.attachments_added(attachments[:files])
|
||||||
|
# end
|
||||||
|
|
||||||
|
# TODO: 临时用 nyan
|
||||||
|
sort_init 'created_on', 'desc'
|
||||||
|
sort_update 'created_on' => "#{Attachment.table_name}.created_on",
|
||||||
|
'filename' => "#{Attachment.table_name}.filename",
|
||||||
|
'size' => "#{Attachment.table_name}.filesize",
|
||||||
|
'downloads' => "#{Attachment.table_name}.downloads"
|
||||||
|
|
||||||
|
@containers = [OrgSubfield.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@org_subfield.id)] #modify by Long Jun
|
||||||
|
# @containers += @org_subfield.versions.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").all.sort
|
||||||
|
|
||||||
|
show_attachments @containers
|
||||||
|
|
||||||
|
@attachtype = 0
|
||||||
|
@contenttype = 0
|
||||||
|
|
||||||
|
respond_to do |format|
|
||||||
|
format.js
|
||||||
|
format.html {
|
||||||
|
redirect_to org_subfield_files_url(@org_subfield)
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -126,6 +126,24 @@ class HomeworkCommonController < ApplicationController
|
||||||
if @homework_detail_manual.comment_status == 1
|
if @homework_detail_manual.comment_status == 1
|
||||||
student_works = @homework.student_works
|
student_works = @homework.student_works
|
||||||
if student_works && student_works.size >= 2
|
if student_works && student_works.size >= 2
|
||||||
|
if @homework.homework_type == 3
|
||||||
|
student_work_projects = @homework.student_work_projects.where("student_work_id is not null")
|
||||||
|
student_work_projects.each_with_index do |pro_work, pro_index|
|
||||||
|
n = @homework_detail_manual.evaluation_num
|
||||||
|
n = n < student_works.size ? n : student_works.size - 1
|
||||||
|
work_index = -1
|
||||||
|
student_works.each_with_index do |stu_work, stu_index|
|
||||||
|
if stu_work.id.to_i == pro_work.student_work_id.to_i
|
||||||
|
work_index = stu_index
|
||||||
|
end
|
||||||
|
end
|
||||||
|
assigned_homeworks = get_assigned_homeworks(student_works, n, work_index)
|
||||||
|
assigned_homeworks.each do |h|
|
||||||
|
student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: pro_work.user_id, student_work_id: h.id)
|
||||||
|
student_works_evaluation_distributions.save
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
student_works.each_with_index do |work, index|
|
student_works.each_with_index do |work, index|
|
||||||
user = work.user
|
user = work.user
|
||||||
n = @homework_detail_manual.evaluation_num
|
n = @homework_detail_manual.evaluation_num
|
||||||
|
@ -136,6 +154,7 @@ class HomeworkCommonController < ApplicationController
|
||||||
student_works_evaluation_distributions.save
|
student_works_evaluation_distributions.save
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
@homework_detail_manual.update_column('comment_status', 2)
|
@homework_detail_manual.update_column('comment_status', 2)
|
||||||
@statue = 1
|
@statue = 1
|
||||||
# 匿评开启消息邮件通知
|
# 匿评开启消息邮件通知
|
||||||
|
@ -143,6 +162,7 @@ class HomeworkCommonController < ApplicationController
|
||||||
Mailer.send_mail_anonymous_comment_open(@homework).deliver
|
Mailer.send_mail_anonymous_comment_open(@homework).deliver
|
||||||
else
|
else
|
||||||
@statue = 2
|
@statue = 2
|
||||||
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@statue = 3
|
@statue = 3
|
||||||
|
@ -277,6 +297,7 @@ class HomeworkCommonController < ApplicationController
|
||||||
@homework = HomeworkCommon.find params[:id]
|
@homework = HomeworkCommon.find params[:id]
|
||||||
@homework_detail_manual = @homework.homework_detail_manual
|
@homework_detail_manual = @homework.homework_detail_manual
|
||||||
@homework_detail_programing = @homework.homework_detail_programing
|
@homework_detail_programing = @homework.homework_detail_programing
|
||||||
|
@homework_detail_group = @homework.homework_detail_group
|
||||||
@course = @homework.course
|
@course = @homework.course
|
||||||
rescue
|
rescue
|
||||||
render_404
|
render_404
|
||||||
|
|
|
@ -142,6 +142,13 @@ class IssuesController < ApplicationController
|
||||||
@project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'#by young
|
@project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'#by young
|
||||||
@available_watchers = (@issue.project.users.sort + @issue.watcher_users).uniq
|
@available_watchers = (@issue.project.users.sort + @issue.watcher_users).uniq
|
||||||
|
|
||||||
|
#id name email
|
||||||
|
#1. issues list persons
|
||||||
|
#2. project persons
|
||||||
|
@at_persons = @journals.map(&:user) + @issue.project.users
|
||||||
|
@at_persons = @at_persons.uniq{|u| u.id}.delete_if{|u| u.id == User.current.id}
|
||||||
|
@at_persons = nil
|
||||||
|
|
||||||
respond_to do |format|``
|
respond_to do |format|``
|
||||||
format.html {
|
format.html {
|
||||||
retrieve_previous_and_next_issue_ids
|
retrieve_previous_and_next_issue_ids
|
||||||
|
|
|
@ -129,7 +129,7 @@ class MyController < ApplicationController
|
||||||
@user.safe_attributes = params[:user]
|
@user.safe_attributes = params[:user]
|
||||||
@user.pref.attributes = params[:pref]
|
@user.pref.attributes = params[:pref]
|
||||||
@user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
|
@user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
|
||||||
@user.login = params[:login]
|
#@user.login = params[:login]
|
||||||
unless @user.user_extensions.nil?
|
unless @user.user_extensions.nil?
|
||||||
if @user.user_extensions.identity == 2
|
if @user.user_extensions.identity == 2
|
||||||
@user.firstname = params[:enterprise_name]
|
@user.firstname = params[:enterprise_name]
|
||||||
|
@ -223,7 +223,7 @@ class MyController < ApplicationController
|
||||||
end
|
end
|
||||||
flash.now[:error] = l(:notice_account_old_wrong_password)
|
flash.now[:error] = l(:notice_account_old_wrong_password)
|
||||||
end
|
end
|
||||||
render :template => 'my/account',:layout=>'base_users_new'
|
render :template => 'my/account',:layout=>'new_base_user'
|
||||||
end
|
end
|
||||||
|
|
||||||
# Create a new feeds key
|
# Create a new feeds key
|
||||||
|
|
|
@ -17,4 +17,8 @@ class OrgSubfieldsController < ApplicationController
|
||||||
@organization = Organization.find(@subfield.organization_id)
|
@organization = Organization.find(@subfield.organization_id)
|
||||||
@subfield.update_attributes(:name => params[:name])
|
@subfield.update_attributes(:name => params[:name])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -30,7 +30,7 @@ class ProjectsController < ApplicationController
|
||||||
before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise,:view_homework_attaches,:join_project]
|
before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise,:view_homework_attaches,:join_project]
|
||||||
before_filter :authorize, :only => [:show, :settings, :edit, :sort_project_members, :update, :modules, :close, :reopen,:view_homework_attaches,:course]
|
before_filter :authorize, :only => [:show, :settings, :edit, :sort_project_members, :update, :modules, :close, :reopen,:view_homework_attaches,:course]
|
||||||
before_filter :authorize_global, :only => [:new, :create,:view_homework_attaches]
|
before_filter :authorize_global, :only => [:new, :create,:view_homework_attaches]
|
||||||
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar]
|
before_filter :require_admin, :only => [ :copy, :unarchive, :destroy, :calendar]
|
||||||
before_filter :file, :statistics #:watcherlist
|
before_filter :file, :statistics #:watcherlist
|
||||||
# 除非项目内人员,不可查看成员, TODO: 完了写报表里去
|
# 除非项目内人员,不可查看成员, TODO: 完了写报表里去
|
||||||
# before_filter :memberAccess, only: :member
|
# before_filter :memberAccess, only: :member
|
||||||
|
@ -697,8 +697,12 @@ class ProjectsController < ApplicationController
|
||||||
flash[:error] = l(:error_can_not_archive_project)
|
flash[:error] = l(:error_can_not_archive_project)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if params[:type] == "project"
|
||||||
|
redirect_to user_path(User.current)
|
||||||
|
else
|
||||||
redirect_to admin_projects_url(:status => params[:status])
|
redirect_to admin_projects_url(:status => params[:status])
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def unarchive
|
def unarchive
|
||||||
@project.unarchive if request.post? && !@project.active?
|
@project.unarchive if request.post? && !@project.active?
|
||||||
|
|
|
@ -3,7 +3,7 @@ class StudentWorkController < ApplicationController
|
||||||
include StudentWorkHelper
|
include StudentWorkHelper
|
||||||
require 'bigdecimal'
|
require 'bigdecimal'
|
||||||
require "base64"
|
require "base64"
|
||||||
before_filter :find_homework, :only => [:new, :index, :create, :student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :program_test,:set_score_rule,:forbidden_anonymous_comment,:delete_work]
|
before_filter :find_homework, :only => [:new, :index, :create, :student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :program_test,:set_score_rule,:forbidden_anonymous_comment,:delete_work,:new_student_work_project,:student_work_project,:cancel_relate_project,:search_course_students]
|
||||||
before_filter :find_work, :only => [:edit, :update, :show, :destroy, :add_score, :praise_student_work,:retry_work,:revise_attachment]
|
before_filter :find_work, :only => [:edit, :update, :show, :destroy, :add_score, :praise_student_work,:retry_work,:revise_attachment]
|
||||||
before_filter :member_of_course, :only => [:index, :new, :create, :show, :add_score, :praise_student_work]
|
before_filter :member_of_course, :only => [:index, :new, :create, :show, :add_score, :praise_student_work]
|
||||||
before_filter :author_of_work, :only => [:edit, :update, :destroy]
|
before_filter :author_of_work, :only => [:edit, :update, :destroy]
|
||||||
|
@ -95,12 +95,27 @@ class StudentWorkController < ApplicationController
|
||||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name
|
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name
|
||||||
@show_all = true
|
@show_all = true
|
||||||
elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的
|
elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的
|
||||||
|
if @homework.homework_type == 3
|
||||||
|
pro = @homework.student_work_projects.where(:user_id => User.current.id).first
|
||||||
|
@stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:id => pro.student_work_id)
|
||||||
|
else
|
||||||
@stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
@stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
||||||
|
end
|
||||||
elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表
|
elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表
|
||||||
|
if @homework.homework_type == 3
|
||||||
|
pro = @homework.student_work_projects.where(:user_id => User.current.id).first
|
||||||
|
my_work = @homework.student_works.where(:id => pro.student_work_id)
|
||||||
|
else
|
||||||
my_work = @homework.student_works.where(:user_id => User.current.id)
|
my_work = @homework.student_works.where(:user_id => User.current.id)
|
||||||
|
end
|
||||||
@stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id}
|
@stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id}
|
||||||
elsif @homework.homework_detail_manual.comment_status == 3 #学生 && 关闭匿评 未提交作品之前列表为空,提交了作品看到所有的
|
elsif @homework.homework_detail_manual.comment_status == 3 #学生 && 关闭匿评 未提交作品之前列表为空,提交了作品看到所有的
|
||||||
|
if @homework.homework_type == 3
|
||||||
|
pro = @homework.student_work_projects.where(:user_id => User.current.id).first
|
||||||
|
my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:id => pro.student_work_id)
|
||||||
|
else
|
||||||
my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
||||||
|
end
|
||||||
if my_work.empty?
|
if my_work.empty?
|
||||||
@stundet_works = []
|
@stundet_works = []
|
||||||
else
|
else
|
||||||
|
@ -116,12 +131,27 @@ class StudentWorkController < ApplicationController
|
||||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name
|
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name
|
||||||
@show_all = true
|
@show_all = true
|
||||||
elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的
|
elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的
|
||||||
|
if @homework.homework_type == 3
|
||||||
|
pro = @homework.student_work_projects.where(:user_id => User.current.id).first
|
||||||
|
@stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:id => pro.student_work_id)
|
||||||
|
else
|
||||||
@stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
@stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
||||||
|
end
|
||||||
elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表
|
elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表
|
||||||
|
if @homework.homework_type == 3
|
||||||
|
pro = @homework.student_work_projects.where(:user_id => User.current.id).first
|
||||||
|
my_work = @homework.student_works.where(:id => pro.student_work_id)
|
||||||
|
else
|
||||||
my_work = @homework.student_works.where(:user_id => User.current.id)
|
my_work = @homework.student_works.where(:user_id => User.current.id)
|
||||||
|
end
|
||||||
@stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id}
|
@stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id}
|
||||||
elsif @homework.homework_detail_manual.comment_status == 3 #学生 && 关闭匿评 未提交作品之前列表为空,提交了作品看到所有的
|
elsif @homework.homework_detail_manual.comment_status == 3 #学生 && 关闭匿评 未提交作品之前列表为空,提交了作品看到所有的
|
||||||
|
if @homework.homework_type == 3
|
||||||
|
pro = @homework.student_work_projects.where(:user_id => User.current.id).first
|
||||||
|
my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:id => pro.student_work_id)
|
||||||
|
else
|
||||||
my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
||||||
|
end
|
||||||
if my_work.empty?
|
if my_work.empty?
|
||||||
@stundet_works = []
|
@stundet_works = []
|
||||||
else
|
else
|
||||||
|
@ -190,6 +220,10 @@ class StudentWorkController < ApplicationController
|
||||||
student_work.user_id = User.current.id
|
student_work.user_id = User.current.id
|
||||||
student_work.save_attachments(params[:attachments])
|
student_work.save_attachments(params[:attachments])
|
||||||
render_attachment_warning_if_needed(student_work)
|
render_attachment_warning_if_needed(student_work)
|
||||||
|
if @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1
|
||||||
|
@student_work_project = @homework.student_work_projects.where("user_id = #{User.current.id}").first
|
||||||
|
student_work.project_id = @student_work_project.project_id
|
||||||
|
end
|
||||||
#提交作品时,计算是否迟交
|
#提交作品时,计算是否迟交
|
||||||
if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d")
|
if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d")
|
||||||
student_work.late_penalty = @homework.late_penalty
|
student_work.late_penalty = @homework.late_penalty
|
||||||
|
@ -197,6 +231,35 @@ class StudentWorkController < ApplicationController
|
||||||
student_work.late_penalty = 0
|
student_work.late_penalty = 0
|
||||||
end
|
end
|
||||||
if student_work.save
|
if student_work.save
|
||||||
|
if @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1
|
||||||
|
@student_work_project.student_work_id = student_work.id
|
||||||
|
@student_work_project.save
|
||||||
|
members = params[:group_member_ids].split(',')
|
||||||
|
for i in 1 .. members.count-1
|
||||||
|
stu_project = StudentWorkProject.new
|
||||||
|
stu_project.homework_common_id = @homework.id
|
||||||
|
stu_project.student_work_id = student_work.id
|
||||||
|
stu_project.project_id = @student_work_project.project_id
|
||||||
|
stu_project.user_id = members[i].to_i
|
||||||
|
stu_project.is_leader = 0
|
||||||
|
stu_project.save
|
||||||
|
end
|
||||||
|
elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0
|
||||||
|
members = params[:group_member_ids].split(',')
|
||||||
|
for i in 0 .. members.count-1
|
||||||
|
stu_project = StudentWorkProject.new
|
||||||
|
stu_project.homework_common_id = @homework.id
|
||||||
|
stu_project.student_work_id = student_work.id
|
||||||
|
stu_project.project_id = -1
|
||||||
|
stu_project.user_id = members[i].to_i
|
||||||
|
if i == 0
|
||||||
|
stu_project.is_leader = 1
|
||||||
|
else
|
||||||
|
stu_project.is_leader = 0
|
||||||
|
end
|
||||||
|
stu_project.save
|
||||||
|
end
|
||||||
|
end
|
||||||
course_activity = CourseActivity.where("course_act_type='HomeworkCommon' and course_act_id =#{@homework.id}").first
|
course_activity = CourseActivity.where("course_act_type='HomeworkCommon' and course_act_id =#{@homework.id}").first
|
||||||
if course_activity
|
if course_activity
|
||||||
course_activity.updated_at = Time.now
|
course_activity.updated_at = Time.now
|
||||||
|
@ -207,6 +270,9 @@ class StudentWorkController < ApplicationController
|
||||||
user_activity.updated_at = Time.now
|
user_activity.updated_at = Time.now
|
||||||
user_activity.save
|
user_activity.save
|
||||||
end
|
end
|
||||||
|
course_message = CourseMessage.new(:user_id =>User.current.id,:content=>"new",:course_message_id=>student_work.id,:course_id => @course.id,:course_message_type=>"StudentWork", :status => 9) #作品提交记录
|
||||||
|
course_message.save
|
||||||
|
|
||||||
@student_work = StudentWork.where(homework_common_id: @homework.id, user_id: User.current.id).first
|
@student_work = StudentWork.where(homework_common_id: @homework.id, user_id: User.current.id).first
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
|
@ -236,10 +302,11 @@ class StudentWorkController < ApplicationController
|
||||||
@submit_result = true
|
@submit_result = true
|
||||||
@work.name = params[:student_work][:name]
|
@work.name = params[:student_work][:name]
|
||||||
@work.description = params[:student_work][:description]
|
@work.description = params[:student_work][:description]
|
||||||
@work.project_id = params[:student_work][:project]
|
|
||||||
@work.save_attachments(params[:attachments])
|
@work.save_attachments(params[:attachments])
|
||||||
render_attachment_warning_if_needed(@work)
|
render_attachment_warning_if_needed(@work)
|
||||||
if @work.save
|
if @work.save
|
||||||
|
course_message = CourseMessage.new(:user_id =>User.current.id,:content=>"edit",:course_message_id=>@work.id,:course_id => @course.id,:course_message_type=>"StudentWork", :status => 9) #作品提交记录
|
||||||
|
course_message.save
|
||||||
=begin
|
=begin
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
|
@ -276,6 +343,18 @@ class StudentWorkController < ApplicationController
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
if @work.destroy
|
if @work.destroy
|
||||||
|
if @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1
|
||||||
|
pros = @work.student_work_projects.where("is_leader = 0")
|
||||||
|
pros.each do |pro|
|
||||||
|
pro.destroy
|
||||||
|
end
|
||||||
|
project = @work.student_work_projects.where("is_leader = 1").first
|
||||||
|
project.update_attributes(:student_work_id => nil)
|
||||||
|
elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0
|
||||||
|
@work.student_work_projects.each do |pro2|
|
||||||
|
pro2.destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
redirect_to student_work_index_url(:homework => @homework.id)
|
redirect_to student_work_index_url(:homework => @homework.id)
|
||||||
|
@ -288,12 +367,36 @@ class StudentWorkController < ApplicationController
|
||||||
@work = StudentWork.where("user_id =? and homework_common_id =?", User.current.id, @homework.id).first
|
@work = StudentWork.where("user_id =? and homework_common_id =?", User.current.id, @homework.id).first
|
||||||
if @work
|
if @work
|
||||||
@work.destroy
|
@work.destroy
|
||||||
|
if @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1
|
||||||
|
pros = @work.student_work_projects.where("is_leader = 0")
|
||||||
|
pros.each do |pro|
|
||||||
|
pro.destroy
|
||||||
|
end
|
||||||
|
project = @work.student_work_projects.where("is_leader = 1").first
|
||||||
|
project.update_attributes(:student_work_id => nil)
|
||||||
|
elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0
|
||||||
|
@work.student_work_projects.each do |pro2|
|
||||||
|
pro2.destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
redirect_to user_homeworks_user_path(User.current.id)
|
redirect_to user_homeworks_user_path(User.current.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def retry_work
|
def retry_work
|
||||||
if @work.destroy
|
if @work.destroy
|
||||||
|
if @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1
|
||||||
|
pros = @work.student_work_projects.where("is_leader = 0")
|
||||||
|
pros.each do |pro|
|
||||||
|
pro.destroy
|
||||||
|
end
|
||||||
|
project = @work.student_work_projects.where("is_leader = 1").first
|
||||||
|
project.update_attributes(:student_work_id => nil)
|
||||||
|
elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0
|
||||||
|
@work.student_work_projects.each do |pro2|
|
||||||
|
pro2.destroy
|
||||||
|
end
|
||||||
|
end
|
||||||
@student_work = StudentWork.new
|
@student_work = StudentWork.new
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
|
@ -540,7 +643,90 @@ class StudentWorkController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def new_student_work_project
|
||||||
|
@user_activity_id = params[:user_activity_id].to_i
|
||||||
|
@is_in_course = params[:is_in_course].to_i
|
||||||
|
@course_activity = params[:course_activity].to_i
|
||||||
|
respond_to do |format|
|
||||||
|
format.js
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
#创建作业的关联项目
|
||||||
|
def student_work_project
|
||||||
|
@project = StudentWorkProject.new
|
||||||
|
@project.homework_common_id = @homework.id
|
||||||
|
@project.project_id = (Project.find params[:projectName].to_i).id
|
||||||
|
@project.user_id = User.current.id
|
||||||
|
@project.is_leader = 1
|
||||||
|
if @project.save
|
||||||
|
@user_activity_id = params[:user_activity_id].to_i
|
||||||
|
@is_in_course = params[:is_in_course].to_i
|
||||||
|
@course_activity = params[:course_activity].to_i
|
||||||
|
respond_to do |format|
|
||||||
|
format.js
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
#查找学生创建的项目列表
|
||||||
|
def search_user_projects
|
||||||
|
condition = '%%'
|
||||||
|
if !params[:name].nil?
|
||||||
|
condition = "%#{params[:name].strip}%".gsub(" ","")
|
||||||
|
end
|
||||||
|
@project_ids = Project.where("user_id = #{User.current.id} and name like '#{condition}'")
|
||||||
|
@first = params[:first].to_i
|
||||||
|
respond_to do |format|
|
||||||
|
format.js
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
#查找课程的学生
|
||||||
|
def search_course_students
|
||||||
|
name = ""
|
||||||
|
unless params[:name].nil?
|
||||||
|
name = params[:name]
|
||||||
|
end
|
||||||
|
all_student_ids = "(" + @homework.course.student.map{|student| student.student_id}.join(",") + ")"
|
||||||
|
all_students = User.where("id in #{all_student_ids}")
|
||||||
|
@commit_student_ids = @homework.student_work_projects.map{|student| student.user_id}
|
||||||
|
@users = searchstudent_by_name all_students,name
|
||||||
|
respond_to do |format|
|
||||||
|
format.js
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def cancel_relate_project
|
||||||
|
relate_pro = StudentWorkProject.where("user_id = #{User.current.id} and homework_common_id = #{@homework.id}").first
|
||||||
|
if relate_pro.destroy
|
||||||
|
@user_activity_id = params[:user_activity_id].to_i
|
||||||
|
@is_in_course = params[:is_in_course].to_i
|
||||||
|
@course_activity = params[:course_activity].to_i
|
||||||
|
respond_to do |format|
|
||||||
|
format.js
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
def searchstudent_by_name users, name
|
||||||
|
mems = []
|
||||||
|
if name != ""
|
||||||
|
name = name.to_s.downcase
|
||||||
|
users.each do |m|
|
||||||
|
username = m.lastname.to_s.downcase + m.firstname.to_s.downcase
|
||||||
|
if(m.login.to_s.downcase.include?(name) || m.user_extensions[:student_id].to_s.downcase.include?(name) || username.include?(name))
|
||||||
|
mems << m
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
mems = users
|
||||||
|
end
|
||||||
|
mems
|
||||||
|
end
|
||||||
|
|
||||||
def hsd_committed_work?(user, homework)
|
def hsd_committed_work?(user, homework)
|
||||||
sw = StudentWork.where("user_id =? and homework_common_id =?", user, homework).first
|
sw = StudentWork.where("user_id =? and homework_common_id =?", user, homework).first
|
||||||
sw.nil? ? result = false : result = true
|
sw.nil? ? result = false : result = true
|
||||||
|
@ -737,7 +923,7 @@ class StudentWorkController < ApplicationController
|
||||||
#成绩计算
|
#成绩计算
|
||||||
def set_final_score homework,student_work
|
def set_final_score homework,student_work
|
||||||
if homework && homework.homework_detail_manual
|
if homework && homework.homework_detail_manual
|
||||||
if homework.homework_type == 1 #匿评作业
|
if homework.homework_type != 2 #匿评作业
|
||||||
if homework.teacher_priority == 1 #教师优先
|
if homework.teacher_priority == 1 #教师优先
|
||||||
if student_work.teacher_score
|
if student_work.teacher_score
|
||||||
student_work.final_score = student_work.teacher_score
|
student_work.final_score = student_work.teacher_score
|
||||||
|
|
|
@ -551,12 +551,21 @@ class UsersController < ApplicationController
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
#分组作业
|
||||||
|
if homework.homework_type == 3
|
||||||
|
homework_detail_group = HomeworkDetailGroup.new
|
||||||
|
homework.homework_detail_group = homework_detail_group
|
||||||
|
homework_detail_group.min_num = params[:min_num].to_i
|
||||||
|
homework_detail_group.max_num = params[:max_num].to_i
|
||||||
|
homework_detail_group.base_on_project = params[:base_on_project].to_i
|
||||||
end
|
end
|
||||||
|
|
||||||
if homework.save
|
if homework.save
|
||||||
homework_detail_manual.save if homework_detail_manual
|
homework_detail_manual.save if homework_detail_manual
|
||||||
homework_detail_programing.save if homework_detail_programing
|
homework_detail_programing.save if homework_detail_programing
|
||||||
|
homework_detail_group.save if homework_detail_group
|
||||||
|
|
||||||
if params[:is_in_course] == "1"
|
if params[:is_in_course] == "1"
|
||||||
redirect_to homework_common_index_path(:course => homework.course_id)
|
redirect_to homework_common_index_path(:course => homework.course_id)
|
||||||
|
|
|
@ -161,7 +161,7 @@ class WelcomeController < ApplicationController
|
||||||
query: @name,
|
query: @name,
|
||||||
type:"most_fields",
|
type:"most_fields",
|
||||||
operator: "or",
|
operator: "or",
|
||||||
fields: ['login', 'firstname','lastname','name','description^0.5','filename']
|
fields: ['login', 'firstname','lastname','name','description^0.5','filename','subject','content^0.5']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
highlight: {
|
highlight: {
|
||||||
|
@ -173,10 +173,12 @@ class WelcomeController < ApplicationController
|
||||||
lastname: {},
|
lastname: {},
|
||||||
name:{},
|
name:{},
|
||||||
description:{},
|
description:{},
|
||||||
filename:{}
|
filename:{},
|
||||||
|
subject:{},
|
||||||
|
content:{}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},[User,Course,Attachment,Project] ).page(params[:page] || 1).per(20).results
|
},[User,Course,Attachment,Project,Memo] ).page(params[:page] || 1).per(20).results
|
||||||
when 'user'
|
when 'user'
|
||||||
@users = User.search(@name).page(params[:page] || 1).per(20)
|
@users = User.search(@name).page(params[:page] || 1).per(20)
|
||||||
when 'project'
|
when 'project'
|
||||||
|
@ -185,6 +187,8 @@ class WelcomeController < ApplicationController
|
||||||
@courses = Course.search(@name).page(params[:page] || 1).per(20).results
|
@courses = Course.search(@name).page(params[:page] || 1).per(20).results
|
||||||
when 'attachment'
|
when 'attachment'
|
||||||
@attachments = Attachment.search(@name).page(params[:page] || 1).per(20).results
|
@attachments = Attachment.search(@name).page(params[:page] || 1).per(20).results
|
||||||
|
when 'memo'
|
||||||
|
@memos = Memo.search(@name).page(params[:page] || 1).per(20).results
|
||||||
else
|
else
|
||||||
@alls = Elasticsearch::Model.search({
|
@alls = Elasticsearch::Model.search({
|
||||||
query: {
|
query: {
|
||||||
|
@ -192,7 +196,7 @@ class WelcomeController < ApplicationController
|
||||||
query: @name,
|
query: @name,
|
||||||
type:"most_fields",
|
type:"most_fields",
|
||||||
operator: "or",
|
operator: "or",
|
||||||
fields: ['login', 'firstname','lastname','name','description^0.5','filename']
|
fields: ['login', 'firstname','lastname','name','description^0.5','filename','subject','content^0.5']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
highlight: {
|
highlight: {
|
||||||
|
@ -204,10 +208,12 @@ class WelcomeController < ApplicationController
|
||||||
lastname: {},
|
lastname: {},
|
||||||
name:{},
|
name:{},
|
||||||
description:{},
|
description:{},
|
||||||
filename:{}
|
filename:{},
|
||||||
|
subject:{},
|
||||||
|
content:{}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},[User,Course,Attachment,Project] ).page(params[:page] || 1).per(20).results
|
},[User,Course,Attachment,Project,Memo] ).page(params[:page] || 1).per(20).results
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -216,13 +222,14 @@ class WelcomeController < ApplicationController
|
||||||
@course_count = Course.search(@name).results.total
|
@course_count = Course.search(@name).results.total
|
||||||
@attach_count = Attachment.search(@name).results.total
|
@attach_count = Attachment.search(@name).results.total
|
||||||
@project_count = Project.search(@name).results.total
|
@project_count = Project.search(@name).results.total
|
||||||
|
@memo_count = Memo.search(@name).results.total
|
||||||
@total_count = Elasticsearch::Model.search({
|
@total_count = Elasticsearch::Model.search({
|
||||||
query: {
|
query: {
|
||||||
multi_match: {
|
multi_match: {
|
||||||
query: @name,
|
query: @name,
|
||||||
type:"most_fields",
|
type:"most_fields",
|
||||||
operator: "or",
|
operator: "or",
|
||||||
fields: ['login', 'firstname','lastname','name','description^0.5','filename']
|
fields: ['login', 'firstname','lastname','name','description^0.5','filename','subject','content^0.5']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
highlight: {
|
highlight: {
|
||||||
|
@ -234,10 +241,12 @@ class WelcomeController < ApplicationController
|
||||||
lastname: {},
|
lastname: {},
|
||||||
name:{},
|
name:{},
|
||||||
description:{},
|
description:{},
|
||||||
filename:{}
|
filename:{},
|
||||||
|
subject:{},
|
||||||
|
content:{}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},[User,Course,Attachment,Project] ).results.total
|
},[User,Course,Attachment,Project,Memo] ).results.total
|
||||||
# search_type = params[:search_type].to_sym unless search_condition.blank?
|
# search_type = params[:search_type].to_sym unless search_condition.blank?
|
||||||
# search_by = params[:search_by]
|
# search_by = params[:search_by]
|
||||||
#
|
#
|
||||||
|
|
|
@ -1934,6 +1934,8 @@ module ApplicationHelper
|
||||||
candown = true
|
candown = true
|
||||||
elsif attachment.container.class.to_s=="StudentWork"
|
elsif attachment.container.class.to_s=="StudentWork"
|
||||||
candown = true
|
candown = true
|
||||||
|
elsif attachment.container.class.to_s=="BlogComment"
|
||||||
|
candown = true
|
||||||
elsif attachment.container.class.to_s == "User"
|
elsif attachment.container.class.to_s == "User"
|
||||||
candown = (attachment.is_public == 1 || attachment.is_public == true || attachment.author_id == User.current.id)
|
candown = (attachment.is_public == 1 || attachment.is_public == true || attachment.author_id == User.current.id)
|
||||||
elsif attachment.container_type == "Bid" && attachment.container && attachment.container.courses
|
elsif attachment.container_type == "Bid" && attachment.container && attachment.container.courses
|
||||||
|
@ -2435,10 +2437,19 @@ module ApplicationHelper
|
||||||
link_to "作品(#{homework.student_works.count})",student_work_index_path(:homework => homework.id),:class => "c_blue"
|
link_to "作品(#{homework.student_works.count})",student_work_index_path(:homework => homework.id),:class => "c_blue"
|
||||||
else #学生显示提交作品、修改作品等按钮
|
else #学生显示提交作品、修改作品等按钮
|
||||||
work = cur_user_works_for_homework homework
|
work = cur_user_works_for_homework homework
|
||||||
|
project = cur_user_projects_for_homework homework
|
||||||
if work.nil? && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
|
if work.nil? && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
|
||||||
|
if homework.homework_type ==3 && project.nil? && homework.homework_detail_group.base_on_project == 1
|
||||||
|
link_to "提交作品(#{homework.student_works.count})","javascript:void(0)", :class => 'c_grey',:style=>"cursor:not-allowed",:title => '请先关联项目再提交作品'
|
||||||
|
else
|
||||||
link_to "提交作品(#{homework.student_works.count})", new_student_work_path(:homework => homework.id),:class => 'c_blue'
|
link_to "提交作品(#{homework.student_works.count})", new_student_work_path(:homework => homework.id),:class => 'c_blue'
|
||||||
|
end
|
||||||
elsif work.nil? && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d")
|
elsif work.nil? && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d")
|
||||||
|
if homework.homework_type ==3 && project.nil? && homework.homework_detail_group.base_on_project == 1
|
||||||
|
link_to "补交作品(#{homework.student_works.count})","javascript:void(0)", :class => 'c_grey',:style=>"cursor:not-allowed",:title => '请先关联项目再补交作品'
|
||||||
|
else
|
||||||
link_to "补交作品(#{homework.student_works.count})", new_student_work_path(:homework => homework.id),:class => 'c_red'
|
link_to "补交作品(#{homework.student_works.count})", new_student_work_path(:homework => homework.id),:class => 'c_red'
|
||||||
|
end
|
||||||
else
|
else
|
||||||
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 #匿评作业,且作业状态不是在开启匿评之前
|
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 #匿评作业,且作业状态不是在开启匿评之前
|
||||||
link_to "作品匿评", student_work_index_path(:homework => homework.id), :class => 'c_blue', :title => "开启匿评后不可修改作品"
|
link_to "作品匿评", student_work_index_path(:homework => homework.id), :class => 'c_blue', :title => "开启匿评后不可修改作品"
|
||||||
|
@ -2446,7 +2457,7 @@ module ApplicationHelper
|
||||||
link_to "查看作品(#{homework.student_works.count})", student_work_index_path(:homework => homework.id), :class => 'c_blue', :title => "匿评已结束"
|
link_to "查看作品(#{homework.student_works.count})", student_work_index_path(:homework => homework.id), :class => 'c_blue', :title => "匿评已结束"
|
||||||
elsif homework.homework_type == 2 && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")#编程作业不能修改作品
|
elsif homework.homework_type == 2 && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")#编程作业不能修改作品
|
||||||
link_to "修改作品(#{homework.student_works.count})", new_student_work_path(:homework => homework.id),:class => 'c_blue'
|
link_to "修改作品(#{homework.student_works.count})", new_student_work_path(:homework => homework.id),:class => 'c_blue'
|
||||||
elsif Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
|
elsif Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") && work.user_id == User.current.id
|
||||||
link_to "修改作品(#{homework.student_works.count})", edit_student_work_path(work.id),:class => 'c_blue'
|
link_to "修改作品(#{homework.student_works.count})", edit_student_work_path(work.id),:class => 'c_blue'
|
||||||
else
|
else
|
||||||
link_to "查看作品(#{homework.student_works.count})", student_work_index_path(:homework => homework.id), :class => 'c_blue', :title => "作业截止后不可修改作品"
|
link_to "查看作品(#{homework.student_works.count})", student_work_index_path(:homework => homework.id), :class => 'c_blue', :title => "作业截止后不可修改作品"
|
||||||
|
@ -2459,6 +2470,24 @@ module ApplicationHelper
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def relate_project homework,is_teacher,is_in_course,user_activity_id,course_activity
|
||||||
|
if User.current.member_of_course?(homework.course)
|
||||||
|
if is_teacher
|
||||||
|
#link_to "已关联(#{homework.student_work_projects.count})",student_work_index_path(:homework => homework.id),:class => "c_blue"
|
||||||
|
else
|
||||||
|
projects = cur_user_projects_for_homework homework
|
||||||
|
works = cur_user_works_for_homework homework
|
||||||
|
if works.nil? && projects.nil?
|
||||||
|
link_to "关联项目",new_student_work_project_student_work_index_path(:homework => homework.id,:is_in_course=>is_in_course,:user_activity_id=>user_activity_id,:course_activity=>course_activity),remote: true,:class=> 'c_blue', :title=> '请选择分组作业关联的项目'
|
||||||
|
elsif works.nil?
|
||||||
|
link_to "取消关联",cancel_relate_project_student_work_index_path(:homework => homework.id,:is_in_course=>is_in_course,:user_activity_id=>user_activity_id,:course_activity=>course_activity), :confirm => "您确定要取消关联吗?", remote: true,:class => "c_blue", :title=> '取消关联项目'
|
||||||
|
else
|
||||||
|
#link_to "已关联(#{homework.student_work_projects.count})",student_work_index_path(:homework => homework.id),:class => "c_blue"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def student_anonymous_comment homework
|
def student_anonymous_comment homework
|
||||||
if homework.homework_detail_manual
|
if homework.homework_detail_manual
|
||||||
case homework.homework_detail_manual.comment_status
|
case homework.homework_detail_manual.comment_status
|
||||||
|
@ -2474,7 +2503,20 @@ module ApplicationHelper
|
||||||
|
|
||||||
#获取当前用户在指定作业下提交的作业的集合
|
#获取当前用户在指定作业下提交的作业的集合
|
||||||
def cur_user_works_for_homework homework
|
def cur_user_works_for_homework homework
|
||||||
homework.student_works.where("user_id = ?",User.current).first
|
work = homework.student_works.where("user_id = ?",User.current).first
|
||||||
|
if homework.homework_type == 3
|
||||||
|
pro = homework.student_work_projects.where("user_id = #{User.current.id}").first
|
||||||
|
if pro.nil? || pro.student_work_id == "" || pro.student_work_id.nil?
|
||||||
|
work = nil
|
||||||
|
else
|
||||||
|
work = StudentWork.find pro.student_work_id
|
||||||
|
end
|
||||||
|
end
|
||||||
|
work
|
||||||
|
end
|
||||||
|
#获取当前用户在指定作业下关联的项目的集合
|
||||||
|
def cur_user_projects_for_homework homework
|
||||||
|
homework.student_work_projects.where("user_id = ?",User.current).first
|
||||||
end
|
end
|
||||||
|
|
||||||
def file_preview_tag(file, html_options={})
|
def file_preview_tag(file, html_options={})
|
||||||
|
@ -2619,4 +2661,38 @@ int main(int argc, char** argv){
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def import_ke(default_opt={})
|
||||||
|
opt = {enable_at: true, prettify: false, init_activity: false}.merge default_opt
|
||||||
|
ss = ''
|
||||||
|
if opt[:enable_at]
|
||||||
|
ss = '<script type="text/javascript">'
|
||||||
|
ss += 'window.atPersonLists = [];'
|
||||||
|
|
||||||
|
@at_persons && @at_persons.each_with_index do |person,index|
|
||||||
|
ss += "var o = {id: #{index}, name: '#{person.show_name}', login: '#{person.login}', searchKey: '#{person.get_at_show_name}'};"
|
||||||
|
ss += "atPersonLists.push(o);"
|
||||||
|
end
|
||||||
|
|
||||||
|
ss += "</script>"
|
||||||
|
end
|
||||||
|
|
||||||
|
ss += javascript_include_tag("/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg')
|
||||||
|
if opt[:enable_at]
|
||||||
|
ss += javascript_include_tag('/assets/kindeditor/at/jquery.caret.min.js', '/assets/kindeditor/at/jquery.atwho.js', '/assets/kindeditor/at/config.js')
|
||||||
|
ss += stylesheet_link_tag("/assets/kindeditor/at/jquery.atwho.css")
|
||||||
|
end
|
||||||
|
|
||||||
|
if opt[:prettify]
|
||||||
|
ss += javascript_include_tag 'prettify'
|
||||||
|
ss += stylesheet_link_tag 'prettify'
|
||||||
|
end
|
||||||
|
|
||||||
|
if opt[:init_activity]
|
||||||
|
ss += javascript_include_tag "init_activity_KindEditor"
|
||||||
|
end
|
||||||
|
|
||||||
|
ss.html_safe
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -113,7 +113,8 @@ module FilesHelper
|
||||||
if attachment.is_public? ||
|
if attachment.is_public? ||
|
||||||
(attachment.container_type == "Project" && User.current.member_of?(attachment.project)) ||
|
(attachment.container_type == "Project" && User.current.member_of?(attachment.project)) ||
|
||||||
(attachment.container_type == "Course" && User.current.member_of_course?(Course.find(attachment.container_id)))||
|
(attachment.container_type == "Course" && User.current.member_of_course?(Course.find(attachment.container_id)))||
|
||||||
attachment.author_id == User.current.id
|
attachment.author_id == User.current.id ||
|
||||||
|
attachment.container_type == "OrgSubfield"
|
||||||
result << attachment
|
result << attachment
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -22,6 +22,7 @@ class Attachment < ActiveRecord::Base
|
||||||
belongs_to :container, :polymorphic => true
|
belongs_to :container, :polymorphic => true
|
||||||
belongs_to :project, foreign_key: 'container_id', conditions: "attachments.container_type = 'Project'"
|
belongs_to :project, foreign_key: 'container_id', conditions: "attachments.container_type = 'Project'"
|
||||||
belongs_to :course, foreign_key: 'container_id', conditions: "attachments.container_type = 'Course'"
|
belongs_to :course, foreign_key: 'container_id', conditions: "attachments.container_type = 'Course'"
|
||||||
|
belongs_to :org_subfield, foreign_key: 'container_id', conditions: "attachements.container_type = 'OrgSubfield'"
|
||||||
belongs_to :softapplication, foreign_key: 'container_id', conditions: "attachments.container_type = 'Softapplication'"
|
belongs_to :softapplication, foreign_key: 'container_id', conditions: "attachments.container_type = 'Softapplication'"
|
||||||
belongs_to :author, :class_name => "User", :foreign_key => "author_id"
|
belongs_to :author, :class_name => "User", :foreign_key => "author_id"
|
||||||
belongs_to :attachmentstype, :foreign_key => "attachtype",:primary_key => "id"
|
belongs_to :attachmentstype, :foreign_key => "attachtype",:primary_key => "id"
|
||||||
|
@ -46,7 +47,7 @@ class Attachment < ActiveRecord::Base
|
||||||
settings index: { number_of_shards: 5 } do
|
settings index: { number_of_shards: 5 } do
|
||||||
mappings dynamic: 'false' do
|
mappings dynamic: 'false' do
|
||||||
indexes :filename, analyzer: 'smartcn',index_options: 'offsets'
|
indexes :filename, analyzer: 'smartcn',index_options: 'offsets'
|
||||||
indexes :downloads, analyzer: 'smartcn',index_options: 'offsets'
|
indexes :downloads, index:"not_analyzed",index_options: 'offsets'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ class Course < ActiveRecord::Base
|
||||||
mappings dynamic: 'false' do
|
mappings dynamic: 'false' do
|
||||||
indexes :name, analyzer: 'smartcn',index_options: 'offsets'
|
indexes :name, analyzer: 'smartcn',index_options: 'offsets'
|
||||||
indexes :description, analyzer: 'smartcn',index_options: 'offsets'
|
indexes :description, analyzer: 'smartcn',index_options: 'offsets'
|
||||||
indexes :updated_at, analyzer: 'smartcn',index_options: 'offsets',type:"date"
|
indexes :updated_at, index:"not_analyzed",type:"date"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class CourseMessage < ActiveRecord::Base
|
class CourseMessage < ActiveRecord::Base
|
||||||
# status说明: status在课程不同的类型,区分不同的功能
|
# status说明: status在课程不同的类型,区分不同的功能 status = 9 作品的提交记录
|
||||||
# HomeworkCommon:status:
|
# HomeworkCommon:status:
|
||||||
# nil:发布了作业; 1:作业截止时间到了提醒!;2:开启匿评; 3:关闭匿评; 4:匿评开始失败
|
# nil:发布了作业; 1:作业截止时间到了提醒!;2:开启匿评; 3:关闭匿评; 4:匿评开始失败
|
||||||
attr_accessible :course_id, :course_message_id, :course_message_type, :user_id, :viewed, :content, :status
|
attr_accessible :course_id, :course_message_id, :course_message_type, :user_id, :viewed, :content, :status
|
||||||
|
@ -19,7 +19,7 @@ class CourseMessage < ActiveRecord::Base
|
||||||
|
|
||||||
def add_user_message
|
def add_user_message
|
||||||
#unless self.course_message_type == 'JoinCourseRequest'
|
#unless self.course_message_type == 'JoinCourseRequest'
|
||||||
if MessageAll.where("message_type = '#{self.class.to_s}' and message_id = '#{self.id}'").first.nil?
|
if MessageAll.where("message_type = '#{self.class.to_s}' and message_id = '#{self.id}'").first.nil? && self.status != 9
|
||||||
self.message_alls << MessageAll.new(:user_id => self.user_id)
|
self.message_alls << MessageAll.new(:user_id => self.user_id)
|
||||||
end
|
end
|
||||||
#end
|
#end
|
||||||
|
|
|
@ -9,6 +9,8 @@ class HomeworkCommon < ActiveRecord::Base
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
has_one :homework_detail_manual, :dependent => :destroy
|
has_one :homework_detail_manual, :dependent => :destroy
|
||||||
has_one :homework_detail_programing, :dependent => :destroy
|
has_one :homework_detail_programing, :dependent => :destroy
|
||||||
|
has_one :homework_detail_group, :dependent => :destroy
|
||||||
|
has_many :student_work_projects, :dependent => :destroy
|
||||||
has_many :homework_tests, :dependent => :destroy
|
has_many :homework_tests, :dependent => :destroy
|
||||||
has_many :student_works, :dependent => :destroy, :conditions => "is_test=0"
|
has_many :student_works, :dependent => :destroy, :conditions => "is_test=0"
|
||||||
has_many :student_works_evaluation_distributions, :through => :student_works #一个作业的分配的匿评列表
|
has_many :student_works_evaluation_distributions, :through => :student_works #一个作业的分配的匿评列表
|
||||||
|
@ -74,6 +76,10 @@ class HomeworkCommon < ActiveRecord::Base
|
||||||
self.homework_type == 2 && self.homework_detail_programing
|
self.homework_type == 2 && self.homework_detail_programing
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def is_group_homework?
|
||||||
|
self.homework_type == 3 && self.homework_detail_group
|
||||||
|
end
|
||||||
|
|
||||||
###添加回复
|
###添加回复
|
||||||
def self.add_homework_jour(user, notes, id , options = {})
|
def self.add_homework_jour(user, notes, id , options = {})
|
||||||
homework = HomeworkCommon.find(id)
|
homework = HomeworkCommon.find(id)
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
class HomeworkDetailGroup < ActiveRecord::Base
|
||||||
|
belongs_to :homework_common
|
||||||
|
attr_accessible :base_on_project, :homework_common_id, :max_num, :min_num
|
||||||
|
end
|
|
@ -267,7 +267,7 @@ class JournalsForMessage < ActiveRecord::Base
|
||||||
|
|
||||||
# 课程成员得分(英雄榜)
|
# 课程成员得分(英雄榜)
|
||||||
def act_as_student_score
|
def act_as_student_score
|
||||||
unless self.user.allowed_to?(:as_teacher, self.jour)
|
if !self.user.allowed_to?(:as_teacher, self.jour) && self.jour_type == "Course"
|
||||||
course_member_score(self.jour_id, self.user_id, "JournalForMessage")
|
course_member_score(self.jour_id, self.user_id, "JournalForMessage")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
|
require 'elasticsearch/model'
|
||||||
class Memo < ActiveRecord::Base
|
class Memo < ActiveRecord::Base
|
||||||
include Redmine::SafeAttributes
|
include Redmine::SafeAttributes
|
||||||
include UserScoreHelper
|
include UserScoreHelper
|
||||||
include ApplicationHelper
|
include ApplicationHelper
|
||||||
|
include Elasticsearch::Model
|
||||||
belongs_to :forum
|
belongs_to :forum
|
||||||
has_many_kindeditor_assets :assets, :dependent => :destroy
|
has_many_kindeditor_assets :assets, :dependent => :destroy
|
||||||
belongs_to :author, :class_name => "User", :foreign_key => 'author_id'
|
belongs_to :author, :class_name => "User", :foreign_key => 'author_id'
|
||||||
|
@ -12,6 +14,36 @@ class Memo < ActiveRecord::Base
|
||||||
validates_length_of :content, maximum: 30000
|
validates_length_of :content, maximum: 30000
|
||||||
validate :cannot_reply_to_locked_topic, :on => :create
|
validate :cannot_reply_to_locked_topic, :on => :create
|
||||||
|
|
||||||
|
|
||||||
|
#elasticsearch kaminari init
|
||||||
|
Kaminari::Hooks.init
|
||||||
|
Elasticsearch::Model::Response::Response.__send__ :include, Elasticsearch::Model::Response::Pagination::Kaminari
|
||||||
|
settings index: {
|
||||||
|
number_of_shards: 5 ,
|
||||||
|
analysis: {
|
||||||
|
char_filter: {
|
||||||
|
and_filter: {
|
||||||
|
type: "mapping",
|
||||||
|
mappings: [ "&=> and "]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
analyzer: {
|
||||||
|
my_analyzer: {
|
||||||
|
type: 'custom',
|
||||||
|
tokenizer: 'standard',
|
||||||
|
filter: ['classic'],
|
||||||
|
char_filter: ['html_strip']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} do
|
||||||
|
mappings dynamic: 'false' do
|
||||||
|
indexes :subject, analyzer: 'smartcn',index_options: 'offsets'#, char_filter: 'html_strip'
|
||||||
|
indexes :content, analyzer:'my_analyzer',index_options: 'offsets',search_analyzer: 'smartcn'
|
||||||
|
indexes :updated_at,index:"not_analyzed" ,type:'date'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
acts_as_tree :counter_cache => :replies_count, :order => "#{Memo.table_name}.created_at ASC"
|
acts_as_tree :counter_cache => :replies_count, :order => "#{Memo.table_name}.created_at ASC"
|
||||||
acts_as_attachable
|
acts_as_attachable
|
||||||
has_many :user_score_details, :class_name => 'UserScoreDetails',:as => :score_changeable_obj
|
has_many :user_score_details, :class_name => 'UserScoreDetails',:as => :score_changeable_obj
|
||||||
|
@ -47,9 +79,9 @@ class Memo < ActiveRecord::Base
|
||||||
"parent_id",
|
"parent_id",
|
||||||
"replies_count"
|
"replies_count"
|
||||||
|
|
||||||
after_create :add_author_as_watcher, :reset_counters!, :send_mail, :send_message
|
after_create :add_author_as_watcher, :reset_counters!, :send_mail, :send_message,:create_memo_ealasticsearch_index
|
||||||
# after_update :update_memos_forum
|
after_update :update_memo_ealasticsearch_index
|
||||||
after_destroy :reset_counters!,:delete_kindeditor_assets#,:down_user_score -- 公共区发帖暂不计入得分
|
after_destroy :reset_counters!,:delete_kindeditor_assets,:delete_memo_ealasticsearch_index#,:down_user_score -- 公共区发帖暂不计入得分,
|
||||||
# after_create :send_notification
|
# after_create :send_notification
|
||||||
# after_save :plusParentAndForum
|
# after_save :plusParentAndForum
|
||||||
# after_destroy :minusParentAndForum
|
# after_destroy :minusParentAndForum
|
||||||
|
@ -57,6 +89,36 @@ class Memo < ActiveRecord::Base
|
||||||
# scope :visible, lambda { |*args|
|
# scope :visible, lambda { |*args|
|
||||||
# includes(:forum => ).where()
|
# includes(:forum => ).where()
|
||||||
# }
|
# }
|
||||||
|
scope :indexable,lambda {
|
||||||
|
where('parent_id is null')
|
||||||
|
}
|
||||||
|
|
||||||
|
def self.search(query)
|
||||||
|
__elasticsearch__.search(
|
||||||
|
{
|
||||||
|
query: {
|
||||||
|
multi_match: {
|
||||||
|
query: query,
|
||||||
|
type:"most_fields",
|
||||||
|
operator: "or",
|
||||||
|
fields: ['subject','content^0.5']
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sort: {
|
||||||
|
_score:{order: "desc" },
|
||||||
|
updated_at:{order: "desc" }
|
||||||
|
},
|
||||||
|
highlight: {
|
||||||
|
pre_tags: ['<span class="c_red">'],
|
||||||
|
post_tags: ['</span>'],
|
||||||
|
fields: {
|
||||||
|
subject: {},
|
||||||
|
content: {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
def send_mail
|
def send_mail
|
||||||
Mailer.run.forum_message_added(self) if Setting.notified_events.include?('forum_message_added')
|
Mailer.run.forum_message_added(self) if Setting.notified_events.include?('forum_message_added')
|
||||||
|
@ -205,4 +267,20 @@ class Memo < ActiveRecord::Base
|
||||||
def delete_kindeditor_assets
|
def delete_kindeditor_assets
|
||||||
delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::MEMO
|
delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::MEMO
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def create_memo_ealasticsearch_index
|
||||||
|
if self.parent_id.nil?
|
||||||
|
self.__elasticsearch__.index_document
|
||||||
|
end
|
||||||
|
end
|
||||||
|
def update_memo_ealasticsearch_index
|
||||||
|
if self.parent_id.nil?
|
||||||
|
self.__elasticsearch__.update_document
|
||||||
|
end
|
||||||
|
end
|
||||||
|
def delete_memo_ealasticsearch_index
|
||||||
|
if self.parent_id.nil?
|
||||||
|
self.__elasticsearch__.delete_document
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
class OrgSubfield < ActiveRecord::Base
|
class OrgSubfield < ActiveRecord::Base
|
||||||
belongs_to :organization, :foreign_key => :organization_id
|
belongs_to :organization, :foreign_key => :organization_id
|
||||||
has_many :org_document_comments, :dependent => :destroy
|
has_many :org_document_comments, :dependent => :destroy
|
||||||
|
has_many :files
|
||||||
|
acts_as_attachable
|
||||||
|
|
||||||
|
def project
|
||||||
|
end
|
||||||
end
|
end
|
|
@ -39,10 +39,11 @@ class Project < ActiveRecord::Base
|
||||||
mappings dynamic: 'false' do
|
mappings dynamic: 'false' do
|
||||||
indexes :name, analyzer: 'smartcn',index_options: 'offsets'
|
indexes :name, analyzer: 'smartcn',index_options: 'offsets'
|
||||||
indexes :description, analyzer: 'smartcn',index_options: 'offsets'
|
indexes :description, analyzer: 'smartcn',index_options: 'offsets'
|
||||||
indexes :updated_on, analyzer: 'smartcn',index_options: 'offsets', type:'date'
|
indexes :updated_on, index:"not_analyzed", type:'date'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
has_many :student_work_projects,:dependent => :destroy
|
||||||
has_many :student_works
|
has_many :student_works
|
||||||
has_many :time_entry_activities
|
has_many :time_entry_activities
|
||||||
has_many :members, :include => [:principal, :roles], :conditions => "#{Principal.table_name}.type='User' AND #{Principal.table_name}.status=#{Principal::STATUS_ACTIVE}"
|
has_many :members, :include => [:principal, :roles], :conditions => "#{Principal.table_name}.type='User' AND #{Principal.table_name}.status=#{Principal::STATUS_ACTIVE}"
|
||||||
|
@ -86,6 +87,7 @@ class Project < ActiveRecord::Base
|
||||||
|
|
||||||
# end
|
# end
|
||||||
#ADDED BY NIE
|
#ADDED BY NIE
|
||||||
|
has_one :project_score, :dependent => :destroy
|
||||||
has_many :project_infos, :dependent => :destroy
|
has_many :project_infos, :dependent => :destroy
|
||||||
has_one :project_status, :class_name => "ProjectStatus", :dependent => :destroy
|
has_one :project_status, :class_name => "ProjectStatus", :dependent => :destroy
|
||||||
has_many :user_grades, :class_name => "UserGrade", :dependent => :destroy
|
has_many :user_grades, :class_name => "UserGrade", :dependent => :destroy
|
||||||
|
|
|
@ -4,6 +4,7 @@ class StudentWork < ActiveRecord::Base
|
||||||
|
|
||||||
belongs_to :homework_common
|
belongs_to :homework_common
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
|
has_many :student_work_projects
|
||||||
has_many :student_works_evaluation_distributions, :dependent => :destroy
|
has_many :student_works_evaluation_distributions, :dependent => :destroy
|
||||||
has_many :student_works_scores, :dependent => :destroy
|
has_many :student_works_scores, :dependent => :destroy
|
||||||
belongs_to :project
|
belongs_to :project
|
||||||
|
@ -45,7 +46,7 @@ class StudentWork < ActiveRecord::Base
|
||||||
#成绩计算
|
#成绩计算
|
||||||
def set_final_score homework,student_work
|
def set_final_score homework,student_work
|
||||||
if homework && homework.homework_detail_manual
|
if homework && homework.homework_detail_manual
|
||||||
if homework.homework_type == 1 #匿评作业
|
if homework.homework_type != 2 #匿评作业
|
||||||
if homework.teacher_priority == 1 #教师优先
|
if homework.teacher_priority == 1 #教师优先
|
||||||
if student_work.teacher_score
|
if student_work.teacher_score
|
||||||
student_work.final_score = student_work.teacher_score
|
student_work.final_score = student_work.teacher_score
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
class StudentWorkProject < ActiveRecord::Base
|
||||||
|
# attr_accessible :title, :body
|
||||||
|
belongs_to :homework_common
|
||||||
|
belongs_to :student_work
|
||||||
|
belongs_to :project
|
||||||
|
belongs_to :user
|
||||||
|
end
|
|
@ -35,7 +35,7 @@ class User < Principal
|
||||||
indexes :login, analyzer: 'smartcn',index_options: 'offsets'
|
indexes :login, analyzer: 'smartcn',index_options: 'offsets'
|
||||||
indexes :firstname, analyzer: 'smartcn',index_options: 'offsets'
|
indexes :firstname, analyzer: 'smartcn',index_options: 'offsets'
|
||||||
indexes :lastname, analyzer: 'smartcn',index_options: 'offsets'
|
indexes :lastname, analyzer: 'smartcn',index_options: 'offsets'
|
||||||
indexes :last_login_on, analyzer: 'smartcn',index_options: 'offsets',type: 'date'
|
indexes :last_login_on, index:"not_analyzed",type: 'date'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -107,6 +107,7 @@ class User < Principal
|
||||||
has_many :student_works, :dependent => :destroy
|
has_many :student_works, :dependent => :destroy
|
||||||
has_many :student_works_evaluation_distributions, :dependent => :destroy
|
has_many :student_works_evaluation_distributions, :dependent => :destroy
|
||||||
has_many :student_works_scores, :dependent => :destroy
|
has_many :student_works_scores, :dependent => :destroy
|
||||||
|
has_many :student_work_projects, :dependent => :destroy
|
||||||
#end
|
#end
|
||||||
|
|
||||||
has_and_belongs_to_many :groups, :after_add => Proc.new {|user, group| group.user_added(user)},
|
has_and_belongs_to_many :groups, :after_add => Proc.new {|user, group| group.user_added(user)},
|
||||||
|
@ -409,11 +410,15 @@ class User < Principal
|
||||||
else
|
else
|
||||||
name = lastname+firstname
|
name = lastname+firstname
|
||||||
end
|
end
|
||||||
name = name.empty? || name.nil? ? login : name
|
name.empty? || name.nil? ? login : name
|
||||||
name
|
|
||||||
end
|
end
|
||||||
## end
|
## end
|
||||||
|
|
||||||
|
def get_at_show_name
|
||||||
|
name = show_name
|
||||||
|
name = "#{name} #{self.login}" if name != self.login
|
||||||
|
end
|
||||||
|
|
||||||
#added by nie
|
#added by nie
|
||||||
def count_new_journal_reply
|
def count_new_journal_reply
|
||||||
count = self.journal_reply.count
|
count = self.journal_reply.count
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false) %>
|
||||||
|
<% end %>
|
||||||
<h3 style="float: left">
|
<h3 style="float: left">
|
||||||
<%=l(:label_system_message)%>
|
<%=l(:label_system_message)%>
|
||||||
</h3><br/>
|
</h3><br/>
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
<% if @is_destroy%>
|
<% if @is_destroy%>
|
||||||
$("#attachment_<%= @attachment.id%>").remove();
|
$("#attachment_<%= @attachment.id%>").remove();
|
||||||
if(document.getElementById("uploadReviseBox")) {
|
if(document.getElementById("revise_attachment_div_<%= @attachment.id%>")) {
|
||||||
$("#uploadReviseBox").removeClass('disable_link');
|
$("#revise_attachment_div_<%= @attachment.id%>").remove();
|
||||||
$("#choose_revise_attach").attr("onclick","_file.click();");
|
|
||||||
}
|
}
|
||||||
<%else%>
|
<%else%>
|
||||||
var attachment_html_obj = $('#attachments_<%= j params[:attachment_id] %>');
|
var attachment_html_obj = $('#attachments_<%= j params[:attachment_id] %>');
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'prettify','/assets/kindeditor/pasteimg' %>
|
<%= content_for(:header_tags) do %>
|
||||||
<%= stylesheet_link_tag 'prettify'%>
|
<%= import_ke(enable_at: false, prettify: true) %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<%= labelled_form_for @bid,:html => { :multipart => true } do |f| %>
|
<%= labelled_form_for @bid,:html => { :multipart => true } do |f| %>
|
||||||
<%= render :partial => 'new_homework_form', :locals => { :bid => @bid, :bid_id => "edit_bid_#{@bid.id}",:f=>f,:edit_mode => true} %>
|
<%= render :partial => 'new_homework_form', :locals => { :bid => @bid, :bid_id => "edit_bid_#{@bid.id}",:f=>f,:edit_mode => true} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' ,'blog' %>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false) %>
|
||||||
|
<%= javascript_include_tag 'blog' %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<div class="resources mt10">
|
<div class="resources mt10">
|
||||||
<div id="new_course_topic">
|
<div id="new_course_topic">
|
||||||
<div class="homepagePostBrief c_grey">
|
<div class="homepagePostBrief c_grey">
|
||||||
<div>
|
<div>
|
||||||
<input type="text" value="<%= article.title%>" name="blog_comment[title]" id="message_subject" class="InputBox w713" maxlength="255" onkeyup="regexTopicSubject();" placeholder="发布文章,请先输入文章标题" " />
|
<input type="text" value="<%= article.title%>" name="blog_comment[title]" id="message_subject" class="InputBox w713" maxlength="255" onkeyup="regexTopicSubject();" placeholder="发布文章,请先输入文章标题" />
|
||||||
<p id="subjectmsg"></p>
|
<p id="subjectmsg"></p>
|
||||||
</div>
|
</div>
|
||||||
<div id="topic_editor" style="display: block;">
|
<div id="topic_editor" style="display: block;">
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' ,'blog' %>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false) %>
|
||||||
|
<%= javascript_include_tag 'blog' %>
|
||||||
|
<% end %>
|
||||||
<div class="resources mt10">
|
<div class="resources mt10">
|
||||||
<div id="new_course_topic">
|
<div id="new_course_topic">
|
||||||
<div class="homepagePostBrief c_grey">
|
<div class="homepagePostBrief c_grey">
|
||||||
<div>
|
<div>
|
||||||
<input type="text" name="blog_comment[title]" id="message_subject" class="InputBox w713" maxlength="255" onfocus="$('#topic_editor').show()" onkeyup="regexTopicSubject();" placeholder="发布文章,请先输入文章标题" " >
|
<input type="text" name="blog_comment[title]" id="message_subject" class="InputBox w713" maxlength="255" onfocus="$('#topic_editor').show()" onkeyup="regexTopicSubject();" placeholder="发布文章,请先输入文章标题" >
|
||||||
<p id="subjectmsg"></p>
|
<p id="subjectmsg"></p>
|
||||||
</div>
|
</div>
|
||||||
<div id="topic_editor" style="display: none;">
|
<div id="topic_editor" style="display: none;">
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false) %>
|
||||||
|
<% end %>
|
||||||
<li>
|
<li>
|
||||||
<div style="display: none ;" class="fl"><label><span class="c_red">*</span> <%= l(:field_subject) %> :</label></div>
|
<div style="display: none ;" class="fl"><label><span class="c_red">*</span> <%= l(:field_subject) %> :</label></div>
|
||||||
<div style="display: none;"><%= f.text_field :title, { size: 60, id: "message_subject",:class=>"talk_input w585 fl" }.merge({ hidden: "hidden"}) %></div>
|
<div style="display: none;"><%= f.text_field :title, { size: 60, id: "message_subject",:class=>"talk_input w585 fl" }.merge({ hidden: "hidden"}) %></div>
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor",'blog' %>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false) %>
|
||||||
|
<%= javascript_include_tag "init_activity_KindEditor",'blog' %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor", '/assets/kindeditor/pasteimg', "init_activity_KindEditor" %>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false) %>
|
||||||
|
<%= javascript_include_tag "init_activity_KindEditor" %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
/*回复框*/
|
/*回复框*/
|
||||||
.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}
|
.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}
|
||||||
|
|
|
@ -27,8 +27,7 @@
|
||||||
else if (window.attachEvent)
|
else if (window.attachEvent)
|
||||||
window.attachEvent("onload", buildsubmenus)
|
window.attachEvent("onload", buildsubmenus)
|
||||||
</script>
|
</script>
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
<%= import_ke(enable_at: false, prettify: false) %>
|
||||||
<%#= javascript_include_tag "/assets/kindeditor/kindeditor-min" %>
|
|
||||||
|
|
||||||
|
|
||||||
<%= render :partial => 'blogs/article_list', :locals => {:blog=>@user.blog,:topics => @user.blog.articles.reorder("#{BlogComment.table_name}.sticky desc,#{BlogComment.table_name}.created_on desc"), :page => 0, :user => @user} %>
|
<%= render :partial => 'blogs/article_list', :locals => {:blog=>@user.blog,:topics => @user.blog.articles.reorder("#{BlogComment.table_name}.sticky desc,#{BlogComment.table_name}.created_on desc"), :page => 0, :user => @user} %>
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false) %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<%= error_messages_for 'message' %>
|
<%= error_messages_for 'message' %>
|
||||||
<div class="resources mt10">
|
<div class="resources mt10">
|
||||||
<div id="new_course_topic">
|
<div id="new_course_topic">
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor", '/assets/kindeditor/pasteimg', "init_activity_KindEditor" %>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false) %>
|
||||||
|
<%= javascript_include_tag "init_activity_KindEditor" %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
/*回复框*/
|
/*回复框*/
|
||||||
.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}
|
.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}
|
||||||
|
|
|
@ -27,8 +27,9 @@
|
||||||
else if (window.attachEvent)
|
else if (window.attachEvent)
|
||||||
window.attachEvent("onload", buildsubmenus)
|
window.attachEvent("onload", buildsubmenus)
|
||||||
</script>
|
</script>
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
<%= content_for(:header_tags) do %>
|
||||||
<%#= javascript_include_tag "/assets/kindeditor/kindeditor-min" %>
|
<%= import_ke(enable_at: false, prettify: false) %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor", '/assets/kindeditor/pasteimg', "init_activity_KindEditor" %>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
/*回复框*/
|
/*回复框*/
|
||||||
div.ke-toolbar {
|
div.ke-toolbar {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<% @members.each do |member| %>
|
<% @members.each do |member| %>
|
||||||
<li >
|
<li >
|
||||||
<%#= link_to_user_header member.principal,true,:class => "w150 c_orange fl" %>
|
<%#= link_to_user_header member.principal,true,:class => "w150 c_orange fl" %>
|
||||||
<%= link_to "#{member.principal}(#{member.principal.show_name})", user_path(member.principal), :class => "w150 c_orange fl" %>
|
<%= link_to "#{member.principal}(#{member.principal.show_name})", user_path(member.principal), :class => "w150 linkBlue fl" %>
|
||||||
<span class="w150 fl">
|
<span class="w150 fl">
|
||||||
<%= zh_course_role(h member.roles.sort.collect(&:to_s).join(', ')) %>
|
<%= zh_course_role(h member.roles.sort.collect(&:to_s).join(', ')) %>
|
||||||
<%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member),
|
<%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member),
|
||||||
|
|
|
@ -6,10 +6,10 @@
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<% if @subPage_title == l(:label_student_list)%>
|
<% if @subPage_title == l(:label_student_list)%>
|
||||||
<%= render :partial => 'course_student', :locals => {:members => @members} %>
|
<%= render :partial => 'course_student', :locals => {:members => @members} %>
|
||||||
<% else%>
|
<% else%>
|
||||||
<%= render :partial => 'course_teacher', :locals => {:members => @members} %>
|
<%= render :partial => 'course_teacher', :locals => {:members => @members} %>
|
||||||
<% end%>
|
<% end%>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
<% if @course.is_delete == 1 %>
|
<% if @course.is_delete == 1 %>
|
||||||
<div class="mt30 fr"><img src="/images/pic_del.gif" class="mr5"><%=link_to "恢复该课程", renew_course_path(@course) %></div>
|
<div class="mt30"><%=link_to "恢复该课程", renew_course_path(@course) %></div>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div class="mt30">
|
<div class="mt30">
|
||||||
<img src="/images/pic_del.gif" class="mr5"><%=link_to "删除该课程", course_path(@course), :method => :delete, :confirm=>"确认要删除该课程吗?" %>
|
<img src="/images/pic_del.gif" class="mr5"><%=link_to "删除该课程", course_path(@course), :method => :delete, :confirm=>"确认要删除该课程吗?" %>
|
||||||
|
|
|
@ -1,9 +1,14 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor",'blog' %>
|
|
||||||
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
|
||||||
|
<%= javascript_include_tag 'blog' %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
/*回复框*/
|
/*回复框*/
|
||||||
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
|
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
|
||||||
span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
|
span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
|
||||||
span.ke-toolbar-icon-url{background-image:url( /images/public_icon.png )}
|
span.ke-toolbar-icon-url{background-image:url("/images/public_icon.png")}
|
||||||
div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
|
div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
|
||||||
span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
|
span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
|
||||||
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
|
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
|
||||||
|
@ -191,7 +196,7 @@
|
||||||
<div class="homepagePostReplyInputContainer" style="margin-top: 8px">
|
<div class="homepagePostReplyInputContainer" style="margin-top: 8px">
|
||||||
<div nhname='new_message_<%= @article.id%>' style="display:none;">
|
<div nhname='new_message_<%= @article.id%>' style="display:none;">
|
||||||
<%= form_for 'blog_comment',:url => {:action => 'reply',:controller => 'blog_comments',:user_id=>@article.author.id,:blog_id=>@article.blog_id, :id => @article.id},:method => "post",:html => {:multipart => true, :id => 'message_form'} do |f|%>
|
<%= form_for 'blog_comment',:url => {:action => 'reply',:controller => 'blog_comments',:user_id=>@article.author.id,:blog_id=>@article.blog_id, :id => @article.id},:method => "post",:html => {:multipart => true, :id => 'message_form'} do |f|%>
|
||||||
<input type="hidden" name="course_id" value="<%= @course.id%>"
|
<input type="hidden" name="course_id" value="<%= @course.id%>">
|
||||||
<input type="hidden" name="blog_comment[title]" value="RE:<%= @article.title%>">
|
<input type="hidden" name="blog_comment[title]" value="RE:<%= @article.title%>">
|
||||||
<input type="hidden" name="blog_comment[sticky]" value="0">
|
<input type="hidden" name="blog_comment[sticky]" value="0">
|
||||||
<input type="hidden" name="quote[quote]" value="">
|
<input type="hidden" name="quote[quote]" value="">
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
<div id="popbox" style="text-align: center;margin-top: 25px">
|
<div id="popbox" style="text-align: center;margin-top: 25px">
|
||||||
<% if status == 0 && exercise.time != -1%>
|
<% if @save == 1 %>
|
||||||
|
<h3 style="font-weight: normal;color: green">保存成功,测验日期截止前您还可以继续答题。</h3>
|
||||||
|
<%= link_to "确定", exercise_index_path(:course_id => @course.id),:class => 'commit'%>
|
||||||
|
<% elsif status == 0 && exercise.time != -1%>
|
||||||
<h3 style="font-weight: normal;color: green">提交成功!您的分数是:<%=@score %>分。</h3>
|
<h3 style="font-weight: normal;color: green">提交成功!您的分数是:<%=@score %>分。</h3>
|
||||||
<%= link_to "确定", exercise_path(),:class => 'commit'%>
|
<%= link_to "确定", exercise_path(),:class => 'commit'%>
|
||||||
<% elsif status == 0 && Time.parse(format_time(exercise.end_time)).strftime("%Y-%m-%d %H:%M:%S") > Time.now.strftime("%Y-%m-%d %H:%M:%S") %>
|
<% elsif status == 0 && Time.parse(format_time(exercise.end_time)).strftime("%Y-%m-%d %H:%M:%S") > Time.now.strftime("%Y-%m-%d %H:%M:%S") %>
|
||||||
<h3 style="font-weight: normal;color: green">提交成功!</h3>
|
<h3 style="font-weight: normal;color: green">提交成功,测验日期截止前您还可以修改,祝您考高分。</h3>
|
||||||
<%= link_to "确定", exercise_index_path(:course_id => @course.id),:class => 'commit'%>
|
<%= link_to "确定", exercise_index_path(:course_id => @course.id),:class => 'commit'%>
|
||||||
<% elsif status == 1 && Time.parse(format_time(exercise.end_time)).strftime("%Y-%m-%d %H:%M:%S") > Time.now.strftime("%Y-%m-%d %H:%M:%S")%>
|
<% elsif status == 1 && Time.parse(format_time(exercise.end_time)).strftime("%Y-%m-%d %H:%M:%S") > Time.now.strftime("%Y-%m-%d %H:%M:%S")%>
|
||||||
<h3 style="font-weight: normal;color: red">保存成功!</h3>
|
<h3 style="font-weight: normal;color: red">提交成功,您还有未完成的题目,测验日期截止前您还可以继续答题,祝您考高分。</h3>
|
||||||
<%= link_to "确定",exercise_index_path(:course_id => @course.id),:class => 'commit'%>
|
<%= link_to "确定",exercise_index_path(:course_id => @course.id),:class => 'commit'%>
|
||||||
<% elsif status == 1 && Time.parse(format_time(exercise.end_time)).strftime("%Y-%m-%d %H:%M:%S") <= Time.now.strftime("%Y-%m-%d %H:%M:%S")%>
|
<% elsif status == 1 && Time.parse(format_time(exercise.end_time)).strftime("%Y-%m-%d %H:%M:%S") <= Time.now.strftime("%Y-%m-%d %H:%M:%S")%>
|
||||||
<h3 style="font-weight: normal;color: red">时间已到!</h3>
|
<h3 style="font-weight: normal;color: red">时间已到!</h3>
|
||||||
|
|
|
@ -24,11 +24,11 @@
|
||||||
<!--<li><%#= link_to "导出", export_exercise_exercise_path(exercise.id,:format => "xls"), :class => "polls_de fr ml5"%></li>-->
|
<!--<li><%#= link_to "导出", export_exercise_exercise_path(exercise.id,:format => "xls"), :class => "polls_de fr ml5"%></li>-->
|
||||||
<%# end%>
|
<%# end%>
|
||||||
<% if exercise.exercise_status == 1 %>
|
<% if exercise.exercise_status == 1 %>
|
||||||
<li><a href="javascript:" class="pollsbtn btn_pu fr mr5" onclick="exercise_submit(<%= exercise.id%>,<%= exercise.exercise_name.length %>,<%=index.to_i %>);">发布试卷</a></li>
|
<li><a href="javascript:" class="pollsbtn btn_pu fr mr10 ml5" onclick="exercise_submit(<%= exercise.id%>,<%= exercise.exercise_name.length %>,<%=index.to_i %>);">发布试卷</a></li>
|
||||||
<% elsif exercise.exercise_status == 2%>
|
<% elsif exercise.exercise_status == 2%>
|
||||||
<li><a href="javascript:" class="pollsbtn btn_de fr mr5" onclick="republish_exercise(<%= exercise.id%>,<%=index.to_i %>);">取消发布</a></li>
|
<li><a href="javascript:" class="pollsbtn btn_de fr mr10 ml5" onclick="republish_exercise(<%= exercise.id%>,<%=index.to_i %>);">取消发布</a></li>
|
||||||
<% else%>
|
<% else%>
|
||||||
<li class="pollsbtn fr mr10 pollsbtn_grey" style="margin-left: 5px;" >发布试卷</li>
|
<li class="pollsbtn fr mr10 pollsbtn_grey ml5">发布试卷</li>
|
||||||
<% end%>
|
<% end%>
|
||||||
|
|
||||||
<% if exercise.exercise_status == 1%>
|
<% if exercise.exercise_status == 1%>
|
||||||
|
@ -42,18 +42,24 @@
|
||||||
<% if exercise.exercise_status == 1 %>
|
<% if exercise.exercise_status == 1 %>
|
||||||
<li><%= link_to l(:button_edit), edit_exercise_path(exercise.id), :class => "polls_de fr ml10"%></li>
|
<li><%= link_to l(:button_edit), edit_exercise_path(exercise.id), :class => "polls_de fr ml10"%></li>
|
||||||
<li class="polls_date fr"><%=exercise.publish_time.nil? ? "未发布" : "将于"+format_time(exercise.publish_time.to_s)+"发布"%></li>
|
<li class="polls_date fr"><%=exercise.publish_time.nil? ? "未发布" : "将于"+format_time(exercise.publish_time.to_s)+"发布"%></li>
|
||||||
<% else%>
|
<% elsif exercise.exercise_status == 2 %>
|
||||||
<li class="polls_de_grey fr ml10" title="未发布的试卷才能进行编辑">编辑</li>
|
<li class="polls_de_grey fr ml10" title="未发布的试卷才能进行编辑">编辑</li>
|
||||||
<li class="polls_date fr">已发布</li>
|
<li class="polls_date fr">已发布</li>
|
||||||
|
<% else %>
|
||||||
|
<li class="polls_de_grey fr ml10" title="未发布的试卷才能进行编辑">编辑</li>
|
||||||
|
<li class="polls_date fr">已截止</li>
|
||||||
<% end%>
|
<% end%>
|
||||||
|
|
||||||
<% else%>
|
<% else%>
|
||||||
<% if exercise.exercise_status == 2%>
|
<% if exercise.exercise_status != 1%>
|
||||||
<%# if has_commit%>
|
<%# if has_commit%>
|
||||||
<!--li><%#= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_st fl c_dblue" %></li>
|
<!--li><%#= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_st fl c_dblue" %></li>
|
||||||
<li class="pollsbtn_tip fl ml5">已答</li-->
|
<li class="pollsbtn_tip fl ml5">已答</li-->
|
||||||
<%#else%>
|
<%#else%>
|
||||||
<%= link_to (index.to_i+1).to_s+". "+exercise_name, exercise_path(exercise.id), :class => "polls_title polls_title_st fl c_dblue"%>
|
<%= link_to (index.to_i+1).to_s+". "+exercise_name, exercise_path(exercise.id), :class => "polls_title polls_title_st fl c_dblue"%>
|
||||||
|
<% if exercise.end_time <= Time.now && has_commit_exercise?(exercise.id, User.current.id) %>
|
||||||
|
<li class="pollsbtn_tip fl ml5">已答</li>
|
||||||
|
<% end %>
|
||||||
<%#end%>
|
<%#end%>
|
||||||
<% end%>
|
<% end%>
|
||||||
<li class="polls_date fr mr10">截止时间:<%= format_time(exercise.end_time.to_s)%></li>
|
<li class="polls_date fr mr10">截止时间:<%= format_time(exercise.end_time.to_s)%></li>
|
||||||
|
|
|
@ -3,10 +3,6 @@
|
||||||
$("#RSide").removeAttr("id");
|
$("#RSide").removeAttr("id");
|
||||||
$("#homework_page_right").css("min-height",$("#LSide").height()-30);
|
$("#homework_page_right").css("min-height",$("#LSide").height()-30);
|
||||||
$("#Container").css("width","1000px");
|
$("#Container").css("width","1000px");
|
||||||
<%uncomplete_question =get_uncomplete_question(exercise, User.current) %>;
|
|
||||||
<% if (uncomplete_question.count < 1) %>
|
|
||||||
$("#exercise_submit_btn").html("提交");
|
|
||||||
<% end %>
|
|
||||||
var end_time = <%=exercise.end_time.to_i%>;
|
var end_time = <%=exercise.end_time.to_i%>;
|
||||||
getTime(end_time);
|
getTime(end_time);
|
||||||
/*start_time = new Date();
|
/*start_time = new Date();
|
||||||
|
@ -104,11 +100,6 @@
|
||||||
{
|
{
|
||||||
obj.checked = false;
|
obj.checked = false;
|
||||||
}
|
}
|
||||||
if(dataObj.complete == 1) {
|
|
||||||
$("#exercise_submit_btn").html("提交");
|
|
||||||
} else {
|
|
||||||
$("#exercise_submit_btn").html("保存");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -163,11 +154,6 @@
|
||||||
{
|
{
|
||||||
obj.checked = false;
|
obj.checked = false;
|
||||||
}
|
}
|
||||||
if(dataObj.complete == 1) {
|
|
||||||
$("#exercise_submit_btn").html("提交");
|
|
||||||
} else {
|
|
||||||
$("#exercise_submit_btn").html("保存");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -210,11 +196,6 @@
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
var dataObj = eval(data);
|
var dataObj = eval(data);
|
||||||
obj.value = dataObj.text;
|
obj.value = dataObj.text;
|
||||||
if(dataObj.complete == 1) {
|
|
||||||
$("#exercise_submit_btn").html("提交");
|
|
||||||
} else {
|
|
||||||
$("#exercise_submit_btn").html("保存");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -228,7 +209,8 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="ur_buttons">
|
<div class="ur_buttons">
|
||||||
<%= link_to "保存",commit_exercise_exercise_path(exercise),:id=>"exercise_submit_btn", :method => :post,:class => "ur_button_submit",:style => "margin-left:80px;",:format => 'js',:remote=>true %>
|
<%= link_to "保存",commit_exercise_exercise_path(exercise,:save => 1),:id=>"exercise_submit_btn", :method => :post,:class => "ur_button_submit",:format => 'js',:remote=>true %>
|
||||||
|
<%= link_to "提交",commit_exercise_exercise_path(exercise), :data => {:confirm => "您确定要提交吗?"},:id=>"exercise_submit_btn", :method => :post,:class => "ur_button_submit",:style => "margin-left:20px;",:format => 'js',:remote=>true %>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<!--contentbox end-->
|
<!--contentbox end-->
|
||||||
|
|
|
@ -78,7 +78,7 @@
|
||||||
<% else %>
|
<% else %>
|
||||||
×
|
×
|
||||||
<% end %></span><br />
|
<% end %></span><br />
|
||||||
标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>
|
标准答案:<%= convert_to_char(standard_answer.first.exercise_choice_id.to_s) if !standard_answer.empty? %>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="ur_inputs">
|
<div class="ur_inputs">
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
<div>
|
<div>
|
||||||
<div class="testEditTitle"> 第<%= list_index+1%>题:<%= exercise_question.question_title %> (<%= exercise_question.question_score %>分)
|
<div class="testEditTitle"> 第<%= list_index+1%>题:<%= exercise_question.question_title %> (<%= exercise_question.question_score %>分)
|
||||||
<br />
|
<br />
|
||||||
标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>
|
标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) if exercise_question.exercise_standard_answers.first %>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="ur_inputs">
|
<div class="ur_inputs">
|
||||||
|
@ -64,7 +64,7 @@
|
||||||
<div>
|
<div>
|
||||||
<div class="testEditTitle"> 第<%= list_index+1%>题:<%= exercise_question.question_title %> (<%= exercise_question.question_score %>分)
|
<div class="testEditTitle"> 第<%= list_index+1%>题:<%= exercise_question.question_title %> (<%= exercise_question.question_score %>分)
|
||||||
<br />
|
<br />
|
||||||
标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>
|
标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) if exercise_question.exercise_standard_answers.first%>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="ur_inputs">
|
<div class="ur_inputs">
|
||||||
|
|
|
@ -33,6 +33,21 @@
|
||||||
}).mouseleave(function(){
|
}).mouseleave(function(){
|
||||||
$("#work_click_<%= exercise.id%>").hide();
|
$("#work_click_<%= exercise.id%>").hide();
|
||||||
});
|
});
|
||||||
|
$(function(){
|
||||||
|
<% if Time.parse(h(@exercise.end_time)).strftime("%Y-%m-%d-%H-%M-%S") <= Time.now.strftime("%Y-%m-%d-%H-%M-%S") %>
|
||||||
|
$("#show_student_result_div_<%= exercise.id%>").on('click',function() {
|
||||||
|
window.location.href = '<%=show_student_result_exercise_path(@exercise,:user_id => exercise.user_id) %>';
|
||||||
|
});
|
||||||
|
<% else %>
|
||||||
|
$("#show_student_result_div_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
|
||||||
|
$("#student_name_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
|
||||||
|
$("#student_id_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
|
||||||
|
$("#student_class_<%= exercise.id%>").attr("title","截止日期未到,暂不能查看学生答题结果");
|
||||||
|
<% end %>
|
||||||
|
});
|
||||||
|
/*function show_result(id) {
|
||||||
|
window.location.href = '<%#=show_student_result_exercise_path(@exercise,:user_id => exercise.user.id) %>';
|
||||||
|
}*/
|
||||||
</script>
|
</script>
|
||||||
<ul class="hworkListRow" id="student_work_<%= exercise.id%>">
|
<ul class="hworkListRow" id="student_work_<%= exercise.id%>">
|
||||||
<li class="hworkList340 width530">
|
<li class="hworkList340 width530">
|
||||||
|
@ -40,22 +55,16 @@
|
||||||
<li class="hworkPortrait mt15 mr10">
|
<li class="hworkPortrait mt15 mr10">
|
||||||
<%= link_to(image_tag(url_to_avatar(exercise.user),:width =>"40",:height => "40"),user_activities_path(exercise.user)) %>
|
<%= link_to(image_tag(url_to_avatar(exercise.user),:width =>"40",:height => "40"),user_activities_path(exercise.user)) %>
|
||||||
</li>
|
</li>
|
||||||
<div onclick="" style="cursor: pointer;" class="student_work_<%= exercise.id%>">
|
<div id="show_student_result_div_<%= exercise.id%>" style="cursor: pointer;" class="student_work_<%= exercise.id%>">
|
||||||
<li>
|
<li>
|
||||||
<ul class="mt10 fl">
|
<ul class="mt10 fl">
|
||||||
<li class="hworkStName mr15 mt16" title="姓名">
|
<li class="hworkStName mr15 mt16" title="姓名" id="student_name_<%= exercise.id%>">
|
||||||
<% name = exercise.user.show_name %>
|
<%=exercise.user.show_name %>
|
||||||
<% if Time.parse(h(@exercise.end_time)).strftime("%Y-%m-%d-%H-%M-%S") <= Time.now.strftime("%Y-%m-%d-%H-%M-%S") %>
|
|
||||||
<%= link_to name,show_student_result_exercise_path(@exercise,:user_id => exercise.user.id) %>
|
|
||||||
<% else %>
|
|
||||||
<span title="截止日期未到,暂不能查看学生答题结果。"><%=name%></span>
|
|
||||||
<%#= link_to name,'',:title=>"截止日期未到,暂不能查看学生答题结果。" %>
|
|
||||||
<% end %>
|
|
||||||
</li>
|
</li>
|
||||||
<li class="hworkStID mr10 mt16" title="学号">
|
<li class="hworkStID mr10 mt16" title="学号" id="student_id_<%= exercise.id%>">
|
||||||
<%= exercise.user.user_extensions.nil? ? "--" : exercise.user.user_extensions.student_id%>
|
<%= exercise.user.user_extensions.nil? ? "--" : exercise.user.user_extensions.student_id%>
|
||||||
</li>
|
</li>
|
||||||
<li class="hworkStID mt16" title="班级">
|
<li class="hworkStID mt16" title="班级" id="student_class_<%= exercise.id%>">
|
||||||
--
|
--
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -63,7 +72,7 @@
|
||||||
</div>
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li class="hworkList130 c_grey student_work_<%= exercise.id%>" onclick="" style="cursor: pointer;">
|
<li class="hworkList130 c_grey student_work_<%= exercise.id%>">
|
||||||
<% if exercise.created_at%>
|
<% if exercise.created_at%>
|
||||||
<%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>
|
<%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'commit_alert',:locals => {:status => @status,:exercise =>@exercise}) %>');
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'commit_alert',:locals => {:status => @status,:exercise =>@exercise}) %>');
|
||||||
showModal('ajax-modal', '270px');
|
showModal('ajax-modal', '270px');
|
||||||
$('#ajax-modal').css('height','110px');
|
|
||||||
$('#ajax-modal').siblings().remove();
|
$('#ajax-modal').siblings().remove();
|
||||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||||
"<a href='javascript:' onclick='hidden_atert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
"<a href='javascript:' onclick='hidden_atert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||||
|
|
|
@ -1 +1,9 @@
|
||||||
<%= render :partial => 'exercise_form'%>
|
<%= render :partial => 'exercise_form'%>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function() {
|
||||||
|
<% if @exercise.exercise_name != "" && @exercise.end_time != "" %>
|
||||||
|
$("#polls_head_show").show();
|
||||||
|
$("#polls_head_edit").hide();
|
||||||
|
<% end %>
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
|
@ -20,6 +20,25 @@
|
||||||
:lebel_file_uploding => l(:lebel_file_uploding),
|
:lebel_file_uploding => l(:lebel_file_uploding),
|
||||||
:delete_all_files => l(:text_are_you_sure_all)
|
:delete_all_files => l(:text_are_you_sure_all)
|
||||||
} %>
|
} %>
|
||||||
|
<% elsif @project %>
|
||||||
|
<%= file_field_tag 'attachments[dummy][file]',
|
||||||
|
:id => '_file',
|
||||||
|
:class => ie8? ? '':'file_selector',
|
||||||
|
:multiple => true,
|
||||||
|
:onchange => 'addInputFiles(this);',
|
||||||
|
:style => ie8? ? '': 'display:none',
|
||||||
|
:data => {
|
||||||
|
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||||
|
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
||||||
|
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
||||||
|
:upload_path => uploads_path(:format => 'js'),
|
||||||
|
:description_placeholder => l(:label_optional_description),
|
||||||
|
:field_is_public => l(:field_is_public),
|
||||||
|
:are_you_sure => l(:text_are_you_sure),
|
||||||
|
:file_count => l(:label_file_count),
|
||||||
|
:lebel_file_uploding => l(:lebel_file_uploding),
|
||||||
|
:delete_all_files => l(:text_are_you_sure_all)
|
||||||
|
} %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= file_field_tag 'attachments[dummy][file]',
|
<%= file_field_tag 'attachments[dummy][file]',
|
||||||
:id => '_file',
|
:id => '_file',
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
<% delete_allowed = User.current.admin? %>
|
||||||
|
<div class="re_con_top">
|
||||||
|
<p class="f_l c_blue f_b f_14">共有 <%= all_attachments.count%> 个资源</p>
|
||||||
|
<p class="f_r" style="color: #808080">
|
||||||
|
<% if order == "asc" %>
|
||||||
|
按 <%= link_to "时间",params.merge(:sort=>"created_on:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"created_on"} %> /
|
||||||
|
<%= link_to "下载次数",params.merge(:sort=>"downloads:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"downloads"} %> /
|
||||||
|
<%= link_to "引用次数",params.merge(:sort=>"quotes:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"quotes"} %> 排序
|
||||||
|
<% else %>
|
||||||
|
按 <%= link_to "时间",params.merge(:sort=>"created_on:asc"),:class => "f_b c_grey" ,:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"created_on"} %> /
|
||||||
|
<%= link_to "下载次数",params.merge(:sort=>"downloads:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"downloads"} %> /
|
||||||
|
<%= link_to "引用次数",params.merge(:sort=>"quotes:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"quotes"} %> 排序
|
||||||
|
<% end %>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
<!--<div class="files_tag" id="files_tag">-->
|
||||||
|
<!--<%#= render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => course,:tag_name => @tag_name}%>-->
|
||||||
|
<!--</div>-->
|
||||||
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
<div class="for_img_thumbnails">
|
||||||
|
<% org_subfield_attachments.each do |file| %>
|
||||||
|
<% if 1 %>
|
||||||
|
<div class="re_con_box" id="container_files_<%= file.id %>">
|
||||||
|
<div class="">
|
||||||
|
<%= link_to truncate(file.filename,length: 35, omission: '...'),
|
||||||
|
download_named_attachment_path(file.id, file.filename),
|
||||||
|
:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
|
||||||
|
<% if User.current.logged? %>
|
||||||
|
<%= file_preview_tag(file, class: 'f_l re_open', style:'text-align: center;') %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="mt5">
|
||||||
|
<p class="f_l mb5 c_grey02">文件大小:<%= number_to_human_size(file.filesize) %></p>
|
||||||
|
<%= link_to( l(:button_delete), attachment_path(file),
|
||||||
|
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "f_r re_de") if (delete_allowed || User.current.id == file.author_id) && file.container_id == @org_subfield.id && file.container_type == "OrgSubfield"%>
|
||||||
|
<p class="f_r c_grey02" ><%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %> | 下载<%= file.downloads %> | 引用<%= file.quotes.nil? ? 0:file.quotes %> </p>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<!--<div class="tag_h">-->
|
||||||
|
<!--<!– container_type = 1 代表是课程里的资源 –>-->
|
||||||
|
<!--<%#= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>-->
|
||||||
|
<!--<%#= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>-->
|
||||||
|
<!--</div>-->
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div><!---re_con_box end-->
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<ul class="wlist">
|
||||||
|
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
|
||||||
|
</ul>
|
||||||
|
<div class="cl"></div>
|
|
@ -0,0 +1,97 @@
|
||||||
|
<%= stylesheet_link_tag 'courses' %>
|
||||||
|
<script>
|
||||||
|
function searchone4reload(fileid){
|
||||||
|
var url = "<%= searchone4reload_org_subfield_files_path(@org_subfield)%>";
|
||||||
|
var data = {};data.fileid=fileid;
|
||||||
|
$.ajax({
|
||||||
|
url:url,dataType:'text',data:data,success:function(text){
|
||||||
|
var container_file_div = $("#container_files_"+fileid);
|
||||||
|
container_file_div.after(text);
|
||||||
|
container_file_div.remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function show_upload(obj)
|
||||||
|
{
|
||||||
|
switch(obj)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 1}) %>');
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 2}) %>');
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 3}) %>');
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 4}) %>');
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 6}) %>');
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 5}) %>');
|
||||||
|
}
|
||||||
|
showModal('ajax-modal', '513px');
|
||||||
|
$('#ajax-modal').siblings().remove();
|
||||||
|
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||||
|
$('#ajax-modal').parent().css("top","").css("left","");
|
||||||
|
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeModal()
|
||||||
|
{
|
||||||
|
hideModal($("#popbox_upload"));
|
||||||
|
}
|
||||||
|
|
||||||
|
function presscss(id)
|
||||||
|
{
|
||||||
|
if(id == "inorg_subfield")
|
||||||
|
{
|
||||||
|
$('#inorg_subfield').attr("class", "re_schbtn b_dblue");
|
||||||
|
$('#insite').attr("class", "re_schbtn b_lblue");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('#inorg_subfield').attr("class", "re_schbtn b_lblue");
|
||||||
|
$('#insite').attr("class", "re_schbtn b_dblue");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function buttoncss()
|
||||||
|
{
|
||||||
|
$('#inorg_subfield').attr("class", "re_schbtn b_lblue");
|
||||||
|
$('#insite').attr("class", "re_schbtn b_lblue");
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="resources"><!--资源库内容开始--->
|
||||||
|
<div class="re_top" style="width:710px;">
|
||||||
|
<%= form_tag( search_org_subfield_files_path(@org_subfield), method: 'get',:class => "re_search f_l",:remote=>true) do %>
|
||||||
|
<%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%>
|
||||||
|
<%= submit_tag "栏目内搜索", :class => "re_schbtn b_lblue",:name => "inorg_subfield",:id => "inorg_subfield", :onmouseover => "presscss('inorg_subfield')",:onmouseout =>"buttoncss()" %>
|
||||||
|
<%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %>
|
||||||
|
<% end %>
|
||||||
|
<%# if is_org_subfield_teacher(User.current,@org_subfield) || (@org_subfield.publish_resource==1 && User.current.member_of_org_subfield?(@org_subfield) ) %> <!-- show_window('light','fade','20%','35%')-->
|
||||||
|
<!--<a href="javascript:void(0)" class="re_fabu f_r b_lblue" onclick="show_upload();">上传资源</a>-->
|
||||||
|
<p class="c_grey fr mt10 mr5">
|
||||||
|
上传:
|
||||||
|
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(1);">课件</a> |
|
||||||
|
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(2);">软件</a> |
|
||||||
|
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(3);">媒体</a> |
|
||||||
|
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(4);">代码</a> |
|
||||||
|
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(6);">论文</a> |
|
||||||
|
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(5);">其他</a>
|
||||||
|
</p>
|
||||||
|
<%# end %>
|
||||||
|
</div><!---re_top end-->
|
||||||
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
<div class="re_con" id="org_subfield_list">
|
||||||
|
<%= render :partial => 'org_subfield_list',:locals => {org_subfield: @org_subfield,all_attachments: @all_attachments,sort:@sort,order:@order,org_subfield_attachments:@obj_attachments} %>
|
||||||
|
</div><!---re_con end-->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% html_title(l(:label_attachment_plural)) -%>
|
|
@ -0,0 +1,55 @@
|
||||||
|
<% delete_allowed = User.current.admin? %>
|
||||||
|
<div class="re_con_top">
|
||||||
|
<p class="f_l c_blue f_b f_14">共有 <%= all_attachments.count%> 个资源</p>
|
||||||
|
<p class="f_r" style="color: #808080">
|
||||||
|
<% if order == "asc" %>
|
||||||
|
按 <%= link_to "时间",params.merge(:sort=>"created_on:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"created_on"} %> /
|
||||||
|
<%= link_to "下载次数",params.merge(:sort=>"downloads:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"downloads"} %> /
|
||||||
|
<%= link_to "引用次数",params.merge(:sort=>"quotes:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"quotes"} %> 排序
|
||||||
|
<% else %>
|
||||||
|
按 <%= link_to "时间",params.merge(:sort=>"created_on:asc"),:class => "f_b c_grey" ,:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"created_on"} %> /
|
||||||
|
<%= link_to "下载次数",params.merge(:sort=>"downloads:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"downloads"} %> /
|
||||||
|
<%= link_to "引用次数",params.merge(:sort=>"quotes:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"quotes"} %> 排序
|
||||||
|
<% end %>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
<div class="files_tag" id="files_tag">
|
||||||
|
<%= render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => course,:tag_name => @tag_name}%>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
<div class="for_img_thumbnails">
|
||||||
|
<% curse_attachments.each do |file| %>
|
||||||
|
<% if file.is_public? || User.current.admin? %>
|
||||||
|
<div class="re_con_box" id="container_files_<%= file.id %>">
|
||||||
|
<div class="">
|
||||||
|
<%= link_to truncate(file.filename,length: 35, omission: '...'),
|
||||||
|
download_named_attachment_path(file.id, file.filename),
|
||||||
|
:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="mt5">
|
||||||
|
<p class="f_l mb5 c_grey02">文件大小:<%= number_to_human_size(file.filesize) %></p>
|
||||||
|
<%= link_to( l(:button_delete), attachment_path(file),
|
||||||
|
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "f_r re_de") if (delete_allowed || User.current.id == file.author_id) && file.container_id == @org_subfield.id && file.container_type == "OrgSubfield"%>
|
||||||
|
<p class="f_r c_grey02" ><%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %> | 下载<%= file.downloads %> | 引用<%= file.quotes.nil? ? 0:file.quotes %> </p>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="tag_h">
|
||||||
|
<!-- container_type = 1 代表是课程里的资源 -->
|
||||||
|
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
|
||||||
|
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div><!---re_con_box end-->
|
||||||
|
<% else %>
|
||||||
|
<div class="re_con_box"><span class='fr mr10 pr_join_span '><%= file.filename %>是私有资源</span></div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<ul class="wlist">
|
||||||
|
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
|
||||||
|
</ul>
|
||||||
|
<div class="cl"></div>
|
|
@ -0,0 +1,31 @@
|
||||||
|
|
||||||
|
<div id="popbox_upload" class="mb10" style="margin-top: -30px;color:#15bccf; font-size:16px;">
|
||||||
|
<div class="upload_con">
|
||||||
|
<h2 style="text-align: center"><%= l(:label_upload_files)%></h2>
|
||||||
|
<div class="upload_box">
|
||||||
|
<%= error_messages_for 'attachment' %>
|
||||||
|
<div id="network_issue" style="color: red; display: none;"><%= l(:label_file_upload_error_messages)%></div>
|
||||||
|
|
||||||
|
<%= form_tag(org_subfield_files_path(org_subfield), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %>
|
||||||
|
<!-- <label style="margin-top:3px;"><#%= l(:label_file_upload)%></label> -->
|
||||||
|
<!--<input type="hidden" name="in_org_subfield_toolbar" value="Y">-->
|
||||||
|
<input type="hidden" name="org_subfield_attachment_type" value="<%= org_subfield_attachment_type%>">
|
||||||
|
<%= render :partial => 'files/attachement_list',:locals => {:org_subfield => org_subfield} %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="hideModal();"><%= l(:button_cancel)%></a>
|
||||||
|
<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%= l(:button_confirm)%></a>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<% content_for :header_tags do %>
|
||||||
|
<%= javascript_include_tag 'attachments' %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function submit_resource()
|
||||||
|
{
|
||||||
|
$('#submit_resource').parent().submit();
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -52,6 +52,17 @@ $('#upload_file_div').slideToggle('slow');
|
||||||
setTimeout( function(){div.remove();},3000)
|
setTimeout( function(){div.remove();},3000)
|
||||||
<% end %>
|
<% end %>
|
||||||
<%end%>
|
<%end%>
|
||||||
|
<% elsif @org_subfield %>
|
||||||
|
hideModal();
|
||||||
|
$("#resource_list").html('<%= j(render partial: "subfield_files" ,locals: {org_subfield: @org_subfield}) %>');
|
||||||
|
// $("#courses_files_count_info").html("<%#= @all_attachments.count%>");
|
||||||
|
// $("#courses_files_count_nav").html("(<%#= @all_attachments.count%>)")
|
||||||
|
// 添加文件上传成功提示,
|
||||||
|
<% unless params[:attachments].nil? %>
|
||||||
|
var div = $('<div id="addBox" class="flash notice">文件上传成功!</div>');
|
||||||
|
$("#org_subfield_list").prepend(div);
|
||||||
|
setTimeout( function(){div.remove();},3000)
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
$(document).ready(img_thumbnails);
|
$(document).ready(img_thumbnails);
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
<div id="resource_list">
|
<div id="resource_list">
|
||||||
<% if @isproject %>
|
<% if @container_type == 0 %>
|
||||||
<%= render :partial => 'project_file_new', locals: {project: @project} %>
|
<%= render :partial => 'project_file_new', locals: {project: @project} %>
|
||||||
<% else %>
|
<% elsif @container_type == 1 %>
|
||||||
<%= render :partial => 'course_file', locals: {course: @course} %>
|
<%= render :partial => 'course_file', locals: {course: @course} %>
|
||||||
|
<% elsif @container_type == 2 %>
|
||||||
|
<%= render :partial => 'files/subfield_files', locals: {org_subfield: @org_subfield} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
|
||||||
|
<%= javascript_include_tag 'new_user' %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' ,'new_user' %>
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
<% @nav_dispaly_forum_label = 1%>
|
<% @nav_dispaly_forum_label = 1%>
|
||||||
<!-- added by fq -->
|
<!-- added by fq -->
|
||||||
<h1 style="margin-top: 2%; margin-left: 49%"><%= l :label_forum_new %></h1>
|
<h1 style="margin-top: 2%; margin-left: 49%"><%= l :label_forum_new %></h1>
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
|
||||||
|
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||||
<%= render 'form_create_mode' %>
|
<%= render 'form_create_mode' %>
|
||||||
|
|
||||||
<%#= link_to l(:button_back), forums_path %>
|
<%#= link_to l(:button_back), forums_path %>
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<%= javascript_include_tag 'new_user','/assets/kindeditor/pasteimg','/assets/kindeditor/kindeditor' %>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||||
|
<%= javascript_include_tag 'new_user' %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
<div class="postRightContainer">
|
<div class="postRightContainer">
|
||||||
<div id="create_memo_div" style="display: none">
|
<div id="create_memo_div" style="display: none">
|
||||||
|
@ -115,10 +119,7 @@
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url:'/forums/'+'<%= @forum.id.to_s%>'+'/memos',
|
url:'/forums/'+'<%= @forum.id.to_s%>'+'/memos',
|
||||||
type:'post',
|
type:'post',
|
||||||
data:{
|
data:$("#new_memo").serialize(),
|
||||||
'memo[content]':$("#memo_content").val(),
|
|
||||||
'memo[subject]':$("#memo_subject").val()
|
|
||||||
},
|
|
||||||
success:function(data){
|
success:function(data){
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
$("#homework_publish_time").val("");
|
$("#homework_publish_time").val("");
|
||||||
$("#homework_end_time").val("");
|
$("#homework_end_time").val("");
|
||||||
$("#course_id").val($("#option_select").val());
|
$("#course_id").val($("#option_select").val());
|
||||||
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => HomeworkCommon.new,:has_program => true })%>");
|
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => HomeworkCommon.new,:has_program => true,:has_group => true})%>");
|
||||||
homework_description_editor.html("");
|
homework_description_editor.html("");
|
||||||
$("#homework_editor").toggle();
|
$("#homework_editor").toggle();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
<%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true} do |f| %>
|
<%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true} do |f| %>
|
||||||
<%= error_messages_for 'issue', 'time_entry' %>
|
<%= error_messages_for 'issue', 'time_entry' %>
|
||||||
<%= render :partial => 'conflict' if @conflict %>
|
<%= render :partial => 'conflict' if @conflict %>
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<% column_content = ( query.inline_columns.map {|column| "#{column_content_new(column, issue)}"}) %>
|
<% column_content = ( query.inline_columns.map {|column| "#{column_content_new(column, issue)}"}) %>
|
||||||
<% unless issue.author.nil? || issue.author.name == "Anonymous" %>
|
<% unless issue.author.nil? || issue.author.name == "Anonymous" %>
|
||||||
<span class ="<%= get_issue_type(column_content[1])[0] %>" title="<%= get_issue_type(column_content[1])[1] %>"></span>
|
<span class ="<%= get_issue_type(column_content[1])[0] %>" title="<%= get_issue_type(column_content[1])[1] %>"></span>
|
||||||
<div class="problem_txt fl">
|
<div class="problem_txt fl w600">
|
||||||
<%= link_to issue.author.name, user_path(issue.author), :class => "problem_name c_orange fl" %>
|
<%= link_to issue.author.name, user_path(issue.author), :class => "problem_name c_orange fl" %>
|
||||||
<span class="fl"><%= l(:label_post_on_issue) %>(<%= "#{raw column_content[2]}" %>):</span>
|
<span class="fl"><%= l(:label_post_on_issue) %>(<%= "#{raw column_content[2]}" %>):</span>
|
||||||
<div class="problem_tit_div fl break_word">
|
<div class="problem_tit_div fl break_word">
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
<div class="project_r_h" xmlns="http://www.w3.org/1999/html">
|
<div class="project_r_h" xmlns="http://www.w3.org/1999/html">
|
||||||
<h2 class="project_h2"><%= l(:label_issue_new) %></h2>
|
<h2 class="project_h2"><%= l(:label_issue_new) %></h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: true) %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<div class="project_r_h">
|
<div class="project_r_h">
|
||||||
<h2 class="project_h2"><%= l(:label_issue_edit) %></h2>
|
<h2 class="project_h2"><%= l(:label_issue_edit) %></h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
<div class="footerAboutContainer">
|
<div class="footerAboutContainer">
|
||||||
<ul class="footerAbout">
|
<ul class="footerAbout">
|
||||||
<li class="fl"><a href="javascript:void:(0);" class="f_grey mw20" target="_blank"><%= l(:label_about_us)%></a>|</li>
|
<li class="fl"><a href="javascript:void:(0);" class="f_grey mw20" target="_blank"><%= l(:label_about_us)%></a>|</li>
|
||||||
<li class="fl"><a href="http://forge.trustie.net/projects/2/feedback" class="f_grey mw20" target="_blank"><%= l(:label_contact_us)%></a>|</li>
|
<li class="fl"><a href="https://forge.trustie.net/projects/2/feedback" class="f_grey mw20" target="_blank"><%= l(:label_contact_us)%></a>|</li>
|
||||||
<li class="fl"><a href="javascript:void:(0);" class="f_grey mw20" target="_blank"><%= l(:label_recruitment_information)%></a>|</li>
|
<li class="fl"><a href="javascript:void:(0);" class="f_grey mw20" target="_blank"><%= l(:label_recruitment_information)%></a>|</li>
|
||||||
<li class="fl"><a href="http://forge.trustie.net/forums/1/memos/1168" class="f_grey mw20" target="_blank"><%= l(:label_surpport_group)%></a>|</li>
|
<li class="fl"><%= link_to l(:label_surpport_group), "https://#{Setting.host_name}/forums/1/memos/1168", :class => "f_grey mw20", :target=>"_blank" %>|</li>
|
||||||
<li class="fl"><a href="javascript:void:(0);" class="f_grey mw20" target="_blank"><%= l(:label_forums)%></a>|</li>
|
<li class="fl"><a href="javascript:void:(0);" class="f_grey mw20" target="_blank"><%= l(:label_forums)%></a>|</li>
|
||||||
<li class="fl"><a href="javascript:void:(0);" class="f_grey ml20" target="_blank"><%= l(:label_language)%></a>
|
<li class="fl"><a href="javascript:void:(0);" class="f_grey ml20" target="_blank"><%= l(:label_language)%></a>
|
||||||
<select class="languageBox">
|
<select class="languageBox">
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<li class="fl"><a href="<%= about_us_path %>" class="f_grey mw20" target="_blank"><%= l(:label_about_us)%></a>|</li>
|
<li class="fl"><a href="<%= about_us_path %>" class="f_grey mw20" target="_blank"><%= l(:label_about_us)%></a>|</li>
|
||||||
<li class="fl"><a href="<%= agreement_path %>" class="f_grey mw20" target="_blank">服务协议</a>|</li>
|
<li class="fl"><a href="<%= agreement_path %>" class="f_grey mw20" target="_blank">服务协议</a>|</li>
|
||||||
<li class="fl" style="display: none"><span class="f_grey mw20" title="暂未开放"><%= l(:label_recruitment_information)%></span>|</li>
|
<li class="fl" style="display: none"><span class="f_grey mw20" title="暂未开放"><%= l(:label_recruitment_information)%></span>|</li>
|
||||||
<li class="fl"><a href="http://forge.trustie.net/forums/1/memos/1168" class="f_grey mw20" target="_blank"><%= l(:label_surpport_group)%></a>|</li>
|
<li class="fl"><%= link_to l(:label_surpport_group), "https://#{Setting.host_name}/forums/1/memos/1168", :class => "f_grey mw20", :target=>"_blank" %>|</li>
|
||||||
<li class="fl"><a href="<%= forums_path(:reorder_complex=>'desc')%>" class="f_grey mw20" target="_blank" ><%= l(:label_forums)%></a></li>
|
<li class="fl"><a href="<%= forums_path(:reorder_complex=>'desc')%>" class="f_grey mw20" target="_blank" ><%= l(:label_forums)%></a></li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
<%= link_to "作业", user_homeworks_user_path(User.current.id), :class => "c_white f16 db p10"%>
|
<%= link_to "作业", user_homeworks_user_path(User.current.id), :class => "c_white f16 db p10"%>
|
||||||
</li>
|
</li>
|
||||||
<li class="navHomepageMenu fl mr30">
|
<li class="navHomepageMenu fl mr30">
|
||||||
<a href="http://forge.trustie.net/forums/1/memos/1168" class="c_white f16 db p10">帮助中心</a>
|
<%= link_to "帮助中心", "https://#{Setting.host_name}/forums/1/memos/1168", :class =>"c_white f16 db p10" %>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<div class="fl">
|
<div class="fl">
|
||||||
<ul>
|
<ul>
|
||||||
<li class="navHomepageMenu fl mr40">
|
<li class="navHomepageMenu fl mr40">
|
||||||
<a href="http://forge.trustie.net/forums/1/memos/1168" class="c_white f16 p10">帮助中心</a>
|
<%= link_to "帮助中心", "https://#{Setting.host_name}/forums/1/memos/1168", :class =>"c_white f16 db p10" %>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -188,10 +188,10 @@
|
||||||
<%= link_to( "", new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => 'courseMenuSetting', :title =>"#{l(:label_new_poll)}") if is_teacher %>
|
<%= link_to( "", new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => 'courseMenuSetting', :title =>"#{l(:label_new_poll)}") if is_teacher %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% unless show_nav?(User.current.allowed_to?(:as_teacher,@course)? @course.exercises.count : @course.exercises.where("exercise_status=2").count) %>
|
<% unless show_nav?(User.current.allowed_to?(:as_teacher,@course)? @course.exercises.count : @course.exercises.where("exercise_status <> 1").count) %>
|
||||||
<div class="subNav">
|
<div class="subNav">
|
||||||
<%= link_to "在线测验", exercise_index_path(:course_id => @course.id), :class => " f14 c_blue02"%>
|
<%= link_to "在线测验", exercise_index_path(:course_id => @course.id), :class => " f14 c_blue02"%>
|
||||||
<%= link_to "(#{User.current.allowed_to?(:as_teacher,@course)? @course.exercises.count : @course.exercises.where("exercise_status=2").count})", exercise_index_path(:course_id => @course.id), :class => "subnav_num c_orange" %>
|
<%= link_to "(#{User.current.allowed_to?(:as_teacher,@course)? @course.exercises.count : @course.exercises.where("exercise_status <> 1").count})", exercise_index_path(:course_id => @course.id), :class => "subnav_num c_orange" %>
|
||||||
<%= link_to( "", new_exercise_path(:course_id => @course.id), :class => 'courseMenuSetting', :title =>"新建试卷") if is_teacher %>
|
<%= link_to( "", new_exercise_path(:course_id => @course.id), :class => 'courseMenuSetting', :title =>"新建试卷") if is_teacher %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -10,7 +10,10 @@
|
||||||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','application','prettify', 'nyan','leftside', :media => 'all' %>
|
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','application','prettify', 'nyan','leftside', :media => 'all' %>
|
||||||
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
|
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
|
||||||
<%= javascript_include_tag('jquery-1.8.3-ui-1.9.2-ujs-2.0.3', 'application', 'jquery.colorbox-min') %>
|
<%= javascript_include_tag('jquery-1.8.3-ui-1.9.2-ujs-2.0.3', 'application', 'jquery.colorbox-min') %>
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' ,'prettify' %>
|
|
||||||
|
<%= import_ke(enable_at: false, prettify: true, init_activity: false) %>
|
||||||
|
|
||||||
|
|
||||||
<%= heads_for_theme %>
|
<%= heads_for_theme %>
|
||||||
|
|
||||||
<%= call_hook :view_layouts_base_html_head %>
|
<%= call_hook :view_layouts_base_html_head %>
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
<%= heads_for_theme %>
|
<%= heads_for_theme %>
|
||||||
<%= stylesheet_link_tag 'public', 'pleft', 'project','prettify','jquery/jquery-ui-1.9.2','header','repository' %>
|
<%= stylesheet_link_tag 'public', 'pleft', 'project','prettify','jquery/jquery-ui-1.9.2','header','repository' %>
|
||||||
<%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move','attachments' %>
|
<%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move','attachments' %>
|
||||||
|
|
||||||
<%= call_hook :view_layouts_base_html_head %>
|
<%= call_hook :view_layouts_base_html_head %>
|
||||||
<!-- page specific tags -->
|
<!-- page specific tags -->
|
||||||
<%= yield :header_tags -%>
|
<%= yield :header_tags -%>
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
<%= javascript_include_tag 'new_user','/assets/kindeditor/pasteimg','/assets/kindeditor/kindeditor'%>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||||
|
<%= javascript_include_tag 'new_user' %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
function check_and_submit(){
|
function check_and_submit(){
|
||||||
|
|
|
@ -4,7 +4,11 @@
|
||||||
@nav_dispaly_main_contest_label = 1 %>
|
@nav_dispaly_main_contest_label = 1 %>
|
||||||
<% @nav_dispaly_forum_label = 1%>
|
<% @nav_dispaly_forum_label = 1%>
|
||||||
<!-- <h1>New memo</h1> -->
|
<!-- <h1>New memo</h1> -->
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
<div class="top-content">
|
<div class="top-content">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor","forum" %>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
|
||||||
|
<%= javascript_include_tag 'forum' %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
/*回复框*/
|
/*回复框*/
|
||||||
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
|
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor" %>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<%= error_messages_for 'message' %>
|
<%= error_messages_for 'message' %>
|
||||||
<% replying ||= false %>
|
<% replying ||= false %>
|
||||||
<% extra_option = replying ? { hidden: "hidden"} : { maxlength: 200 } %>
|
<% extra_option = replying ? { hidden: "hidden"} : { maxlength: 200 } %>
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
<li> </li>
|
<li> </li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="setting_right ">
|
<ul class="setting_right ">
|
||||||
<li><%= f.text_field :login,:no_label=>true, :required => true, :nh_required=>"1", :name => "login",:class=>"w210"%></li>
|
<li><%= f.text_field :login,:no_label=>true, :required => true,:style=>"color:grey", :nh_required=>"1",:disabled=>'disabled', :name => "login",:class=>"w210"%></li>
|
||||||
<li><%= f.text_field :mail,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210"%></li>
|
<li><%= f.text_field :mail,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210"%></li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<label><span class="c_red">*</span> <%= l(:field_title) %> :</label>
|
<label><span class="c_red">*</span> <%= l(:field_title) %> :</label>
|
||||||
<input type="text" name="news[title]" class="hwork_input" id="news_title" size="60" onkeyup="regexTitle();" maxlength="60" placeholder="60个字符以内" value="<%= is_new ? '' : @news.title %>">
|
<input type="text" name="news[title]" class="hwork_input" id="news_title" size="60" onkeyup="regexTitle();" maxlength="60" placeholder="60个字符以内" value="<%= is_new ? '' : @news.title %>">
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<div class="project_r_h">
|
<div class="project_r_h">
|
||||||
<h2 class="project_h2"><%= l(:label_course_news) %></h2>
|
<h2 class="project_h2"><%= l(:label_course_news) %></h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,18 +1,22 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<label><span class="c_red">*</span> <%= l(:field_title) %> :</label>
|
<label style="float: left"><span class="c_red">*</span> <%= l(:field_title) %> :</label>
|
||||||
<input type="text" name="news[title]" class="hwork_input_news" id="news_title" width="576px" onblur="regexTitle();" maxlength="60" placeholder="60个字符以内" value="<%= is_new ? '' : @news.title %>">
|
<input type="text" name="news[title]" class="hwork_input_news fl" id="news_title" width="576px" onblur="regexTitle();" maxlength="60" placeholder="60个字符以内" value="<%= is_new ? '' : @news.title %>">
|
||||||
|
<div class="cl"></div>
|
||||||
<p id="title_notice_span" class="ml55"></p>
|
<p id="title_notice_span" class="ml55"></p>
|
||||||
</li>
|
</li>
|
||||||
<li class="mb10">
|
<li class="mb10">
|
||||||
<% if is_new %>
|
<% if is_new %>
|
||||||
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||||
<label class="fl" ><span class="c_red">*</span> <%= l(:field_description) %> :</label>
|
<label class="fl" ><span class="c_red">*</span> <%= l(:field_description) %> :</label>
|
||||||
<%= f.kindeditor :description,:width=>'91%',:editor_id=>'project_news_description_editor' %>
|
<%= f.kindeditor :description,:width=>'90%',:editor_id=>'project_news_description_editor' %>
|
||||||
<p id="description_notice_span" class="ml55"></p>
|
<p id="description_notice_span" class="ml55"></p>
|
||||||
<% else %>
|
<% else %>
|
||||||
<label class="fl" ><span class="c_red">*</span> <%= l(:field_description) %> :</label>
|
<label class="fl" ><span class="c_red">*</span> <%= l(:field_description) %> :</label>
|
||||||
<%= f.kindeditor :description,:width=>'91%', :editor_id=>'project_news_description_editor', :owner_id => @news.id, :owner_type => OwnerTypeHelper::NEWS %>
|
<%= f.kindeditor :description,:width=>'90%', :editor_id=>'project_news_description_editor', :owner_id => @news.id, :owner_type => OwnerTypeHelper::NEWS %>
|
||||||
<p id="description_notice_span" class="ml55"></p>
|
<p id="description_notice_span" class="ml55"></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<div class="project_r_h">
|
<div class="project_r_h">
|
||||||
<h2 class="project_h2"><%= l(:label_course_news) %></h2>
|
<h2 class="project_h2"><%= l(:label_course_news) %></h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg'%>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function check_org_title()
|
function check_org_title()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
//location.reload();
|
//location.reload();
|
||||||
//window.location.href = '<%#= organization_org_document_comments_path(:organization_id => @org_document_comment.root.organization_id)%>'
|
<% if params[:detail_page] %>
|
||||||
|
window.location.href = '<%= organization_org_document_comments_path(:organization_id => @org_document_comment.root.organization_id)%>';
|
||||||
|
<% else %>
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
|
<% end %>
|
|
@ -1,4 +1,7 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg'%>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function check_org_title(title)
|
function check_org_title(title)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor" %>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
/*回复框*/
|
/*回复框*/
|
||||||
.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}
|
.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg'%>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function check_org_title()
|
function check_org_title()
|
||||||
{
|
{
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
<%= link_to "编辑文章", edit_org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id, :flag => 1), :class => "postOptionLink" %>
|
<%= link_to "编辑文章", edit_org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id, :flag => 1), :class => "postOptionLink" %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to "删除文章", org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id), :method => 'delete',
|
<%= link_to "删除文章", org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id, :detail_page => 1), :method => 'delete',
|
||||||
:data => {:confirm => l(:text_are_you_sure)},
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
:remote => true, :class => 'postOptionLink' %>
|
:remote => true, :class => 'postOptionLink' %>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -0,0 +1,96 @@
|
||||||
|
<script>
|
||||||
|
function searchone4reload(fileid){
|
||||||
|
var url = "<%= searchone4reload_course_files_path(@course)%>";
|
||||||
|
var data = {};data.fileid=fileid;
|
||||||
|
$.ajax({
|
||||||
|
url:url,dataType:'text',data:data,success:function(text){
|
||||||
|
var container_file_div = $("#container_files_"+fileid);
|
||||||
|
container_file_div.after(text);
|
||||||
|
container_file_div.remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function show_upload(obj)
|
||||||
|
{
|
||||||
|
switch(obj)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 1}) %>');
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 2}) %>');
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 3}) %>');
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 4}) %>');
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 6}) %>');
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 5}) %>');
|
||||||
|
}
|
||||||
|
showModal('ajax-modal', '513px');
|
||||||
|
$('#ajax-modal').siblings().remove();
|
||||||
|
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||||
|
$('#ajax-modal').parent().css("top","").css("left","");
|
||||||
|
$('#ajax-modal').parent().addClass("popbox_polls");
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeModal()
|
||||||
|
{
|
||||||
|
hideModal($("#popbox_upload"));
|
||||||
|
}
|
||||||
|
|
||||||
|
function presscss(id)
|
||||||
|
{
|
||||||
|
if(id == "incourse")
|
||||||
|
{
|
||||||
|
$('#incourse').attr("class", "re_schbtn b_dblue");
|
||||||
|
$('#insite').attr("class", "re_schbtn b_lblue");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$('#incourse').attr("class", "re_schbtn b_lblue");
|
||||||
|
$('#insite').attr("class", "re_schbtn b_dblue");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function buttoncss()
|
||||||
|
{
|
||||||
|
$('#incourse').attr("class", "re_schbtn b_lblue");
|
||||||
|
$('#insite').attr("class", "re_schbtn b_lblue");
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="resource"><!--资源库内容开始--->
|
||||||
|
<div class="re_top">
|
||||||
|
<%= form_tag( search_course_files_path(@course), method: 'get',:class => "re_search f_l",:remote=>true) do %>
|
||||||
|
<%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%>
|
||||||
|
<%= submit_tag "课内搜索", :class => "re_schbtn b_lblue",:name => "incourse",:id => "incourse", :onmouseover => "presscss('incourse')",:onmouseout =>"buttoncss()" %>
|
||||||
|
<%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %>
|
||||||
|
<% end %>
|
||||||
|
<% if is_course_teacher(User.current,@course) || (@course.publish_resource==1 && User.current.member_of_course?(@course) ) %> <!-- show_window('light','fade','20%','35%')-->
|
||||||
|
<!--<a href="javascript:void(0)" class="re_fabu f_r b_lblue" onclick="show_upload();">上传资源</a>-->
|
||||||
|
<p class="c_grey fr mt10 mr5">
|
||||||
|
上传:
|
||||||
|
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(1);">课件</a> |
|
||||||
|
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(2);">软件</a> |
|
||||||
|
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(3);">媒体</a> |
|
||||||
|
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(4);">代码</a> |
|
||||||
|
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(6);">论文</a> |
|
||||||
|
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(5);">其他</a>
|
||||||
|
</p>
|
||||||
|
<% end %>
|
||||||
|
</div><!---re_top end-->
|
||||||
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
<div class="re_con" id="course_list">
|
||||||
|
<%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} %>
|
||||||
|
</div><!---re_con end-->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% html_title(l(:label_attachment_plural)) -%>
|
|
@ -25,8 +25,13 @@
|
||||||
</div>
|
</div>
|
||||||
<% organization.org_subfields.each do |field| %>
|
<% organization.org_subfields.each do |field| %>
|
||||||
<div class="homepageLeftMenuBlock">
|
<div class="homepageLeftMenuBlock">
|
||||||
|
<% if field.field_type == "Post" %>
|
||||||
<%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText" %>
|
<%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText" %>
|
||||||
<%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子"%>
|
<%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子"%>
|
||||||
|
<% else %>
|
||||||
|
<%#= link_to "#{field.name}", org_subfield_files_path(field, :organization_id => organization.id), :class => "homepageMenuText" %>
|
||||||
|
<a href="javascript:void(0);" class="homepageMenuText"><%= field.name %></a>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepageLeftMenuCourses" id="homepageLeftMenuField_<%= field.id %>" style="display:none;">
|
<div class="homepageLeftMenuCourses" id="homepageLeftMenuField_<%= field.id %>" style="display:none;">
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -11,15 +11,11 @@
|
||||||
<ul style="text-align: left;" >
|
<ul style="text-align: left;" >
|
||||||
<%= radio_button_tag 'org_member[role_ids][]', role.id, member.roles.include?(role) %>
|
<%= radio_button_tag 'org_member[role_ids][]', role.id, member.roles.include?(role) %>
|
||||||
<!--编辑时候显示成员,中英文切换后面需从数据库的角度优化-->
|
<!--编辑时候显示成员,中英文切换后面需从数据库的角度优化-->
|
||||||
<% if User.current.language == "zh" %>
|
|
||||||
<% if role.id == 11 %>
|
<% if role.id == 11 %>
|
||||||
<label >管理人员</label>
|
<label >管理人员</label>
|
||||||
<% elsif role.id == 12 %>
|
<% elsif role.id == 12 %>
|
||||||
<label >组织成员</label>
|
<label >组织成员</label>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
|
||||||
<label ><%= h role %></label>
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
</ul>
|
||||||
<!--<br/>-->
|
<!--<br/>-->
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -1,22 +1,26 @@
|
||||||
|
|
||||||
<ul class="orgListRow">
|
<ul class="orgListRow">
|
||||||
<li class="orgListUser fb">已有栏目</li>
|
<li class="orgListUser fb">已有栏目</li>
|
||||||
<li class="orgListRole fb">状态</li>
|
<li class="orgListUser fb">状态</li>
|
||||||
|
<li class="orgListStatus fb">类型</li>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="orgListRow">
|
<ul class="orgListRow">
|
||||||
<li class="orgListUser">动态</li>
|
<li class="orgListUser">动态</li>
|
||||||
<li class="orgListUser">默认</li>
|
<li class="orgListUser">默认</li>
|
||||||
|
<li class="orgListStatus">默认</li>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="orgListRow">
|
<ul class="orgListRow">
|
||||||
<li class="orgListUser">项目</li>
|
<li class="orgListUser">项目</li>
|
||||||
<li class="orgListUser">默认</li>
|
<li class="orgListUser">默认</li>
|
||||||
|
<li class="orgListStatus">默认</li>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="orgListRow">
|
<ul class="orgListRow">
|
||||||
<li class="orgListUser">课程</li>
|
<li class="orgListUser">课程</li>
|
||||||
<li class="orgListUser">默认</li>
|
<li class="orgListUser">默认</li>
|
||||||
|
<li class="orgListStatus">默认</li>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</ul>
|
</ul>
|
||||||
<% subfields.each do |field| %>
|
<% subfields.each do |field| %>
|
||||||
|
@ -24,6 +28,7 @@
|
||||||
<li class="orgListUser"><div id="subfield_show_<%= field.id %>"><%= field.name %></div><div id="subfield_edit_<%= field.id %>" style="display:none;">
|
<li class="orgListUser"><div id="subfield_show_<%= field.id %>"><%= field.name %></div><div id="subfield_edit_<%= field.id %>" style="display:none;">
|
||||||
<input type="text" name="name" onblur="update_subfield('#subfield_show_<%= field.id %>','#subfield_edit_<%= field.id %>','<%= field.id %>',$(this).val());" value="<%= field.name %>" style="width:70px;" /></div></li>
|
<input type="text" name="name" onblur="update_subfield('#subfield_show_<%= field.id %>','#subfield_edit_<%= field.id %>','<%= field.id %>',$(this).val());" value="<%= field.name %>" style="width:70px;" /></div></li>
|
||||||
<li class="orgListUser">新增</li>
|
<li class="orgListUser">新增</li>
|
||||||
|
<li class="orgListStatus"><%= field.field_type == "Post" ? "帖子":"资源" %></li>
|
||||||
<%= link_to "删除",org_subfield_path(field), :method => 'delete',:remote => true, :confirm => "您确定删除吗?", :class => "linkBlue fr mr5" %>
|
<%= link_to "删除",org_subfield_path(field), :method => 'delete',:remote => true, :confirm => "您确定删除吗?", :class => "linkBlue fr mr5" %>
|
||||||
<a href="javascript:void(0);" class="linkBlue fr mr10" onclick="edit('#subfield_show_<%= field.id %>','#subfield_edit_<%= field.id %>');">编辑</a>
|
<a href="javascript:void(0);" class="linkBlue fr mr10" onclick="edit('#subfield_show_<%= field.id %>','#subfield_edit_<%= field.id %>');">编辑</a>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
//location.reload();
|
//location.reload();
|
||||||
window.location.href ='<%= organization_path(@org, :show_homepage => params[:show_homepage])%>';
|
window.location.href ='<%= organization_path(@org, :show_homepage => 1)%>';
|
|
@ -1,5 +1,9 @@
|
||||||
<%= javascript_include_tag "jquery.infinitescroll.js" %>
|
<%= javascript_include_tag "jquery.infinitescroll.js" %>
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor" %>
|
|
||||||
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
/*回复框*/
|
/*回复框*/
|
||||||
.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}
|
.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}
|
||||||
|
|
|
@ -11,7 +11,10 @@
|
||||||
div.recall_con{width:570px;}
|
div.recall_con{width:570px;}
|
||||||
div.recall_con .reply_btn{margin-left:525px;margin-top:5px;}
|
div.recall_con .reply_btn{margin-left:525px;margin-top:5px;}
|
||||||
</style>
|
</style>
|
||||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<div class="msg_box" id='leave-message' nhname='new_message' style="height:auto;">
|
<div class="msg_box" id='leave-message' nhname='new_message' style="height:auto;">
|
||||||
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
|
||||||
<h4><%= l(:label_user_response) %></h4>
|
<h4><%= l(:label_user_response) %></h4>
|
||||||
|
|
|
@ -26,4 +26,13 @@
|
||||||
</ul>
|
</ul>
|
||||||
<a href="javascript:void(0)" class="blue_btn ml110" onclick="submit_edit_project(<%= @project.id %>);" >保存</a>
|
<a href="javascript:void(0)" class="blue_btn ml110" onclick="submit_edit_project(<%= @project.id %>);" >保存</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% if User.current.member_of?(@project) && Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager") %>
|
||||||
|
<div class="mt30">
|
||||||
|
<img src="/images/pic_del.gif" class="mr5">
|
||||||
|
<%= link_to(l(:button_delete_project), { :controller => 'projects', :action => 'archive', :id => @project, :status => params[:status], :type =>"project" },
|
||||||
|
:data => {:confirm => l(:text_are_you_sure)}, :method => :post) unless @project.archived? %>
|
||||||
|
<%#=link_to "删除该课程", course_path(@course), :method => :delete, :confirm=>"确认要删除该课程吗?" %>
|
||||||
|
<span>(友情提示:删除该项目后如果您想恢复该项目,请联系系统管理员!)</span>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
|
|
||||||
<span class="fr mr5"><font class="fb ml2 mr2 vl_commit">
|
<span class="fr mr5"><font class="fb ml2 mr2 vl_commit">
|
||||||
|
|
||||||
<%=link_to"全部提交次数", {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev,:page=>1 ,:commit_count =>"#{@changesets_all_count}"} %></font>
|
<%=link_to"提交明细", {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev,:page=>1 ,:commit_count =>"#{@changesets_all_count}"} %></font>
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -0,0 +1,96 @@
|
||||||
|
<div id="popbox02">
|
||||||
|
<div>
|
||||||
|
<div class="relateText fl">请添加小组成员</div>
|
||||||
|
</div>
|
||||||
|
<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="clickCanel();"></a></div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div>
|
||||||
|
<form class="resourcesSearchBox">
|
||||||
|
<input type="text" name="serach" placeholder="输入关键字搜索" class="searchResourcePopup" />
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<ul class="addMemberC fl" id="all_students_list"></ul>
|
||||||
|
<div class="rightArrow"><img src="/images/course/right-arrow.png" width="16" height="30" /></div>
|
||||||
|
<ul class="addMemberC fr" id="choose_students_list">
|
||||||
|
<li id="choose_student_<%=User.current.id %>"><%=User.current.show_name %>
|
||||||
|
<% unless User.current.user_extensions.student_id == "" %>
|
||||||
|
(<%=User.current.user_extensions.student_id %>)
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="courseSendCancel mr15" style="float:right;"><a href="javascript:void(0);" class="sendSourceText" onclick="clickCanel();">取消</a></div>
|
||||||
|
<div class="courseSendSubmit" style="float:right;"><a href="javascript:void(0);" class="sendSourceText" onclick="clickOK()">确定</a></div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var lastSearchCondition = '';
|
||||||
|
var count = 0;
|
||||||
|
function search_stus(e){
|
||||||
|
if($(e.target).val().trim() == lastSearchCondition && lastSearchCondition != '')
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
lastSearchCondition = $(e.target).val().trim();
|
||||||
|
$.ajax({
|
||||||
|
url: '<%= url_for(:controller => 'student_work', :action => 'search_course_students') %>'+'?name='+ e.target.value+'&homework='+<%=@homework.id %>,
|
||||||
|
type:'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function throttle(method,context,e){
|
||||||
|
clearTimeout(method.tId);
|
||||||
|
method.tId=setTimeout(function(){
|
||||||
|
method.call(context,e);
|
||||||
|
},500);
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询
|
||||||
|
$("input[name='serach']").on('input', function (e) {
|
||||||
|
throttle(search_stus,window,e);
|
||||||
|
});
|
||||||
|
|
||||||
|
function clickOK() {
|
||||||
|
var str="";
|
||||||
|
var show = "合作成员:";
|
||||||
|
var lists = $("#choose_students_list li");
|
||||||
|
if(lists.length > 0) {
|
||||||
|
for(var i=0; i<lists.length; i++) {
|
||||||
|
var id = $(lists[i]).attr("id").replace(/[^0-9]/ig,"");
|
||||||
|
str += id;
|
||||||
|
var show_name = $(lists[i]).html();
|
||||||
|
var index = show_name.indexOf("(");
|
||||||
|
if (index != -1) {
|
||||||
|
var name = show_name.substring(0,show_name.indexOf("("));
|
||||||
|
} else {
|
||||||
|
var name = show_name;
|
||||||
|
}
|
||||||
|
show += name;
|
||||||
|
if (i == 0) {
|
||||||
|
show += "(组长)";
|
||||||
|
}
|
||||||
|
if (i != lists.length -1) {
|
||||||
|
str += ",";
|
||||||
|
show += "、";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$("#group_member_ids").val(str);
|
||||||
|
}
|
||||||
|
hideModal("#popbox02");
|
||||||
|
$("#group_members_show").show().html(show);
|
||||||
|
}
|
||||||
|
|
||||||
|
function delete_student(id) {
|
||||||
|
$("#choose_student_"+id).remove();
|
||||||
|
$("#student_"+id).one("click",function choose_student() {
|
||||||
|
$("#choose_students_list").append("<li id='choose_student_"+id+"' onclick='delete_student("+id+");'>"+$("#student_"+id).html()+"</li>");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
$.ajax({
|
||||||
|
url: '<%= url_for(:controller => 'student_work', :action => 'search_course_students') %>'+'?homework='+<%=@homework.id %>,
|
||||||
|
type:'get'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue