merge
This commit is contained in:
commit
4f57e48b92
|
@ -0,0 +1,3 @@
|
||||||
|
# Place all the behaviors and hooks related to the matching controller here.
|
||||||
|
# All this logic will automatically be available in application.js.
|
||||||
|
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
|
@ -0,0 +1,3 @@
|
||||||
|
// Place all the styles related to the org_subfields controller here.
|
||||||
|
// They will automatically be included in application.css.
|
||||||
|
// You can use Sass (SCSS) here: http://sass-lang.com/
|
|
@ -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) }
|
||||||
|
|
|
@ -25,6 +25,7 @@ class CoursesController < ApplicationController
|
||||||
before_filter :authorize_course, :only => [:show, :settings, :update, :course]
|
before_filter :authorize_course, :only => [:show, :settings, :update, :course]
|
||||||
before_filter :authorize_course_global, :only => [:new,:create]
|
before_filter :authorize_course_global, :only => [:new,:create]
|
||||||
before_filter :toggleCourse, :only => [:finishcourse, :restartcourse]
|
before_filter :toggleCourse, :only => [:finishcourse, :restartcourse]
|
||||||
|
before_filter :is_deleted, :only => [:show, :settings]
|
||||||
|
|
||||||
before_filter :require_login, :only => [:join, :unjoin]
|
before_filter :require_login, :only => [:join, :unjoin]
|
||||||
#before_filter :allow_join, :only => [:join]
|
#before_filter :allow_join, :only => [:join]
|
||||||
|
@ -55,11 +56,11 @@ class CoursesController < ApplicationController
|
||||||
|
|
||||||
def join
|
def join
|
||||||
if User.current.logged?
|
if User.current.logged?
|
||||||
cs = CoursesService.new
|
cs = CoursesService.new
|
||||||
@user = User.current
|
@user = User.current
|
||||||
join = cs.join_course params,@user
|
join = cs.join_course params,@user
|
||||||
@state = join[:state]
|
@state = join[:state]
|
||||||
@course = join[:course]
|
@course = join[:course]
|
||||||
# else
|
# else
|
||||||
# @course = Course.find_by_id params[:object_id]
|
# @course = Course.find_by_id params[:object_id]
|
||||||
# CourseMessage.create(:user_id => @course.tea_id, :course_id => @course.id, :viewed => false,:content=> params[:role],:course_message_id=>User.current.id,:course_message_type=>'JoinCourseRequest')
|
# CourseMessage.create(:user_id => @course.tea_id, :course_id => @course.id, :viewed => false,:content=> params[:role],:course_message_id=>User.current.id,:course_message_type=>'JoinCourseRequest')
|
||||||
|
@ -70,7 +71,7 @@ class CoursesController < ApplicationController
|
||||||
end
|
end
|
||||||
@object_id = params[:object_id]
|
@object_id = params[:object_id]
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js #{ render :partial => 'set_join', :locals => {:user => @user, :course => @course, :object_id => params[:object_id]} }
|
format.js #{ render :partial => 'set_join', :locals => {:user => @user, :course => @course, :object_id => params[:object_id]} }
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -98,14 +99,14 @@ class CoursesController < ApplicationController
|
||||||
c = cs.edit_course params,@course,User.current
|
c = cs.edit_course params,@course,User.current
|
||||||
@course = c[:course]
|
@course = c[:course]
|
||||||
if @course.errors.full_messages.count <= 0
|
if @course.errors.full_messages.count <= 0
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
# render :layout => 'base_courses'
|
# render :layout => 'base_courses'
|
||||||
flash[:notice] = l(:notice_successful_update)
|
flash[:notice] = l(:notice_successful_update)
|
||||||
redirect_to settings_course_url(@course)
|
redirect_to settings_course_url(@course)
|
||||||
}
|
}
|
||||||
format.api { render_api_ok }
|
format.api { render_api_ok }
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
|
@ -134,8 +135,8 @@ class CoursesController < ApplicationController
|
||||||
courses = Course.visible.where("LOWER(name) like '%#{params[:name].to_s.downcase}%'").order("time desc, created_at desc")
|
courses = Course.visible.where("LOWER(name) like '%#{params[:name].to_s.downcase}%'").order("time desc, created_at desc")
|
||||||
@courses = paginateHelper courses,10
|
@courses = paginateHelper courses,10
|
||||||
end
|
end
|
||||||
@name = params[:name]
|
@name = params[:name]
|
||||||
@type = 'courses'
|
@type = 'courses'
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
render :layout => 'course_base'
|
render :layout => 'course_base'
|
||||||
|
@ -427,7 +428,7 @@ class CoursesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def course
|
def course
|
||||||
@school_id = params[:school_id]
|
@school_id = params[:school_id]
|
||||||
per_page_option = 10
|
per_page_option = 10
|
||||||
if @school_id == "0" or @school_id.nil?
|
if @school_id == "0" or @school_id.nil?
|
||||||
@courses_all = Course.active.visible.
|
@courses_all = Course.active.visible.
|
||||||
|
@ -515,8 +516,8 @@ class CoursesController < ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
if !User.current.admin?
|
if !User.current.admin?
|
||||||
render_404
|
render_404
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@course_type = params[:course_type]
|
@course_type = params[:course_type]
|
||||||
@school_id = params[:school_id]
|
@school_id = params[:school_id]
|
||||||
|
@ -565,7 +566,7 @@ class CoursesController < ApplicationController
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
render :layout => 'base'
|
render :layout => 'base'
|
||||||
}
|
}
|
||||||
format.atom {
|
format.atom {
|
||||||
courses = Course.visible.order('created_on DESC').limit(Setting.feeds_limit.to_i).all
|
courses = Course.visible.order('created_on DESC').limit(Setting.feeds_limit.to_i).all
|
||||||
|
@ -581,6 +582,13 @@ class CoursesController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def is_deleted
|
||||||
|
if @course.is_delete == 1 and !User.current.admin?
|
||||||
|
render_404
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def get_courses
|
def get_courses
|
||||||
@user = User.current
|
@user = User.current
|
||||||
membership = @user.coursememberships.all
|
membership = @user.coursememberships.all
|
||||||
|
@ -634,6 +642,11 @@ class CoursesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
# 被删除的课程只有超级管理员才能看到,is_delete为1的时候,标记课程被删除
|
||||||
|
# if @course.is_delete == 1 && !User.current.admin?
|
||||||
|
# render_403
|
||||||
|
# return
|
||||||
|
# end
|
||||||
#更新创建课程消息状态
|
#更新创建课程消息状态
|
||||||
create_course_messages = @course.course_messages.where("user_id =? and course_message_type =? and course_id =? and viewed =?", User.current.id, 'Course', @course.id, 0)
|
create_course_messages = @course.course_messages.where("user_id =? and course_message_type =? and course_id =? and viewed =?", User.current.id, 'Course', @course.id, 0)
|
||||||
create_course_messages.update_all(:viewed => true)
|
create_course_messages.update_all(:viewed => true)
|
||||||
|
@ -684,10 +697,10 @@ class CoursesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def feedback
|
def feedback
|
||||||
@course.journals_for_messages.each do |messages|
|
@course.journals_for_messages.each do |messages|
|
||||||
query = messages.course_messages.where("user_id = ?", User.current.id)
|
query = messages.course_messages.where("user_id = ?", User.current.id)
|
||||||
query.update_all(:viewed => true);
|
query.update_all(:viewed => true);
|
||||||
end
|
end
|
||||||
|
|
||||||
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course)))
|
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course)))
|
||||||
page = params[:page]
|
page = params[:page]
|
||||||
|
@ -738,20 +751,20 @@ class CoursesController < ApplicationController
|
||||||
|
|
||||||
#从课程创建的老师那里选择课程大纲
|
#从课程创建的老师那里选择课程大纲
|
||||||
def course_outline
|
def course_outline
|
||||||
@teacher = User.find(@course.tea_id)
|
@teacher = User.find(@course.tea_id)
|
||||||
@blog_articles = @teacher.blog.articles
|
@blog_articles = @teacher.blog.articles
|
||||||
@is_in_show_outline_page = params[:is_in_show_outline_page]
|
@is_in_show_outline_page = params[:is_in_show_outline_page]
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#根据关键字搜索,查找方法一样的,但返回内容不一样
|
#根据关键字搜索,查找方法一样的,但返回内容不一样
|
||||||
def search_course_outline
|
def search_course_outline
|
||||||
@article_title = params[:title]
|
@article_title = params[:title]
|
||||||
@teacher = User.find(@course.tea_id)
|
@teacher = User.find(@course.tea_id)
|
||||||
@blog_articles = @teacher.blog.articles.like(@article_title)
|
@blog_articles = @teacher.blog.articles.like(@article_title)
|
||||||
render :json=>@blog_articles.to_json
|
render :json=>@blog_articles.to_json
|
||||||
end
|
end
|
||||||
|
|
||||||
#设置或者更改课程的大纲
|
#设置或者更改课程的大纲
|
||||||
|
@ -771,10 +784,23 @@ class CoursesController < ApplicationController
|
||||||
format.html {render :layout => 'base_courses'}
|
format.html {render :layout => 'base_courses'}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
#删除课程
|
|
||||||
#删除课程只是将课程的is_delete状态改为false,is_delete为false状态的课程只有管理员可以看到
|
|
||||||
def destroy
|
|
||||||
|
|
||||||
|
#删除课程
|
||||||
|
#删除课程只是将课程的is_deleted状态改为false,is_deleted为false状态的课程只有管理员可以看到
|
||||||
|
def destroy
|
||||||
|
@course.update_attributes(:is_delete => true)
|
||||||
|
@course = nil
|
||||||
|
redirect_to user_url(User.current)
|
||||||
|
end
|
||||||
|
|
||||||
|
# 恢复已删除的课程
|
||||||
|
def renew
|
||||||
|
if User.current.admin?
|
||||||
|
@course.update_attributes(:is_delete => false)
|
||||||
|
redirect_to course_path(@course)
|
||||||
|
else
|
||||||
|
return 404
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -797,7 +823,7 @@ class CoursesController < ApplicationController
|
||||||
def can_show_course
|
def can_show_course
|
||||||
@first_page = FirstPage.find_by_page_type('project')
|
@first_page = FirstPage.find_by_page_type('project')
|
||||||
if @first_page.try(:show_course) == 2
|
if @first_page.try(:show_course) == 2
|
||||||
render_404
|
render_404
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -18,13 +18,13 @@ 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 => 2).order("created_at asc")
|
||||||
|
@ -48,13 +48,13 @@ 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?)
|
if @exercise.exercise_status != 2 && (!(User.current.allowed_to?(:as_teacher,@course) || User.current.admin?))
|
||||||
render_403
|
render_403
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
|
@ -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,14 +126,33 @@ 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
|
||||||
student_works.each_with_index do |work, index|
|
if @homework.homework_type == 3
|
||||||
user = work.user
|
student_work_projects = @homework.student_work_projects.where("student_work_id is not null")
|
||||||
n = @homework_detail_manual.evaluation_num
|
student_work_projects.each_with_index do |pro_work, pro_index|
|
||||||
n = n < student_works.size ? n : student_works.size - 1
|
n = @homework_detail_manual.evaluation_num
|
||||||
assigned_homeworks = get_assigned_homeworks(student_works, n, index)
|
n = n < student_works.size ? n : student_works.size - 1
|
||||||
assigned_homeworks.each do |h|
|
work_index = -1
|
||||||
student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: user.id, student_work_id: h.id)
|
student_works.each_with_index do |stu_work, stu_index|
|
||||||
student_works_evaluation_distributions.save
|
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|
|
||||||
|
user = work.user
|
||||||
|
n = @homework_detail_manual.evaluation_num
|
||||||
|
n = n < student_works.size ? n : student_works.size - 1
|
||||||
|
assigned_homeworks = get_assigned_homeworks(student_works, n, index)
|
||||||
|
assigned_homeworks.each do |h|
|
||||||
|
student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: user.id, student_work_id: h.id)
|
||||||
|
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)
|
||||||
|
@ -143,7 +162,8 @@ 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
|
||||||
end
|
end
|
||||||
|
@ -262,6 +282,7 @@ class HomeworkCommonController < ApplicationController
|
||||||
@user_activity_id = -1
|
@user_activity_id = -1
|
||||||
end
|
end
|
||||||
@is_in_course = params[:is_in_course]
|
@is_in_course = params[:is_in_course]
|
||||||
|
@course_activity = params[:course_activity].to_i
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -276,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
|
||||||
|
|
|
@ -169,6 +169,11 @@ class MessagesController < ApplicationController
|
||||||
course_activity.updated_at = Time.now
|
course_activity.updated_at = Time.now
|
||||||
course_activity.save
|
course_activity.save
|
||||||
end
|
end
|
||||||
|
forge_activity = ForgeActivity.where("forge_act_type='Message' and forge_act_id=#{@topic.id}").first
|
||||||
|
if forge_activity
|
||||||
|
forge_activity.updated_at = Time.now
|
||||||
|
forge_activity.save
|
||||||
|
end
|
||||||
user_activity = UserActivity.where("act_type='Message' and act_id =#{@topic.id}").first
|
user_activity = UserActivity.where("act_type='Message' and act_id =#{@topic.id}").first
|
||||||
if user_activity
|
if user_activity
|
||||||
user_activity.updated_at = Time.now
|
user_activity.updated_at = Time.now
|
||||||
|
|
|
@ -109,16 +109,27 @@ class MyController < ApplicationController
|
||||||
# Edit user's account
|
# Edit user's account
|
||||||
def account
|
def account
|
||||||
@user = User.current
|
@user = User.current
|
||||||
|
|
||||||
lg=@user.login
|
lg=@user.login
|
||||||
@pref = @user.pref
|
@pref = @user.pref
|
||||||
diskfile = disk_filename('User', @user.id)
|
diskfile = disk_filename('User', @user.id)
|
||||||
diskfile1 = diskfile + 'temp'
|
diskfile1 = diskfile + 'temp'
|
||||||
begin
|
begin
|
||||||
if request.post?
|
if request.post?
|
||||||
|
# 修改邮箱的时候同步修改到gitlab
|
||||||
|
if @user.mail != params[:user][:mail]
|
||||||
|
g = Gitlab.client
|
||||||
|
begin
|
||||||
|
g.edit_user(@user.gid, :email => params[:user][:mail])
|
||||||
|
rescue
|
||||||
|
logger.error "sync user's email of gitlab failed!"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
@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]
|
||||||
|
@ -212,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
|
||||||
|
|
|
@ -11,10 +11,17 @@ class OrgDocumentCommentsController < ApplicationController
|
||||||
@org_document_comment = OrgDocumentComment.new(:organization_id => @organization.id, :creator_id => User.current.id)
|
@org_document_comment = OrgDocumentComment.new(:organization_id => @organization.id, :creator_id => User.current.id)
|
||||||
@org_document_comment.title = params[:org_document_comment][:title]
|
@org_document_comment.title = params[:org_document_comment][:title]
|
||||||
@org_document_comment.content = params[:org_document_comment][:content]
|
@org_document_comment.content = params[:org_document_comment][:content]
|
||||||
|
if params[:field_id]
|
||||||
|
@org_document_comment.org_subfield_id = params[:field_id].to_i
|
||||||
|
end
|
||||||
if @org_document_comment.save
|
if @org_document_comment.save
|
||||||
flash.keep[:notice] = l(:notice_successful_create)
|
flash.keep[:notice] = l(:notice_successful_create)
|
||||||
OrgActivity
|
EditorOfDocument.create(:editor_id => User.current.id, :org_document_comment_id => @org_document_comment.id, :created_at => @org_document_comment.updated_at)
|
||||||
redirect_to organization_org_document_comments_path(@organization)
|
if params[:field_id]
|
||||||
|
redirect_to organization_path(@organization, :org_subfield_id => params[:field_id])
|
||||||
|
else
|
||||||
|
redirect_to organization_org_document_comments_path(@organization)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
redirect_to new_org_document_comment_path(:organization_id => @organization.id)
|
redirect_to new_org_document_comment_path(:organization_id => @organization.id)
|
||||||
end
|
end
|
||||||
|
@ -36,13 +43,18 @@ class OrgDocumentCommentsController < ApplicationController
|
||||||
if @org_document.parent.nil?
|
if @org_document.parent.nil?
|
||||||
act = OrgActivity.where("org_act_type='OrgDocumentComment' and org_act_id =?", @org_document.id).first
|
act = OrgActivity.where("org_act_type='OrgDocumentComment' and org_act_id =?", @org_document.id).first
|
||||||
act.update_attributes(:updated_at => @org_document.updated_at)
|
act.update_attributes(:updated_at => @org_document.updated_at)
|
||||||
|
EditorOfDocument.create(:editor_id => User.current.id, :org_document_comment_id => @org_document.id, :created_at => Time.now)
|
||||||
end
|
end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
if params[:flag].to_i == 0
|
if params[:flag].to_i == 0
|
||||||
redirect_to organization_org_document_comments_path(:organization_id => @org_document.organization.id)
|
redirect_to organization_org_document_comments_path(:organization_id => @org_document.organization.id)
|
||||||
else
|
else
|
||||||
redirect_to org_document_comment_path(@org_document.root.id, :organization_id => @org_document.organization.id)
|
if params[:flag].to_i == 1
|
||||||
|
redirect_to org_document_comment_path(@org_document.root.id, :organization_id => @org_document.organization.id)
|
||||||
|
else
|
||||||
|
redirect_to organization_path(@org_document.organization.id, :org_subfield_id => params[:org_subfield_id])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
@ -81,10 +93,10 @@ class OrgDocumentCommentsController < ApplicationController
|
||||||
def destroy
|
def destroy
|
||||||
@org_document_comment = OrgDocumentComment.find(params[:id])
|
@org_document_comment = OrgDocumentComment.find(params[:id])
|
||||||
org = @org_document_comment.organization
|
org = @org_document_comment.organization
|
||||||
|
if @org_document_comment.id == org.home_id
|
||||||
|
org.update_attributes(:home_id => nil)
|
||||||
|
end
|
||||||
if @org_document_comment.destroy
|
if @org_document_comment.destroy
|
||||||
if @org_document_comment.id == org.id
|
|
||||||
org.home_id == nil
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
class OrgSubfieldsController < ApplicationController
|
||||||
|
def create
|
||||||
|
@subfield = OrgSubfield.create(:name => params[:name])
|
||||||
|
@organization = Organization.find(params[:organization_id])
|
||||||
|
@organization.org_subfields << @subfield
|
||||||
|
@subfield.update_attributes(:priority => @subfield.id, :field_type => params[:field_type])
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
@subfield = OrgSubfield.find(params[:id])
|
||||||
|
@organization = Organization.find(@subfield.organization_id)
|
||||||
|
@subfield.destroy
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
@subfield = OrgSubfield.find(params[:id])
|
||||||
|
@organization = Organization.find(@subfield.organization_id)
|
||||||
|
@subfield.update_attributes(:name => params[:name])
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
|
@ -37,6 +37,19 @@ class OrganizationsController < ApplicationController
|
||||||
@organization = Organization.new
|
@organization = Organization.new
|
||||||
render :layout => 'new_base'
|
render :layout => 'new_base'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def edit
|
||||||
|
@organization = Organization.find(params[:id])
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
@organization = Organization.find(params[:id])
|
||||||
|
@organization.destroy
|
||||||
|
respond_to do |format|
|
||||||
|
format.html{ redirect_to admin_organization_path }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@organization = Organization.new
|
@organization = Organization.new
|
||||||
@organization.name = params[:organization][:name]
|
@organization.name = params[:organization][:name]
|
||||||
|
@ -55,29 +68,35 @@ class OrganizationsController < ApplicationController
|
||||||
def show
|
def show
|
||||||
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
|
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
|
||||||
@organization = Organization.find(params[:id])
|
@organization = Organization.find(params[:id])
|
||||||
project_ids = @organization.projects.map(&:id) << 0
|
if params[:org_subfield_id]
|
||||||
course_ids = @organization.courses.map(&:id) << 0
|
@org_subfield = OrgSubfield.find(params[:org_subfield_id])
|
||||||
course_types = "('Message','News','HomeworkCommon','Poll','Course')"
|
@org_subfield_ids = @org_subfield.org_document_comments.map(&:id) << 0
|
||||||
case params[:type]
|
@org_activities = OrgActivity.where("org_act_type='OrgDocumentComment'and org_act_id in (#{@org_subfield_ids.join(",")})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||||
when nil
|
else
|
||||||
@org_activities = OrgActivity.where("(container_id =? and container_type =?) " +
|
project_ids = @organization.projects.map(&:id) << 0
|
||||||
"or (container_type ='Project' and org_act_type in ('Issue','Message','ProjectCreateInfo') and container_id in (#{project_ids.join(',')})) "+
|
course_ids = @organization.courses.map(&:id) << 0
|
||||||
"or (container_type ='Course' and org_act_type in #{course_types} and container_id in (#{course_ids.join(',')}))",
|
course_types = "('Message','News','HomeworkCommon','Poll','Course')"
|
||||||
@organization.id, 'Organization').order('updated_at desc').page(params[:page] || 1).per(10)
|
case params[:type]
|
||||||
when 'project_issue'
|
when nil
|
||||||
@org_activities = OrgActivity.where("container_type = 'Project' and org_act_type = 'Issue' and container_id in (#{project_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
@org_activities = OrgActivity.where("(container_id =? and container_type =?) " +
|
||||||
when 'project_message'
|
"or (container_type ='Project' and org_act_type in ('Issue','Message','ProjectCreateInfo') and container_id in (#{project_ids.join(',')})) "+
|
||||||
@org_activities = OrgActivity.where("container_type = 'Project' and org_act_type = 'Message' and container_id in (#{project_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
"or (container_type ='Course' and org_act_type in #{course_types} and container_id in (#{course_ids.join(',')}))",
|
||||||
when 'org'
|
@organization.id, 'Organization').order('updated_at desc').page(params[:page] || 1).per(10)
|
||||||
@org_activities = OrgActivity.where("container_id =? and container_type =?",@organization.id, 'Organization').order('updated_at desc').page(params[:page] || 1).per(10)
|
when 'project_issue'
|
||||||
when 'course_homework'
|
@org_activities = OrgActivity.where("container_type = 'Project' and org_act_type = 'Issue' and container_id in (#{project_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||||
@org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'HomeworkCommon' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
when 'project_message'
|
||||||
when 'course_news'
|
@org_activities = OrgActivity.where("container_type = 'Project' and org_act_type = 'Message' and container_id in (#{project_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||||
@org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'News' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
when 'org'
|
||||||
when 'course_message'
|
@org_activities = OrgActivity.where("container_id =? and container_type =?",@organization.id, 'Organization').order('updated_at desc').page(params[:page] || 1).per(10)
|
||||||
@org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'Message' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
when 'course_homework'
|
||||||
when 'course_poll'
|
@org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'HomeworkCommon' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||||
@org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'Poll' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
when 'course_news'
|
||||||
|
@org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'News' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||||
|
when 'course_message'
|
||||||
|
@org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'Message' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||||
|
when 'course_poll'
|
||||||
|
@org_activities = OrgActivity.where("container_type = 'Course' and org_act_type = 'Poll' and container_id in (#{course_ids.join(',')})").order('updated_at desc').page(params[:page] || 1).per(10)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
@page = params[:page]
|
@page = params[:page]
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
@ -142,6 +161,12 @@ class OrganizationsController < ApplicationController
|
||||||
# end
|
# end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def cancel_homepage
|
||||||
|
@org = Organization.find(params[:id])
|
||||||
|
@org.home_id = nil
|
||||||
|
@org.save
|
||||||
|
end
|
||||||
|
|
||||||
def autocomplete_search
|
def autocomplete_search
|
||||||
@project = Project.find(params[:project_id])
|
@project = Project.find(params[:project_id])
|
||||||
#@flag = params[:flag] || false
|
#@flag = params[:flag] || false
|
||||||
|
@ -220,6 +245,13 @@ class OrganizationsController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def logout
|
||||||
|
logout_user
|
||||||
|
respond_to do |format|
|
||||||
|
format.html {redirect_to organization_path(params[:id])}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def search_projects
|
def search_projects
|
||||||
@organization = Organization.find(params[:id])
|
@organization = Organization.find(params[:id])
|
||||||
condition = '%%'
|
condition = '%%'
|
||||||
|
|
|
@ -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
|
||||||
|
@ -320,9 +320,20 @@ class ProjectsController < ApplicationController
|
||||||
@activity.scope_select {|t| !has["show_#{t}"].nil?}
|
@activity.scope_select {|t| !has["show_#{t}"].nil?}
|
||||||
=end
|
=end
|
||||||
|
|
||||||
|
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||||
# 根据私密性,取出符合条件的所有数据
|
# 根据私密性,取出符合条件的所有数据
|
||||||
if User.current.member_of?(@project) || User.current.admin?
|
if User.current.member_of?(@project) || User.current.admin?
|
||||||
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type != ?",@project, "Document" ).order("created_at desc").page(params['page'|| 1]).per(20);
|
case params[:type]
|
||||||
|
when nil
|
||||||
|
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type in ('Issue', 'Message','News', 'ProjectCreateInfo')",@project).order("updated_at desc").limit(10).offset(@page * 10)
|
||||||
|
when 'issue'
|
||||||
|
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type = 'Issue'",@project).order("updated_at desc").limit(10).offset(@page * 10)
|
||||||
|
when 'news'
|
||||||
|
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type = 'News'",@project).order("updated_at desc").limit(10).offset(@page * 10)
|
||||||
|
when 'message'
|
||||||
|
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type = 'Message'",@project).order("updated_at desc").limit(10).offset(@page * 10)
|
||||||
|
end
|
||||||
|
|
||||||
#events = @activity.events(@date_from, @date_to)
|
#events = @activity.events(@date_from, @date_to)
|
||||||
else
|
else
|
||||||
@events_pages = ForgeActivity.includes(:project).where("forge_activities.project_id = ? and projects.is_public
|
@events_pages = ForgeActivity.includes(:project).where("forge_activities.project_id = ? and projects.is_public
|
||||||
|
@ -686,7 +697,11 @@ class ProjectsController < ApplicationController
|
||||||
flash[:error] = l(:error_can_not_archive_project)
|
flash[:error] = l(:error_can_not_archive_project)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
redirect_to admin_projects_url(:status => params[:status])
|
if params[:type] == "project"
|
||||||
|
redirect_to user_path(User.current)
|
||||||
|
else
|
||||||
|
redirect_to admin_projects_url(:status => params[:status])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def unarchive
|
def unarchive
|
||||||
|
|
|
@ -31,7 +31,7 @@ class RepositoriesController < ApplicationController
|
||||||
default_search_scope :changesets
|
default_search_scope :changesets
|
||||||
|
|
||||||
before_filter :find_project_by_project_id, :only => [:new, :create, :newrepo]
|
before_filter :find_project_by_project_id, :only => [:new, :create, :newrepo]
|
||||||
before_filter :find_repository, :only => [:edit, :update, :destroy, :committers]
|
before_filter :find_repository, :only => [:edit, :update, :destroy, :committers, :forked]
|
||||||
before_filter :find_project_repository, :except => [:new, :create, :newcreate, :edit, :update, :destroy, :committers, :newrepo,:to_gitlab]
|
before_filter :find_project_repository, :except => [:new, :create, :newcreate, :edit, :update, :destroy, :committers, :newrepo,:to_gitlab]
|
||||||
before_filter :find_changeset, :only => [:revision, :add_related_issue, :remove_related_issue]
|
before_filter :find_changeset, :only => [:revision, :add_related_issue, :remove_related_issue]
|
||||||
before_filter :authorize , :except => [:newrepo,:newcreate,:fork, :to_gitlab, :forked]
|
before_filter :authorize , :except => [:newrepo,:newcreate,:fork, :to_gitlab, :forked]
|
||||||
|
@ -69,20 +69,22 @@ class RepositoriesController < ApplicationController
|
||||||
project = project_from_current_project(@project.id, User.current.id)
|
project = project_from_current_project(@project.id, User.current.id)
|
||||||
redirect_to project_path(project)
|
redirect_to project_path(project)
|
||||||
else
|
else
|
||||||
# 单个用户只能拥有一个名字一样的版本库,否则不能fork
|
# 自己不能fork自己的项目
|
||||||
# if is_sigle_identifier?(User.current, @repository.identifier)
|
if User.current.id == @project.user_id
|
||||||
# REDO: 那些人有权限forked项目
|
flash[:notice] = l(:project_gitlab_fork_own)
|
||||||
|
redirect_to repository_url(@repository)
|
||||||
|
else
|
||||||
g = Gitlab.client
|
g = Gitlab.client
|
||||||
|
if User.current.gid.nil?
|
||||||
|
g.sync_user(User.current)
|
||||||
|
end
|
||||||
gproject = g.fork(@project.gpid, User.current.gid)
|
gproject = g.fork(@project.gpid, User.current.gid)
|
||||||
if gproject
|
if gproject
|
||||||
copy_project(@project, gproject)
|
copy_project(@project, gproject)
|
||||||
forked_count = @project.forked_count.to_i + 1
|
forked_count = @project.forked_count.to_i + 1
|
||||||
@project.update_attributes(:forked_count => forked_count)
|
@project.update_attributes(:forked_count => forked_count)
|
||||||
end
|
end
|
||||||
# else
|
end
|
||||||
# flash[:notice] = l(:project_gitlab_fork_double_message)
|
|
||||||
# redirect_to settings_project_url(@project, :tab => 'repositories')
|
|
||||||
# end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -347,27 +349,13 @@ update
|
||||||
# end
|
# end
|
||||||
|
|
||||||
|
|
||||||
#add by hx
|
|
||||||
if g.commits(@project.gpid , :page=>25).count==0
|
|
||||||
count = count_commits(@project.gpid , 0 , 25)
|
|
||||||
elsif g.commits(@project.gpid , :page=>50).count ==0
|
|
||||||
count = count_commits(@project.gpid , 25 , 50)+ 25 * 20
|
|
||||||
elsif g.commits(@project.gpid , :page=>75).count ==0
|
|
||||||
count = count_commits(@project.gpid , 50 , 75)+ 50 * 20
|
|
||||||
elsif g.commits(@project.gpid , :page=>100).count== 0
|
|
||||||
count = count_commits(@project.gpid , 75 , 100) + 75 * 20
|
|
||||||
elsif g.commits(@project.gpid , :page=>125).count==0
|
|
||||||
count = count_commits(@project.gpid , 100 , 125) + 100 * 20
|
|
||||||
elsif g.commits(@project.gpid , :page=>150).count==0
|
|
||||||
count = count_commits(@project.gpid , 125 , 150) + 125 * 20
|
|
||||||
else
|
|
||||||
count = count_commits(@project.gpid , 150 ,200) + 150 * 20
|
|
||||||
end
|
|
||||||
|
|
||||||
@changesets = g.commits(@project.gpid)
|
|
||||||
|
|
||||||
|
@changesets = g.commits(@project.gpid, :ref_name => @rev)
|
||||||
# @changesets = @repository.latest_changesets(@path, @rev)
|
# @changesets = @repository.latest_changesets(@path, @rev)
|
||||||
# @changesets_count = @repository.latest_changesets(@path, @rev).count
|
# @changesets_count = @repository.latest_changesets(@path, @rev).count
|
||||||
@changesets_all_count = count
|
@changesets_all_count = 0
|
||||||
@changesets_latest_coimmit = @changesets[0]
|
@changesets_latest_coimmit = @changesets[0]
|
||||||
@properties = @repository.properties(@path, @rev)
|
@properties = @repository.properties(@path, @rev)
|
||||||
@repositories = @project.repositories
|
@repositories = @project.repositories
|
||||||
|
@ -410,8 +398,28 @@ update
|
||||||
limit = 20
|
limit = 20
|
||||||
#每次页面的换回值从1开始,但是gitlab的页面查询是从0开始,所以先改变page的类型减一在改回来
|
#每次页面的换回值从1开始,但是gitlab的页面查询是从0开始,所以先改变page的类型减一在改回来
|
||||||
@commits = g.commits(@project.gpid, page:(params[:page].to_i - 1).to_s)
|
@commits = g.commits(@project.gpid, page:(params[:page].to_i - 1).to_s)
|
||||||
|
|
||||||
|
#add by hx
|
||||||
|
if g.commits(@project.gpid , :page=>200).count > 0
|
||||||
|
count = 4020
|
||||||
|
elsif g.commits(@project.gpid , :page=>25).count==0
|
||||||
|
count = count_commits(@project.gpid , 0 , 25)
|
||||||
|
elsif g.commits(@project.gpid , :page=>50).count ==0
|
||||||
|
count = count_commits(@project.gpid , 25 , 50)+ 25 * 20
|
||||||
|
elsif g.commits(@project.gpid , :page=>75).count ==0
|
||||||
|
count = count_commits(@project.gpid , 50 , 75)+ 50 * 20
|
||||||
|
elsif g.commits(@project.gpid , :page=>100).count== 0
|
||||||
|
count = count_commits(@project.gpid , 75 , 100) + 75 * 20
|
||||||
|
elsif g.commits(@project.gpid , :page=>125).count==0
|
||||||
|
count = count_commits(@project.gpid , 100 , 125) + 100 * 20
|
||||||
|
elsif g.commits(@project.gpid , :page=>150).count==0
|
||||||
|
count = count_commits(@project.gpid , 125 , 150) + 125 * 20
|
||||||
|
else
|
||||||
|
count = count_commits(@project.gpid , 150 ,200) + 150 * 20
|
||||||
|
end
|
||||||
|
|
||||||
#页面传递必须要str类型,但是Paginator的初始化必须要num类型,需要类型转化
|
#页面传递必须要str类型,但是Paginator的初始化必须要num类型,需要类型转化
|
||||||
@commits_count = params[:commit_count].to_i
|
@commits_count = count
|
||||||
@commits_pages = Redmine::Pagination::Paginator.new @commits_count,limit,params[:page]
|
@commits_pages = Redmine::Pagination::Paginator.new @commits_count,limit,params[:page]
|
||||||
|
|
||||||
@commit = g.commit(@project.gpid,@rev)
|
@commit = g.commit(@project.gpid,@rev)
|
||||||
|
|
|
@ -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 #学生 && 未开启匿评 只看到自己的
|
||||||
@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)
|
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)
|
||||||
|
end
|
||||||
elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表
|
elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表
|
||||||
my_work = @homework.student_works.where(:user_id => User.current.id)
|
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)
|
||||||
|
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 #学生 && 关闭匿评 未提交作品之前列表为空,提交了作品看到所有的
|
||||||
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)
|
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)
|
||||||
|
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 #学生 && 未开启匿评 只看到自己的
|
||||||
@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)
|
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)
|
||||||
|
end
|
||||||
elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表
|
elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表
|
||||||
my_work = @homework.student_works.where(:user_id => User.current.id)
|
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)
|
||||||
|
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 #学生 && 关闭匿评 未提交作品之前列表为空,提交了作品看到所有的
|
||||||
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)
|
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)
|
||||||
|
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
|
||||||
|
@ -500,8 +603,9 @@ class StudentWorkController < ApplicationController
|
||||||
if params[:student_path]
|
if params[:student_path]
|
||||||
redirect_to student_work_index_url(:homework => @homework.id)
|
redirect_to student_work_index_url(:homework => @homework.id)
|
||||||
else
|
else
|
||||||
@user_activity_id = params[:user_activity_id]
|
@user_activity_id = params[:user_activity_id].to_i
|
||||||
@is_in_course = params[:is_in_course]
|
@is_in_course = params[:is_in_course].to_i
|
||||||
|
@course_activity = params[:course_activity].to_i
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
|
@ -539,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
|
||||||
|
@ -736,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]
|
||||||
#
|
#
|
||||||
|
|
|
@ -104,6 +104,15 @@ class WordsController < ApplicationController
|
||||||
@user = User.find(@journal_destroyed.jour_id)
|
@user = User.find(@journal_destroyed.jour_id)
|
||||||
@jours_count = @user.journals_for_messages.where('m_parent_id IS NULL').count
|
@jours_count = @user.journals_for_messages.where('m_parent_id IS NULL').count
|
||||||
@is_user = true
|
@is_user = true
|
||||||
|
elsif @journal_destroyed.jour_type == 'HomeworkCommon'
|
||||||
|
@homework = HomeworkCommon.find @journal_destroyed.jour_id
|
||||||
|
if params[:user_activity_id]
|
||||||
|
@user_activity_id = params[:user_activity_id]
|
||||||
|
else
|
||||||
|
@user_activity_id = -1
|
||||||
|
end
|
||||||
|
@is_in_course = params[:is_in_course].to_i
|
||||||
|
@course_activity = params[:course_activity].to_i
|
||||||
end
|
end
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
|
|
|
@ -1946,6 +1946,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
|
||||||
|
@ -2447,18 +2449,27 @@ 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")
|
||||||
link_to "提交作品(#{homework.student_works.count})", new_student_work_path(:homework => homework.id),:class => 'c_blue'
|
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'
|
||||||
|
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")
|
||||||
link_to "补交作品(#{homework.student_works.count})", new_student_work_path(:homework => homework.id),:class => 'c_red'
|
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'
|
||||||
|
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 => "开启匿评后不可修改作品"
|
||||||
elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3
|
elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3
|
||||||
link_to "匿评结束", 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 => "作业截止后不可修改作品"
|
||||||
|
@ -2471,6 +2482,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
|
||||||
|
@ -2486,7 +2515,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={})
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
module OrgSubfieldsHelper
|
||||||
|
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,11 +16,11 @@ 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
|
||||||
|
|
||||||
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period, :open_student, :enterprise_name
|
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period, :open_student, :enterprise_name, :is_delete
|
||||||
#belongs_to :project, :class_name => 'Course', :foreign_key => :extra, primary_key: :identifier
|
#belongs_to :project, :class_name => 'Course', :foreign_key => :extra, primary_key: :identifier
|
||||||
belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher,该方法通过tea_id来调用User表
|
belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher,该方法通过tea_id来调用User表
|
||||||
belongs_to :school, :class_name => 'School', :foreign_key => :school_id #定义一个方法school,该方法通过school_id来调用School表
|
belongs_to :school, :class_name => 'School', :foreign_key => :school_id #定义一个方法school,该方法通过school_id来调用School表
|
||||||
|
@ -32,7 +32,7 @@ class Course < ActiveRecord::Base
|
||||||
:conditions => "#{Principal.table_name}.type='Group' OR (#{Principal.table_name}.type='User' AND #{Principal.table_name}.status=#{Principal::STATUS_ACTIVE})"
|
:conditions => "#{Principal.table_name}.type='Group' OR (#{Principal.table_name}.type='User' AND #{Principal.table_name}.status=#{Principal::STATUS_ACTIVE})"
|
||||||
has_many :principals, :through => :member_principals, :source => :principal
|
has_many :principals, :through => :member_principals, :source => :principal
|
||||||
has_many :users, :through => :members
|
has_many :users, :through => :members
|
||||||
has_many :org_courses
|
has_many :org_courses, :dependent => :destroy
|
||||||
has_many :organizations, :through => :org_courses
|
has_many :organizations, :through => :org_courses
|
||||||
# has_many :homeworks, :through => :homework_for_courses, :source => :bid, :dependent => :destroy
|
# has_many :homeworks, :through => :homework_for_courses, :source => :bid, :dependent => :destroy
|
||||||
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
|
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
|
||||||
|
@ -86,7 +86,8 @@ class Course < ActiveRecord::Base
|
||||||
'is_public',
|
'is_public',
|
||||||
'description',
|
'description',
|
||||||
'class_period',
|
'class_period',
|
||||||
'open_student'
|
'open_student',
|
||||||
|
'is_delete'
|
||||||
|
|
||||||
acts_as_customizable
|
acts_as_customizable
|
||||||
|
|
||||||
|
@ -94,7 +95,7 @@ class Course < ActiveRecord::Base
|
||||||
scope :active, lambda { where(:status => STATUS_ACTIVE) }
|
scope :active, lambda { where(:status => STATUS_ACTIVE) }
|
||||||
scope :status, lambda {|arg| where(arg.blank? ? nil : {:status => arg.to_i}) }
|
scope :status, lambda {|arg| where(arg.blank? ? nil : {:status => arg.to_i}) }
|
||||||
scope :all_public, lambda { where(:is_public => true) }
|
scope :all_public, lambda { where(:is_public => true) }
|
||||||
scope :visible, lambda {|*args| where(Course.visible_condition(args.shift || User.current, *args)) }
|
scope :visible, lambda {|*args| where(Course.where("is_delete =?", 0).visible_condition(args.shift || User.current, *args)) }
|
||||||
scope :allowed_to, lambda {|*args|
|
scope :allowed_to, lambda {|*args|
|
||||||
user = User.current
|
user = User.current
|
||||||
permission = nil
|
permission = nil
|
||||||
|
@ -114,7 +115,7 @@ class Course < ActiveRecord::Base
|
||||||
where(" LOWER(name) LIKE :p ", :p => pattern)
|
where(" LOWER(name) LIKE :p ", :p => pattern)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
scope :indexable,lambda { where('is_public = 1') }
|
scope :indexable,lambda { where('is_public = 1 and is_delete = 0') }
|
||||||
def self.search(query)
|
def self.search(query)
|
||||||
__elasticsearch__.search(
|
__elasticsearch__.search(
|
||||||
{
|
{
|
||||||
|
@ -399,12 +400,12 @@ class Course < ActiveRecord::Base
|
||||||
# __elasticsearch__.delete_document
|
# __elasticsearch__.delete_document
|
||||||
# end
|
# end
|
||||||
def create_course_ealasticsearch_index
|
def create_course_ealasticsearch_index
|
||||||
if self.is_public == 1
|
if self.is_public == 1 and self.is_delete == 0 #公开 和 没有被删除的课程才被索引
|
||||||
self.__elasticsearch__.index_document
|
self.__elasticsearch__.index_document
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
def update_course_ealasticsearch_index
|
def update_course_ealasticsearch_index
|
||||||
if self.is_public == 1 #如果是初次更新成为公开的情况,会报错,那么这条记录尚未被索引过。没有报错就是更新的其他属性
|
if self.is_public == 1 and self.is_delete == 0 #如果是初次更新成为公开或者恢复被删除的情况,会报错,那么这条记录尚未被索引过。没有报错就是更新的其他属性
|
||||||
begin
|
begin
|
||||||
self.__elasticsearch__.update_document
|
self.__elasticsearch__.update_document
|
||||||
rescue => e
|
rescue => e
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
class EditorOfDocument < ActiveRecord::Base
|
||||||
|
belongs_to :user, :class_name => 'User', :foreign_key => 'editor_id'
|
||||||
|
belongs_to :org_document_comment
|
||||||
|
end
|
|
@ -46,18 +46,24 @@ class ForgeActivity < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_org_activity
|
def add_org_activity
|
||||||
if self.forge_act_type == 'Message' && !self.forge_act.parent_id.nil?
|
org_activity = OrgActivity.where("org_act_type = '#{self.forge_act_type.to_s}' and org_act_id = #{self.forge_act_id}").first
|
||||||
org_activity = OrgActivity.where("org_act_type = 'Message' and org_act_id = #{self.forge_act.parent.id}").first
|
if org_activity
|
||||||
org_activity.created_at = self.created_at
|
org_activity.created_at = self.created_at
|
||||||
org_activity.save
|
org_activity.save
|
||||||
else
|
else
|
||||||
OrgActivity.create(:user_id => self.user_id,
|
if self.forge_act_type == 'Message' && !self.forge_act.parent_id.nil?
|
||||||
:org_act_id => self.forge_act_id,
|
org_activity = OrgActivity.where("org_act_type = 'Message' and org_act_id = #{self.forge_act.parent.id}").first
|
||||||
:org_act_type => self.forge_act_type,
|
org_activity.created_at = self.created_at
|
||||||
:container_id => self.project_id,
|
org_activity.save
|
||||||
:container_type => 'Project',
|
else
|
||||||
:created_at => self.created_at,
|
OrgActivity.create(:user_id => self.user_id,
|
||||||
:updated_at => self.updated_at)
|
:org_act_id => self.forge_act_id,
|
||||||
|
:org_act_type => self.forge_act_type,
|
||||||
|
:container_id => self.project_id,
|
||||||
|
:container_type => 'Project',
|
||||||
|
:created_at => self.created_at,
|
||||||
|
:updated_at => self.updated_at)
|
||||||
|
end
|
||||||
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
|
|
@ -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')
|
||||||
|
@ -203,6 +265,22 @@ class Memo < ActiveRecord::Base
|
||||||
# Author lizanle
|
# Author lizanle
|
||||||
# Description 从硬盘上删除资源
|
# Description 从硬盘上删除资源
|
||||||
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
|
||||||
|
|
||||||
|
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
|
end
|
||||||
|
|
|
@ -186,7 +186,7 @@ class Message < ActiveRecord::Base
|
||||||
# Description
|
# Description
|
||||||
def act_as_forge_activity
|
def act_as_forge_activity
|
||||||
# 如果project为空,那么就是课程相关的消息
|
# 如果project为空,那么就是课程相关的消息
|
||||||
if !self.board.project.nil?
|
if !self.board.project.nil? && self.parent_id.nil?
|
||||||
self.forge_acts << ForgeActivity.new(:user_id => self.author_id,
|
self.forge_acts << ForgeActivity.new(:user_id => self.author_id,
|
||||||
:project_id => self.board.project.id)
|
:project_id => self.board.project.id)
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@ class OrgDocumentComment < ActiveRecord::Base
|
||||||
include Redmine::SafeAttributes
|
include Redmine::SafeAttributes
|
||||||
belongs_to :organization
|
belongs_to :organization
|
||||||
belongs_to :creator, :class_name => 'User', :foreign_key => 'creator_id'
|
belongs_to :creator, :class_name => 'User', :foreign_key => 'creator_id'
|
||||||
|
has_many :editor_of_documents, :dependent => :destroy
|
||||||
acts_as_tree :order => "#{OrgDocumentComment.table_name}.sticky asc, #{OrgDocumentComment.table_name}.created_at desc"
|
acts_as_tree :order => "#{OrgDocumentComment.table_name}.sticky asc, #{OrgDocumentComment.table_name}.created_at desc"
|
||||||
has_many :org_acts, :class_name => 'OrgActivity',:as =>:org_act ,:dependent => :destroy
|
has_many :org_acts, :class_name => 'OrgActivity',:as =>:org_act ,:dependent => :destroy
|
||||||
after_create :document_save_as_org_activity
|
after_create :document_save_as_org_activity
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
class OrgSubfield < ActiveRecord::Base
|
||||||
|
belongs_to :organization, :foreign_key => :organization_id
|
||||||
|
has_many :org_document_comments, :dependent => :destroy
|
||||||
|
has_many :files
|
||||||
|
acts_as_attachable
|
||||||
|
|
||||||
|
def project
|
||||||
|
end
|
||||||
|
end
|
|
@ -5,7 +5,8 @@ class Organization < ActiveRecord::Base
|
||||||
has_many :projects,:through => :org_projects
|
has_many :projects,:through => :org_projects
|
||||||
has_many :courses, :through => :org_courses
|
has_many :courses, :through => :org_courses
|
||||||
has_many :org_document_comments, :dependent => :destroy
|
has_many :org_document_comments, :dependent => :destroy
|
||||||
has_many :org_courses
|
has_many :org_courses, :dependent => :destroy
|
||||||
|
has_many :org_subfields, :dependent => :destroy
|
||||||
has_many :users, :through => :org_members
|
has_many :users, :through => :org_members
|
||||||
validates_uniqueness_of :name
|
validates_uniqueness_of :name
|
||||||
after_create :save_as_org_activity
|
after_create :save_as_org_activity
|
||||||
|
|
|
@ -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)},
|
||||||
|
@ -226,7 +227,7 @@ class User < Principal
|
||||||
validates_uniqueness_of :login, :if => Proc.new { |user| user.login_changed? && user.login.present? }, :case_sensitive => false
|
validates_uniqueness_of :login, :if => Proc.new { |user| user.login_changed? && user.login.present? }, :case_sensitive => false
|
||||||
validates_uniqueness_of :mail, :if => Proc.new { |user| user.mail_changed? && user.mail.present? }, :case_sensitive => false
|
validates_uniqueness_of :mail, :if => Proc.new { |user| user.mail_changed? && user.mail.present? }, :case_sensitive => false
|
||||||
# Login must contain letters, numbers, underscores only
|
# Login must contain letters, numbers, underscores only
|
||||||
validates_format_of :login, :with => /\A[a-z0-9_\-@\.]*\z/i
|
validates_format_of :login, :with => /\A[a-z0-9_\-\.]*\z/i
|
||||||
validates_length_of :login, :maximum => LOGIN_LENGTH_LIMIT
|
validates_length_of :login, :maximum => LOGIN_LENGTH_LIMIT
|
||||||
validates_length_of :firstname, :maximum => 30
|
validates_length_of :firstname, :maximum => 30
|
||||||
validates_length_of :lastname, :maximum => 30
|
validates_length_of :lastname, :maximum => 30
|
||||||
|
|
|
@ -235,6 +235,15 @@ class UsersService
|
||||||
if @current_user.check_password?(params[:password])
|
if @current_user.check_password?(params[:password])
|
||||||
@current_user.password, @current_user.password_confirmation = params[:new_password], params[:new_password_confirmation]
|
@current_user.password, @current_user.password_confirmation = params[:new_password], params[:new_password_confirmation]
|
||||||
@current_user.save
|
@current_user.save
|
||||||
|
# 修改密码同步gitlab密码修改
|
||||||
|
unless @current_user.gid.nil?
|
||||||
|
begin
|
||||||
|
g = Gitlab.client
|
||||||
|
g.edit_user(@current_user.gid, :password => params[:new_password])
|
||||||
|
rescue Exception => e
|
||||||
|
logger.error "change users password failed! ===> #{e}"
|
||||||
|
end
|
||||||
|
end
|
||||||
#raise @current_user.errors.full_message
|
#raise @current_user.errors.full_message
|
||||||
#return @current_user
|
#return @current_user
|
||||||
else
|
else
|
||||||
|
|
|
@ -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,3 +1,6 @@
|
||||||
|
<% if @course %>
|
||||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||||
|
<% else %>
|
||||||
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'projects/project_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||||
|
<% end %>
|
||||||
init_activity_KindEditor_data('<%= @user_activity_id%>',"","87%", "UserActivity");
|
init_activity_KindEditor_data('<%= @user_activity_id%>',"","87%", "UserActivity");
|
||||||
|
|
|
@ -30,14 +30,14 @@
|
||||||
</div>
|
</div>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div nhname='new_message_' style="display:none;">
|
<div nhname='new_message_' style="display:none;">
|
||||||
<%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_course_message'},:method => "post") do |f|%>
|
<%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_course_message'}, :html=>{:id => "course_feedback_new"},:method => "post") do |f|%>
|
||||||
<%= 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' %>
|
||||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" nhname='new_message_textarea_' name="new_form[course_message]"></textarea>
|
<textarea placeholder="有问题或有建议,请直接给我留言吧!" nhname='new_message_textarea_' name="new_form[course_message]"></textarea>
|
||||||
<p nhname='contentmsg_'></p>
|
<p nhname='contentmsg_'></p>
|
||||||
<div nhname='toolbar_container_' style="float:left;padding-top:3px;margin-bottom: 15px;"></div>
|
<div nhname='toolbar_container_' style="float:left;padding-top:3px;margin-bottom: 15px;"></div>
|
||||||
<a id="new_message_cancel_btn_" href="javascript:void(0)" class="grey_btn fr mt10">取消</a>
|
<a id="new_message_cancel_btn_" href="javascript:void(0)" class="grey_btn fr mt10">取消</a>
|
||||||
<a id="new_message_submit_btn_" href="javascript:void(0)" class="blue_btn fr ml10 mt10">留言</a>
|
<a href="javascript:void(0);" class="blue_btn fr ml10 mt10" id="submit_feedback_course" >留言</a>
|
||||||
<% end%>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -53,7 +53,11 @@
|
||||||
<div style="display:none;"><a href="#" id="nhjump"></a></div>
|
<div style="display:none;"><a href="#" id="nhjump"></a></div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
|
||||||
|
$(function(){
|
||||||
|
$("#submit_feedback_course").one('click',function() {
|
||||||
|
$("#course_feedback_new").submit();
|
||||||
|
});
|
||||||
KindEditor.ready(function(K){
|
KindEditor.ready(function(K){
|
||||||
$("a[nhname='reply_btn']").live('click',function(){
|
$("a[nhname='reply_btn']").live('click',function(){
|
||||||
var params = {};
|
var params = {};
|
||||||
|
@ -86,4 +90,5 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,6 +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 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),
|
||||||
|
|
|
@ -12,3 +12,4 @@
|
||||||
<%= render :partial => 'course_teacher', :locals => {:members => @members} %>
|
<%= render :partial => 'course_teacher', :locals => {:members => @members} %>
|
||||||
<% end%>
|
<% end%>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -88,6 +88,15 @@
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
<% if @course.is_delete == 1 %>
|
||||||
|
<div class="mt30"><%=link_to "恢复该课程", renew_course_path(@course) %></div>
|
||||||
|
<% else %>
|
||||||
|
<div class="mt30">
|
||||||
|
<img src="/images/pic_del.gif" class="mr5"><%=link_to "删除该课程", course_path(@course), :method => :delete, :confirm=>"确认要删除该课程吗?" %>
|
||||||
|
<span>(友情提示:删除该课程后如果您想恢复该课程,请联系系统管理员!)</span>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="hwork_undis" id="tbc_02">
|
<div class="hwork_undis" id="tbc_02">
|
||||||
|
|
|
@ -33,6 +33,19 @@
|
||||||
}).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").on('click',show_result);
|
||||||
|
<% else %>
|
||||||
|
$("#show_student_result_div").attr("title","截止日期未到,暂不能查看学生答题结果");
|
||||||
|
$("#student_name_id").attr("title","截止日期未到,暂不能查看学生答题结果");
|
||||||
|
$("#student_id_id").attr("title","截止日期未到,暂不能查看学生答题结果");
|
||||||
|
$("#student_class_id").attr("title","截止日期未到,暂不能查看学生答题结果");
|
||||||
|
<% end %>
|
||||||
|
});
|
||||||
|
function show_result() {
|
||||||
|
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 +53,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" 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_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_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_id">
|
||||||
--
|
--
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -63,7 +70,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 %>
|
||||||
|
|
|
@ -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>
|
||||||
|
|
||||||
|
|
|
@ -119,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,4 @@
|
||||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:is_in_course => @is_in_course,:remote=>true}) %>');
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:is_in_course => @is_in_course,:course_activity =>@course_activity,:remote=>true}) %>');
|
||||||
showModal('ajax-modal', '350px');
|
showModal('ajax-modal', '350px');
|
||||||
$('#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;'>" +
|
||||||
|
|
|
@ -18,18 +18,62 @@
|
||||||
<%= 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 -%>
|
||||||
|
<!-- MathJax的配置 -->
|
||||||
|
<script type="text/javascript"
|
||||||
|
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||||
|
</script>
|
||||||
|
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
||||||
|
<script type="text/x-mathjax-config">
|
||||||
|
MathJax.Hub.Config({
|
||||||
|
showMathMenu: false,
|
||||||
|
showMathMenuMSIE: false,
|
||||||
|
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<!--add by huang-->
|
<!--add by huang-->
|
||||||
<body onload="prettyPrint();">
|
<body onload="prettyPrint();">
|
||||||
<div class="navContainer">
|
<div class="orgContainer">
|
||||||
|
<div class="orgNav">
|
||||||
|
<div class="navOrgLogo fl"><a href="javascript:void(0);" onclick="show_homepage(<%= @organization.id %>, <%= @organization.home_id.nil? ? 0 : 1 %>);"><img src="/images/home_logo.png" width="21" height="19" alt="Trustie" class="mt3" /></a></div>
|
||||||
|
<ul>
|
||||||
|
<li class="navOrgMenu fl">
|
||||||
|
<a href="javascript:void(0);" onclick="show_homepage(<%= @organization.id %>, <%= @organization.home_id.nil? ? 0 : 1 %>);" class="linkGrey8 f14">首页</a>
|
||||||
|
<%#= link_to '首页', organization_path(@organization, :show_homepage => 1),:class=>"linkGrey8 f14" %>
|
||||||
|
</li>
|
||||||
<% if User.current.logged? %>
|
<% if User.current.logged? %>
|
||||||
<%= render :partial => 'layouts/logined_header' %>
|
<li class="navOrgMenu fr" id="orgSwitch" style="cursor:pointer;">
|
||||||
|
<span class="orgMenuArrow" id="orgArrow">
|
||||||
|
<ul class="org_login_list" style="display:none;">
|
||||||
|
<li> <%= link_to "个人主页",user_path(User.current), :class => "linkGrey8", :target => "_blank" %></li>
|
||||||
|
<li><%= link_to "退出",logout_organization_path(@organization), :class =>"linkGrey8", :method => 'post', :rel => "nofollow" %></li>
|
||||||
|
<!--<li><%#= link_to "退出",signout_path, :class =>"linkGrey8", :method => 'post', :rel => "nofollow" %></li>-->
|
||||||
|
</ul>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
<li class="navOrgMenu fr" id="orgUser" style="cursor:pointer;"><a href="javascript:void(0);" class="linkGrey8 f14" id="orgUserName"><%= User.current %></a></li>
|
||||||
|
<!--<li class="navOrgMenu fr"><%#=link_to User.current, user_path(User.current), :class => "linkGrey8 f14" %></li>-->
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= render :partial => 'layouts/unlogin_header' %>
|
<li class="navOrgMenu fr"><a href="<%= signin_path(:login=>true) %>" class="linkGrey8 f14">登录</a></li>
|
||||||
|
<li class="navOrgMenu fr"><a href="<%= signin_path(:login=>false) %>" class="linkGrey8 f14 mr15">注册</a></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</ul>
|
||||||
|
<!--<div class="navHomepageProfile">
|
||||||
|
<ul>
|
||||||
|
<li class="homepageProfileMenuIcon"><a href="javascript:void(0);">
|
||||||
|
<div class="mt5 mb8"><img src="images/homepageProfileImage.png" width="40" height="40" /></div>
|
||||||
|
</a>
|
||||||
|
<ul class="topnav_login_list" style="display:none;">
|
||||||
|
<li><a href="javascript:void(0);" class="menuGrey">修改资料</a> </li>
|
||||||
|
<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>
|
||||||
|
<li><a href="javascript:void(0);" class="menuGrey">退出</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="homepageContentContainer">
|
<div class="homepageContentContainer">
|
||||||
<div class="homepageContent">
|
<div class="homepageContent">
|
||||||
|
@ -53,10 +97,12 @@
|
||||||
<!--<div class="orgName fl mb5 f14">组织id:<%#= @organization.id %></div>-->
|
<!--<div class="orgName fl mb5 f14">组织id:<%#= @organization.id %></div>-->
|
||||||
<div class="orgName fl mb5 f14">
|
<div class="orgName fl mb5 f14">
|
||||||
<%= link_to @organization.name, organization_path(@organization.id), :class=>"pr_info_name fl c_dark fb break_word" %>
|
<%= link_to @organization.name, organization_path(@organization.id), :class=>"pr_info_name fl c_dark fb break_word" %>
|
||||||
<% if @organization.is_public? %>
|
<% if User.current.logged? %>
|
||||||
<span class="img_private"><%= l(:label_public)%></span>
|
<% if @organization.is_public? %>
|
||||||
<% else %>
|
<span class="img_private"><%= l(:label_public)%></span>
|
||||||
<span class="img_private"><%= l(:label_private)%></span>
|
<% else %>
|
||||||
|
<span class="img_private"><%= l(:label_private)%></span>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -75,68 +121,24 @@
|
||||||
|
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="f12 fontGrey3">
|
<div class="f12 fontGrey3">
|
||||||
<%= link_to '文章', organization_org_document_comments_path(@organization) %> (
|
<%= link_to '文章', organization_org_document_comments_path(@organization) %>
|
||||||
<%= link_to OrgDocumentComment.where("organization_id =? and parent_id is null", @organization.id).count, organization_org_document_comments_path(@organization), :class => "linkBlue" %>
|
<% if User.current.logged? %>
|
||||||
) |
|
(
|
||||||
<%= link_to '成员', members_organization_path(@organization.id) %> (<%= link_to @organization.org_members.count, members_organization_path(@organization.id), :id => 'org_members_count_id', :class => "linkBlue" %>)
|
<%= link_to OrgDocumentComment.where("organization_id =? and parent_id is null", @organization.id).count, organization_org_document_comments_path(@organization), :class => "linkBlue" %>
|
||||||
|
)
|
||||||
|
<% end %>
|
||||||
|
|
|
||||||
|
<%= link_to '成员', members_organization_path(@organization.id) %>
|
||||||
|
<% if User.current.logged? %>
|
||||||
|
(<%= link_to @organization.org_members.count, members_organization_path(@organization.id), :id => 'org_members_count_id', :class => "linkBlue" %>)
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepageLeftMenuContainer">
|
<div class="homepageLeftMenuContainer" id="sub_field_left_lists">
|
||||||
<div class="homepageLeftMenuBlock">
|
<%= render :partial => "organizations/org_left_subfield_list", :locals => {:organization => @organization} %>
|
||||||
<%= link_to "动态",organization_path(@organization), :class => "homepageMenuText" %>
|
|
||||||
</div>
|
|
||||||
<div class="homepageLeftMenuBlock">
|
|
||||||
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuProjects').slideToggle();">项目</a>
|
|
||||||
<%=link_to "", join_project_menu_organization_path(@organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联项目"%>
|
|
||||||
<!--<div class="courseMenu" id="projectMenu">-->
|
|
||||||
<!--<ul>-->
|
|
||||||
<!--<li class="courseMenuIcon" id="projectMenuIcon">-->
|
|
||||||
<!--<ul class="topnav_course_menu" id="topnav_project_menu" style="line-height:1;">-->
|
|
||||||
<!--<!–<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>–>-->
|
|
||||||
<!--<li>-->
|
|
||||||
<!--<%#= link_to "关联项目",join_project_menu_organization_path(@organization),:remote => true,:class => "menuGrey",:method => "post"%>-->
|
|
||||||
<!--</li>-->
|
|
||||||
<!--</ul>-->
|
|
||||||
<!--</li>-->
|
|
||||||
<!--</ul>-->
|
|
||||||
<!--</div>-->
|
|
||||||
<!--<a href="javascript:void(0);" class="homepageMenuSetting fr" title="关联您的已有项目"></a>-->
|
|
||||||
</div>
|
|
||||||
<div class="homepageLeftMenuCourses borderBottomNone" id="homepageLeftMenuProjects">
|
|
||||||
<ul >
|
|
||||||
<%= render :partial => 'layouts/org_projects',:locals=>{:projects=>@organization.projects.reorder('created_at').uniq.limit(5),:org_id=>@organization.id,:page=>1}%>
|
|
||||||
<!--<%#= @organization.org_projects.each do |p|%>-->
|
|
||||||
<!--<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey"><%#= p.name%></a></li>-->
|
|
||||||
<!--<%# end %>-->
|
|
||||||
<!--<li class="homepageLeftMenuMore"><a href="javascript:void(0);" class="homepageLeftMenuMoreIcon"></a></li>-->
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="homepageLeftMenuBlock">
|
|
||||||
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">课程</a>
|
|
||||||
<%=link_to "", join_course_menu_organization_path(@organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联课程"%>
|
|
||||||
<%#= link_to "关联课程",join_course_menu_organization_path(@organization),:remote => true,:class => "menuGrey",:method => "post"%>
|
|
||||||
<!--<div class="courseMenu" id="courseMenu">-->
|
|
||||||
<!--<ul>-->
|
|
||||||
<!--<li class="courseMenuIcon" id="courseMenuIcon">-->
|
|
||||||
<!--<ul class="topnav_course_menu" id="topnav_course_menu" style="line-height:1;">-->
|
|
||||||
<!--<!–<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>–>-->
|
|
||||||
<!--<li>-->
|
|
||||||
<!--<%#= link_to "关联课程",join_course_menu_organization_path(@organization),:remote => true,:class => "menuGrey",:method => "post"%>-->
|
|
||||||
<!--</li>-->
|
|
||||||
<!--</ul>-->
|
|
||||||
<!--</li>-->
|
|
||||||
<!--</ul>-->
|
|
||||||
<!--</div>-->
|
|
||||||
<!--<a href="javascript:void(0);" class="homepageMenuSetting fr" title="关联您的已有项目"></a>-->
|
|
||||||
</div>
|
|
||||||
<div class="homepageLeftMenuCourses borderBottomNone" id="homepageLeftMenuCourses">
|
|
||||||
<ul >
|
|
||||||
<%= render :partial => 'layouts/org_courses',:locals=>{:courses=>@organization.courses.reorder('created_at').uniq.limit(5),:org_id=>@organization.id,:page=>1}%>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="homepageRight">
|
<div class="homepageRight" style="margin-top:<%= params[:show_homepage].nil? ? '10px':'0px' %>;">
|
||||||
<%= render_flash_messages %>
|
<%= render_flash_messages %>
|
||||||
<%= yield %>
|
<%= yield %>
|
||||||
<%= call_hook :view_layouts_base_content %>
|
<%= call_hook :view_layouts_base_content %>
|
||||||
|
@ -147,7 +149,22 @@
|
||||||
|
|
||||||
<!--页面底部-->
|
<!--页面底部-->
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<%= render :partial => 'layouts/footer' %>
|
<div id="Footer">
|
||||||
|
<div class="footerAboutContainer">
|
||||||
|
<ul class="footerAbout">
|
||||||
|
<li class="fl"><a href="<%= about_us_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"><a href="http://forge.trustie.net/forums/1/memos/1168" class="f_grey mw20" target="_blank">帮助中心</a>|</li>
|
||||||
|
<li class="fl"><a href="<%= forums_path(:reorder_complex=>'desc')%>" class="f_grey mw20" target="_blank">贴吧交流</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
<ul class="copyright mt10">
|
||||||
|
<li class="fl mr30">Copyright © 2007-2015, All Rights Riserved</li>
|
||||||
|
<li>ICP备09019772</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div id="ajax-modal" style="display:none;"></div>
|
<div id="ajax-modal" style="display:none;"></div>
|
||||||
|
|
||||||
|
@ -168,7 +185,33 @@
|
||||||
$("#projectMenu").mouseleave(function(){
|
$("#projectMenu").mouseleave(function(){
|
||||||
$("#topnav_project_menu").hide();
|
$("#topnav_project_menu").hide();
|
||||||
});
|
});
|
||||||
</script>
|
|
||||||
|
function show_homepage(id, has_homepage){
|
||||||
|
if (has_homepage == 1)
|
||||||
|
{
|
||||||
|
window.location.href = "/organizations/" + id + "?show_homepage=1";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
alert("您还未设置首页!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$(document).ready(function(){
|
||||||
|
$("#orgUser,#orgSwitch").click(function(){
|
||||||
|
$(".org_login_list").toggle();
|
||||||
|
if($("#orgArrow").attr("class") == "orgMenuArrow"){
|
||||||
|
$("#orgArrow").attr("class","orgMenuArrow2");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$("#orgArrow").attr("class","orgMenuArrow") ;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if($(".org_login_list").children().click){
|
||||||
|
$(".org_login_list").css("display","none");
|
||||||
|
$("#orgArrow").attr("class","orgMenuArrow");
|
||||||
|
};
|
||||||
|
});
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,127 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<%= stylesheet_link_tag 'pleft','prettify','jquery/jquery-ui-1.9.2','header','new_user','repository','org' %>
|
||||||
|
<%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move','org'%>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<title>组织主页</title>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="description" content="<%= Redmine::Info.app_name %>" />
|
||||||
|
<meta name="keywords" content="issue,bug,tracker" />
|
||||||
|
<%= csrf_meta_tag %>
|
||||||
|
<%= favicon %>
|
||||||
|
<%= javascript_heads %>
|
||||||
|
<%= heads_for_theme %>
|
||||||
|
<link href="css/public.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="css/leftside.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="css/org.css" rel="stylesheet" type="text/css" />
|
||||||
|
<script src="js/jquery-1.3.2.js" type="text/javascript"></script>
|
||||||
|
<script type="text/javascript" src="js/bootstrap.js"></script>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function(){
|
||||||
|
h1 = $(".homepageLeft").height();
|
||||||
|
if ($("#orgMain").height()< h1) {$("#orgMain").height(h1-42);}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="orgContainer">
|
||||||
|
<div class="orgNav">
|
||||||
|
<div class="navOrgLogo fl"><a href="javascript:void(0);"><img src="/images/home_logo.png" width="21" height="19" alt="确实Trustie" class="mt3" /></a></div>
|
||||||
|
<ul>
|
||||||
|
<li class="navOrgMenu fl"><a href="javascript:void(0);" class="linkGrey8 f14">首页</a></li>
|
||||||
|
<li class="navOrgMenu fr"><a href="javascript:void(0);" class="linkGrey8 f14">登录</a></li>
|
||||||
|
<li class="navOrgMenu fr"><a href="javascript:void(0);" class="linkGrey8 f14 mr15">注册</a></li>
|
||||||
|
</ul>
|
||||||
|
<!--<div class="navHomepageProfile">
|
||||||
|
<ul>
|
||||||
|
<li class="homepageProfileMenuIcon"><a href="javascript:void(0);">
|
||||||
|
<div class="mt5 mb8"><img src="images/homepageProfileImage.png" width="40" height="40" /></div>
|
||||||
|
</a>
|
||||||
|
<ul class="topnav_login_list" style="display:none;">
|
||||||
|
<li><a href="javascript:void(0);" class="menuGrey">修改资料</a> </li>
|
||||||
|
<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>
|
||||||
|
<li><a href="javascript:void(0);" class="menuGrey">退出</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="homepageContentContainer">
|
||||||
|
<div class="homepageContent">
|
||||||
|
<div class="homepageLeft">
|
||||||
|
<div class="homepagePortraitContainer">
|
||||||
|
<!--<div class="pr_info_logo fl mr10 mb5">-->
|
||||||
|
|
||||||
|
<div class="pr_info_logo fl fl mr10 mb5" id="homepage_portrait_image">
|
||||||
|
<%= image_tag(url_to_avatar(@organization),width:"60", height: "60", :id=>'nh_user_tx') %>
|
||||||
|
<% if User.current.logged?%>
|
||||||
|
<% if User.current.id == @organization.creator_id %>
|
||||||
|
<div id="edit_org_file_btn" class="none">
|
||||||
|
<div class="homepageEditProfile">
|
||||||
|
<a href="<%= clear_org_avatar_temp_organization_path(@organization) %>" data-remote="true" class="homepageEditProfileIcon"></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end%>
|
||||||
|
</div>
|
||||||
|
<div class="orgName fl mb5 f14">
|
||||||
|
<%= link_to @organization.name, organization_path(@organization.id), :class=>"pr_info_name fl c_dark fb break_word" %>
|
||||||
|
<% if @organization.is_public? %>
|
||||||
|
<span class="img_private"><%= l(:label_public)%></span>
|
||||||
|
<% else %>
|
||||||
|
<span class="img_private"><%= l(:label_private)%></span>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<% if User.current.admin_of_org?(@organization) and params[:show_homepage].nil? %>
|
||||||
|
<a href="<%= setting_organization_path(@organization) %>" class="pr_join_a c_white"><span class="pr_setting"></span>配置</a>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="f12 fontGrey3">
|
||||||
|
<%= link_to '文章', organization_org_document_comments_path(@organization) %> (
|
||||||
|
<%= link_to OrgDocumentComment.where("organization_id =? and parent_id is null", @organization.id).count, organization_org_document_comments_path(@organization), :class => "linkBlue" %>
|
||||||
|
) |
|
||||||
|
<%= link_to '成员', members_organization_path(@organization.id) %> (<%= link_to @organization.org_members.count, members_organization_path(@organization.id), :id => 'org_members_count_id', :class => "linkBlue" %>)
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="homepageLeftMenuContainer" id="sub_field_left_lists">
|
||||||
|
<%= render :partial => "organizations/org_left_subfield_list", :locals => {:organization => @organization} %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="homepageRight" style="margin-top:0px;">
|
||||||
|
<%= render_flash_messages %>
|
||||||
|
<%= yield %>
|
||||||
|
<%= call_hook :view_layouts_base_content %>
|
||||||
|
<div style="clear:both;"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div id="Footer">
|
||||||
|
<div class="footerAboutContainer">
|
||||||
|
<ul class="footerAbout">
|
||||||
|
<li class="fl"><a href="javascript:void:(0);" class=" f_grey mw20" target="_blank">关于我们</a>|</li>
|
||||||
|
<li class="fl"><a href="javascript:void:(0);" class=" f_grey mw20" target="_blank">服务协议</a>|</li>
|
||||||
|
<li class="fl"><a href="javascript:void:(0);" class="f_grey mw20" target="_blank">帮助中心</a>|</li>
|
||||||
|
<li class="fl"><a href="javascript:void:(0);" class=" f_grey mw20" target="_blank">贴吧交流</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
<ul class="copyright mt10">
|
||||||
|
<li class="fl mr30">Copyright © 2007-2015, All Rights Riserved</li>
|
||||||
|
<li>ICP备09019772</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="ajax-modal" style="display:none;"></div>
|
||||||
|
|
||||||
|
<div id="ajax-indicator" style="display:none;">
|
||||||
|
<span><%= l(:label_loading) %></span>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -104,17 +104,17 @@
|
||||||
|
|
||||||
<!--邀请加入-->
|
<!--邀请加入-->
|
||||||
<div class="subNavBox">
|
<div class="subNavBox">
|
||||||
<% if User.current.member_of?(@project) %>
|
<%# if User.current.member_of?(@project) %>
|
||||||
<div class="subNav currentDd currentDt subNav_jiantou" id="expand_tools_expand_invit" nhtype="toggle4cookie" data-id="expand_invit" data-target="#navContent_invit" data-val="expand">
|
<!--<div class="subNav currentDd currentDt subNav_jiantou" id="expand_tools_expand_invit" nhtype="toggle4cookie" data-id="expand_invit" data-target="#navContent_invit" data-val="expand">-->
|
||||||
<%= l(:label_invite)%>
|
<!--<%#= l(:label_invite)%>-->
|
||||||
</div>
|
<!--</div>-->
|
||||||
<ul class="navContent " style="display:block" id="navContent_invit">
|
<!--<ul class="navContent " style="display:block" id="navContent_invit">-->
|
||||||
<li><%= link_to l(:label_invite_new_user), :controller=>"projects", :action=>"invite_members_by_mail", :id => @project %></li>
|
<!--<li><%#= link_to l(:label_invite_new_user), :controller=>"projects", :action=>"invite_members_by_mail", :id => @project %></li>-->
|
||||||
<!--<%# if User.current.allowed_to?(:manage_members, @project) %>-->
|
<!--<!–<%# if User.current.allowed_to?(:manage_members, @project) %>–>-->
|
||||||
<!--<li><%#= link_to l(:label_invite_trustie_user), :controller=>"projects", :action=>"invite_members", :id => @project %></li>-->
|
<!--<li><%#= link_to l(:label_invite_trustie_user), :controller=>"projects", :action=>"invite_members", :id => @project %></li>-->
|
||||||
<!--<%# end %>-->
|
<!--<%# end %>-->
|
||||||
</ul>
|
<!--</ul>-->
|
||||||
<% end %><!--end-->
|
<%# end %><!--end-->
|
||||||
<!--menu 左侧工具栏 -->
|
<!--menu 左侧工具栏 -->
|
||||||
<%#--project_new_type: 1为开发组;2为科研组;3为朋友圈子--%>
|
<%#--project_new_type: 1为开发组;2为科研组;3为朋友圈子--%>
|
||||||
|
|
||||||
|
|
|
@ -147,7 +147,7 @@
|
||||||
<% end%>
|
<% end%>
|
||||||
<% end%>
|
<% end%>
|
||||||
</div>
|
</div>
|
||||||
<% courses = @user.courses.visible.select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5)%>
|
<% courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5)%>
|
||||||
<div class="homepageLeftMenuCourses <%= courses.empty? ? 'none' : ''%>" id="homepageLeftMenuCourses">
|
<div class="homepageLeftMenuCourses <%= courses.empty? ? 'none' : ''%>" id="homepageLeftMenuCourses">
|
||||||
<ul>
|
<ul>
|
||||||
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user, :page => 0} %>
|
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user, :page => 0} %>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<ul style="list-style-type:none; margin:0; padding:0;">
|
<ul style="list-style-type:none; margin:0; padding:0;">
|
||||||
<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_content)%></strong></span>
|
<li style="list-style-type:none; margin:0; padding:0;"><span style="float: left;"><strong><%= l(:mail_issue_content)%></strong></span>
|
||||||
<span style="float: left; width: 526px">
|
<span style="float: left; width: 526px">
|
||||||
<p><%=link_to @author, user_url(@author) %> 发布的作业:<%=link_to @anonymous_comment_close_name, @anonymous_comment_close_url%> <span style="color: red; padding-left: 10px;">已经开启匿评了!</span></p>
|
<p><%=link_to @author, user_url(@author) %> 发布的作业:<%=link_to @anonymous_comment_close_name, @anonymous_comment_close_url%> <span style="color: red; padding-left: 10px;">已经开启匿评了,请您关注!</span></p>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -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>
|
||||||
|
@ -170,7 +170,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="setting_right ">
|
<ul class="setting_right ">
|
||||||
<li><input id="password" name="password" class="w210" type="password" required="true" nh_required="1"></li>
|
<li><input id="password" name="password" class="w210" type="password" required="true" nh_required="1"></li>
|
||||||
<li><input id="new_password" name="new_password" class="w210" type="password" required="true" nh_required="1"><span class="c_red ml5">请输入6-12个字符</span></li>
|
<li><input id="new_password" name="new_password" class="w210" type="password" required="true" nh_required="1"><span class="c_red ml5">请输入8-12个字符</span></li>
|
||||||
<li><input id="new_password_confirmation" name="new_password_confirmation" class="w210" type="password" required="true" nh_required="1"></li>
|
<li><input id="new_password_confirmation" name="new_password_confirmation" class="w210" type="password" required="true" nh_required="1"></li>
|
||||||
<li class="ml2">
|
<li class="ml2">
|
||||||
<a href="javascript:;" id="my_password_form_link" class="blue_btn fl">确认</a>
|
<a href="javascript:;" id="my_password_form_link" class="blue_btn fl">确认</a>
|
||||||
|
|
|
@ -3,19 +3,20 @@
|
||||||
<% end %>
|
<% 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,3 +1,2 @@
|
||||||
|
$("#organization_document_<%= @act.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document,:flag => params[:flag], :act => @act}) %>");
|
||||||
$("#organization_document_<%= @act.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document, :act => @act}) %>");
|
|
||||||
init_activity_KindEditor_data(<%= @act.id %>,"","87%", "<%=@act.class.to_s%>");
|
init_activity_KindEditor_data(<%= @act.id %>,"","87%", "<%=@act.class.to_s%>");
|
|
@ -1,2 +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();
|
||||||
|
<% end %>
|
|
@ -20,7 +20,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div>
|
<div>
|
||||||
<%= form_tag url_for(:controller => 'org_document_comments',:action => 'update', :id => @org_document.id, :flag => @flag),:method => 'put', :id => 'new_org_document_form' do |f| %>
|
<%= form_tag url_for(:controller => 'org_document_comments',:action => 'update', :id => @org_document.id, :flag => @flag, :org_subfield_id => params[:org_subfield_id]),:method => 'put', :id => 'new_org_document_form' do |f| %>
|
||||||
<div class="resources">
|
<div class="resources">
|
||||||
<div>
|
<div>
|
||||||
<input class="postDetailInput fl mr15" style="margin-bottom:15px;" name="org_document_comment[title]" id="document_title" style="resize:none;" onfocus = "$('#org_document_editor').show();" onblur="check_org_title();" value="<%= @org_document.title %>" />
|
<input class="postDetailInput fl mr15" style="margin-bottom:15px;" name="org_document_comment[title]" id="document_title" style="resize:none;" onfocus = "$('#org_document_editor').show();" onblur="check_org_title();" value="<%= @org_document.title %>" />
|
||||||
|
|
|
@ -22,6 +22,6 @@
|
||||||
init_activity_KindEditor_data(<%= OrgActivity.where("org_act_type='OrgDocumentComment'and org_act_id=?", document.id).first.id %>, null, "87%", "OrgActivity");
|
init_activity_KindEditor_data(<%= OrgActivity.where("org_act_type='OrgDocumentComment'and org_act_id=?", document.id).first.id %>, null, "87%", "OrgActivity");
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<%= render :partial => 'organizations/show_org_document', :locals => {:document => document, :act => OrgActivity.where("org_act_type='OrgDocumentComment'and org_act_id=?", document.id).first} %>
|
<%= render :partial => 'organizations/show_org_document', :locals => {:document => document, :act => OrgActivity.where("org_act_type='OrgDocumentComment'and org_act_id=?", document.id).first, :flag => 0} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
|
@ -3,25 +3,38 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function check_org_title(title)
|
function check_org_title()
|
||||||
{
|
{
|
||||||
if($("#document_title").val().trim() == "")
|
if($("#document_title").val().trim() == "")
|
||||||
{
|
{
|
||||||
$("#doc_title_hint").html("<span class='c_red'>标题不能为空</span>").show();
|
$("#doc_title_hint").html("<span class='c_red'>标题不能为空</span>").show();
|
||||||
}
|
return false;
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
$("#doc_title_hint").hide();
|
{
|
||||||
}
|
$("#doc_title_hint").hide();
|
||||||
}
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function create_org_document()
|
||||||
|
{
|
||||||
|
if(check_org_title() == true)
|
||||||
|
{
|
||||||
|
org_document_description_editor.sync();
|
||||||
|
$('#new_org_document_form').submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function cancel_create_org_document(){
|
||||||
|
location.href = document.referrer;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<%= form_tag organization_org_document_comments_path(:organization_id => @organization.id), :id => 'new_org_document_form' do |f| %>
|
<%= form_tag organization_org_document_comments_path(:organization_id => @organization.id, :field_id => params[:field_id]), :id => 'new_org_document_form' do |f| %>
|
||||||
<div class="resources">
|
<div class="resources">
|
||||||
<div>
|
<div>
|
||||||
<textarea class="postDetailInput fl mr15" style="margin-bottom:15px;" name="org_document_comment[title]" id="document_title" style="resize:none;" onfocus = "$('#org_document_editor').show();" onblur="check_org_title();" placeholder="请输入文章标题"></textarea>
|
<textarea class="postDetailInput fl mr15" style="margin-bottom:15px;" name="org_document_comment[title]" id="document_title" style="resize:none;" onfocus = "$('#org_document_editor').show();" placeholder="请输入文章标题"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div id="doc_title_hint"></div>
|
<div id="doc_title_hint"></div>
|
||||||
<div id="org_document_editor" class="mt15" style="display: none">
|
<div id="org_document_editor" class="mt15" >
|
||||||
<div class="mt10">
|
<div class="mt10">
|
||||||
<%= kindeditor_tag 'org_document_comment[content]','', :editor_id => 'org_document_description_editor', :height => "150px" %>
|
<%= kindeditor_tag 'org_document_comment[content]','', :editor_id => 'org_document_description_editor', :height => "150px" %>
|
||||||
</div>
|
</div>
|
||||||
|
@ -32,9 +45,9 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
||||||
<div class="mt5">
|
<div class="mt5">
|
||||||
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="org_document_description_editor.sync();$('#new_org_document_form').submit();">确定</a>
|
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="create_org_document();">确定</a>
|
||||||
<span class="fr mr10 mt3">或</span>
|
<span class="fr mr10 mt3">或</span>
|
||||||
<a href="javascript:void(0);" onclick="$('#org_document_editor').hide(); $('#doc_title_hint').hide();" class="fr mr10 mt3">取消</a>
|
<a href="javascript:void(0);" onclick="cancel_create_org_document();" class="fr mr10 mt3">取消</a>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
<div class="homepagePostDate">
|
<div class="homepagePostDate">
|
||||||
发布时间:<%= format_activity_day(@document.created_at) %> <%= format_time(@document.created_at, false) %></div>
|
发布时间:<%= format_activity_day(@document.created_at) %> <%= format_time(@document.created_at, false) %></div>
|
||||||
<% unless @document.content.blank? %>
|
<% unless @document.content.blank? %>
|
||||||
<div class="homepagePostIntro">
|
<div class="homepagePostIntro" style="width:640px;">
|
||||||
<%= @document.content.html_safe %>
|
<%= @document.content.html_safe %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -50,7 +50,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)) -%>
|
|
@ -0,0 +1,5 @@
|
||||||
|
$("#org_subfield_list").html("");
|
||||||
|
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list',:locals => {:subfields => @organization.org_subfields }) %>");
|
||||||
|
$("#sub_field_left_lists").html("");
|
||||||
|
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
|
||||||
|
$("#subfield_name").val("");
|
|
@ -0,0 +1,4 @@
|
||||||
|
$("#org_subfield_list").html("");
|
||||||
|
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list',:locals => {:subfields => @organization.org_subfields }) %>");
|
||||||
|
$("#sub_field_left_lists").html("");
|
||||||
|
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
|
|
@ -0,0 +1,3 @@
|
||||||
|
$("#subfield_show_<%= @subfield.id %>").html("<%= @subfield.name %>");
|
||||||
|
$("#sub_field_left_lists").html("");
|
||||||
|
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
|
|
||||||
$(".resourcePopupClose").click(function(){
|
$(".resourcePopupClose").click(function(){
|
||||||
|
location.reload();
|
||||||
$(".resourceSharePopup").css("display","none");
|
$(".resourceSharePopup").css("display","none");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -21,11 +22,10 @@
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="resourceSharePopup">
|
<!--<div class="resourceSharePopup">-->
|
||||||
<div>
|
<div>
|
||||||
<div class="relateText fl">请选择关联到组织的课程</div>
|
<div class="relateText fl">请选择关联到组织的课程</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose"></a></div>
|
|
||||||
<div class="fl">
|
<div class="fl">
|
||||||
<%=form_tag url_for(:controller => 'organizations', :action => 'join_courses', :organization_id => organization_id),:method => 'post', :id => 'join_courses_form', :remote => true,:class=>"resourcesSearchBox" do %>
|
<%=form_tag url_for(:controller => 'organizations', :action => 'join_courses', :organization_id => organization_id),:method => 'post', :id => 'join_courses_form', :remote => true,:class=>"resourcesSearchBox" do %>
|
||||||
<input type="text" name="courses" placeholder="搜索您已加入的课程的名称" class="searchCourse" />
|
<input type="text" name="courses" placeholder="搜索您已加入的课程的名称" class="searchCourse" />
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
<div>
|
<div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
<!--</div>-->
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var lastSearchCondition = '';
|
var lastSearchCondition = '';
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
|
|
||||||
$(".resourcePopupClose").click(function(){
|
$(".resourcePopupClose").click(function(){
|
||||||
|
location.reload();
|
||||||
$(".resourceSharePopup").css("display","none");
|
$(".resourceSharePopup").css("display","none");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -21,11 +22,10 @@
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="resourceSharePopup">
|
|
||||||
<div>
|
<div>
|
||||||
<div class="relateText fl">请选择关联到组织的项目</div>
|
<div class="relateText fl">请选择关联到组织的项目</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose"></a></div>
|
|
||||||
<div class="fl">
|
<div class="fl">
|
||||||
<%=form_tag url_for(:controller => 'organizations', :action => 'join_projects', :organization_id => organization_id),:method => 'post', :id => 'join_projects_form', :remote => true,:class=>"resourcesSearchBox" do %>
|
<%=form_tag url_for(:controller => 'organizations', :action => 'join_projects', :organization_id => organization_id),:method => 'post', :id => 'join_projects_form', :remote => true,:class=>"resourcesSearchBox" do %>
|
||||||
<input type="text" name="projects" placeholder="搜索您已加入的项目的名称" class="searchCourse" />
|
<input type="text" name="projects" placeholder="搜索您已加入的项目的名称" class="searchCourse" />
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var lastSearchCondition = '';
|
var lastSearchCondition = '';
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if act.org_act_type == 'OrgDocumentComment' && act.org_act_id != @organization.home_id %>
|
<% if act.org_act_type == 'OrgDocumentComment' && act.org_act_id != @organization.home_id %>
|
||||||
<%= render :partial => 'show_org_document', :locals => {:document => act.org_act, :act => act} %>
|
<%= render :partial => 'show_org_document', :locals => {:document => act.org_act, :act => act, :flag => 2, :org_subfield_id => params[:org_subfield_id]} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if act.container_type == 'Project' %>
|
<% if act.container_type == 'Project' %>
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if org_act_count == 10 %>
|
<% if org_act_count == 10 %>
|
||||||
<div id="show_more_activities" class="loadMore mt10 f_grey">展开更多<%=link_to "", organization_path(org,:page => page.to_i + 1, :type => params[:type]),:id => "more_org_activities_link",:remote => "true",:class => "none" %></div>
|
<div id="show_more_activities" class="loadMore mt10 f_grey">展开更多<%=link_to "", organization_path(org,:page => page.to_i + 1, :show_homepage =>params[:show_homepage],:type => params[:type]),:id => "more_org_activities_link",:remote => "true",:class => "none" %></div>
|
||||||
<%#= link_to "点击展开更多",user_activities_path(@user.id,:type => type,:page => page),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
<%#= link_to "点击展开更多",user_activities_path(@user.id,:type => type,:page => page),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
||||||
<% end%>
|
<% end%>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
<div class="homepageLeftMenuBlock">
|
||||||
|
<%= link_to "动态",organization_path(organization), :class => "homepageMenuText" %>
|
||||||
|
</div>
|
||||||
|
<div class="homepageLeftMenuBlock">
|
||||||
|
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuProjects').slideToggle();">项目</a>
|
||||||
|
<% if User.current.logged? %>
|
||||||
|
<%=link_to "", join_project_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联项目"%>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="homepageLeftMenuCourses" id="homepageLeftMenuProjects" style="display:<%= organization.projects.count == 0?'none':'' %>">
|
||||||
|
<ul >
|
||||||
|
<%= render :partial => 'layouts/org_projects',:locals=>{:projects=>organization.projects.reorder('created_at').uniq.limit(5),:org_id=>organization.id,:page=>1}%>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="homepageLeftMenuBlock">
|
||||||
|
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">课程</a>
|
||||||
|
<% if User.current.logged? %>
|
||||||
|
<%=link_to "", join_course_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联课程"%>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="homepageLeftMenuCourses" id="homepageLeftMenuCourses" style="display:<%= organization.courses.count == 0 ?'none':'' %>">
|
||||||
|
<ul >
|
||||||
|
<%= render :partial => 'layouts/org_courses',:locals=>{:courses=>organization.courses.reorder('created_at').uniq.limit(5),:org_id=>organization.id,:page=>1}%>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<% organization.org_subfields.each do |field| %>
|
||||||
|
<div class="homepageLeftMenuBlock">
|
||||||
|
<% if field.field_type == "Post" %>
|
||||||
|
<%= 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 => "发布帖子"%>
|
||||||
|
<% 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 class="homepageLeftMenuCourses" id="homepageLeftMenuField_<%= field.id %>" style="display:none;">
|
||||||
|
</div>
|
||||||
|
<% end %>
|
|
@ -11,14 +11,10 @@
|
||||||
<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 %>
|
|
||||||
<% else %>
|
|
||||||
<label ><%= h role %></label>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
<!--<br/>-->
|
<!--<br/>-->
|
||||||
|
|
|
@ -0,0 +1,71 @@
|
||||||
|
<div class="resources mt10" id="organization_document_<%= document.id %>">
|
||||||
|
<div class="homepagePostBrief">
|
||||||
|
|
||||||
|
<div class="homepagePostDes" style="width:690px;">
|
||||||
|
|
||||||
|
<div class="homepagePostTitle postGrey"><%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %></div>
|
||||||
|
|
||||||
|
<% unless document.content.blank? %>
|
||||||
|
<div class="homepagePostIntro" >
|
||||||
|
<%= document.content.html_safe %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% if params[:show_homepage].nil? %>
|
||||||
|
<div class="homepagePostDate" style="float:right;">
|
||||||
|
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="homepagePostDate" style="float:right;">
|
||||||
|
最后编辑:<%= User.find(EditorOfDocument.where("org_document_comment_id =?", document.id).order("created_at desc").first.editor_id).realname %>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<!-- <%# if defined?(home_id) %>
|
||||||
|
<div style="float:right;">最后编辑:<%#= User.find() %></div>
|
||||||
|
<%# end %>-->
|
||||||
|
<% if User.current.admin? || User.current.admin_of_org?(Organization.find(document.organization_id)) || User.current.id == document.creator_id %>
|
||||||
|
<div class="homepagePostSetting">
|
||||||
|
<ul>
|
||||||
|
<li class="homepagePostSettingIcon">
|
||||||
|
<ul class="homepagePostSettiongText">
|
||||||
|
<li>
|
||||||
|
<%= form_for('new_form', :url => {:controller => 'organizations', :action => 'cancel_homepage', :id => document.organization_id, :home_id => document.id}, :method => "put", :remote => true) do |f| %>
|
||||||
|
<a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">取消首页</a>
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<%= link_to "编辑首页", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id, :flag => 2), :class => "postOptionLink" %>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<%= link_to "删除首页", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete',
|
||||||
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
|
:remote => true, :class => 'postOptionLink' %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
function expand_reply(container, btnid) {
|
||||||
|
var target = $(container);
|
||||||
|
var btn = $(btnid);
|
||||||
|
if (btn.data('init') == '0') {
|
||||||
|
btn.data('init', 1);
|
||||||
|
btn.html('收起回复');
|
||||||
|
target.show();
|
||||||
|
} else {
|
||||||
|
btn.data('init', 0);
|
||||||
|
btn.html('展开更多');
|
||||||
|
target.hide();
|
||||||
|
target.eq(0).show();
|
||||||
|
target.eq(1).show();
|
||||||
|
target.eq(2).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -8,35 +8,31 @@
|
||||||
<%= link_to User.find(document.creator_id), user_path(document.creator.id), :class => "newsBlue mr15" %>
|
<%= link_to User.find(document.creator_id), user_path(document.creator.id), :class => "newsBlue mr15" %>
|
||||||
TO <%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %>
|
TO <%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %>
|
||||||
|
|
|
|
||||||
<% if document.organization.home_id == document.id %>
|
<span style="color:#269ac9;"><%= document.org_subfield_id.nil? ? "组织文章" :"#{OrgSubfield.find(document.org_subfield_id).name}" %></span>
|
||||||
<span style="color:#269ac9;">首页</span>
|
|
||||||
<% else %>
|
|
||||||
<span style="color:#269ac9;">组织文章</span>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostTitle postGrey"><%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %></div>
|
<div class="homepagePostTitle postGrey"><%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %></div>
|
||||||
<div class="homepagePostDate">
|
<div class="homepagePostDate">
|
||||||
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %></div>
|
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %></div>
|
||||||
<% unless document.content.blank? %>
|
<% unless document.content.blank? %>
|
||||||
<div class="homepagePostIntro">
|
<div class="homepagePostIntro" style="width:640px;">
|
||||||
<%= document.content.html_safe %>
|
<%= document.content.html_safe %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<!-- <%# if defined?(home_id) %>
|
<!-- <%# if defined?(home_id) %>
|
||||||
<div style="float:right;">最后编辑:<%#= User.find() %></div>
|
<div style="float:right;">最后编辑:<%#= User.find() %></div>
|
||||||
<%# end %>-->
|
<%# end %>-->
|
||||||
<% if User.current.admin? || User.current.admin_of_org?(Organization.find(document.organization_id) || User.current.id == document.creator_id) %>
|
<% if User.current.admin? || User.current.admin_of_org?(Organization.find(document.organization_id)) || User.current.id == document.creator_id %>
|
||||||
<div class="homepagePostSetting">
|
<div class="homepagePostSetting">
|
||||||
<ul>
|
<ul>
|
||||||
<li class="homepagePostSettingIcon">
|
<li class="homepagePostSettingIcon">
|
||||||
<ul class="homepagePostSettiongText">
|
<ul class="homepagePostSettiongText">
|
||||||
<li>
|
<li>
|
||||||
<%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => document.organization_id, :home_id => document.id}, :method => "put", :remote => true) do |f| %>
|
<%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => document.organization_id, :home_id => document.id, :show_homepage => 1}, :method => "put", :remote => true) do |f| %>
|
||||||
<a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">设为首页</a>
|
<a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">设为首页</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to "编辑文章", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id, :flag => 0), :class => "postOptionLink" %>
|
<%= link_to "编辑文章", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id, :flag => flag, :org_subfield_id => params[:org_subfield_id] ), :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), :method => 'delete',
|
||||||
|
@ -92,7 +88,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyInputContainer">
|
<div class="homepagePostReplyInputContainer">
|
||||||
<div nhname='new_message_<%= act.id %>' style="display:none;">
|
<div nhname='new_message_<%= act.id %>' style="display:none;">
|
||||||
<%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id, :act_id => act.id), :method => "post", :remote => true) do |f| %>
|
<%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id, :act_id => act.id, :flag => flag), :method => "post", :remote => true) do |f| %>
|
||||||
<input type="hidden" name="org_activity_id" value="<%= act.id %>"/>
|
<input type="hidden" name="org_activity_id" value="<%= act.id %>"/>
|
||||||
<textarea placeholder="有问题或建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= act.id %>' name="org_content"></textarea>
|
<textarea placeholder="有问题或建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= act.id %>' name="org_content"></textarea>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
|
||||||
|
<ul class="orgListRow">
|
||||||
|
<li class="orgListUser fb">已有栏目</li>
|
||||||
|
<li class="orgListUser fb">状态</li>
|
||||||
|
<li class="orgListStatus fb">类型</li>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</ul>
|
||||||
|
<ul class="orgListRow">
|
||||||
|
<li class="orgListUser">动态</li>
|
||||||
|
<li class="orgListUser">默认</li>
|
||||||
|
<li class="orgListStatus">默认</li>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</ul>
|
||||||
|
<ul class="orgListRow">
|
||||||
|
<li class="orgListUser">项目</li>
|
||||||
|
<li class="orgListUser">默认</li>
|
||||||
|
<li class="orgListStatus">默认</li>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</ul>
|
||||||
|
<ul class="orgListRow">
|
||||||
|
<li class="orgListUser">课程</li>
|
||||||
|
<li class="orgListUser">默认</li>
|
||||||
|
<li class="orgListStatus">默认</li>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</ul>
|
||||||
|
<% subfields.each do |field| %>
|
||||||
|
<ul class="orgListRow">
|
||||||
|
<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>
|
||||||
|
<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" %>
|
||||||
|
<a href="javascript:void(0);" class="linkBlue fr mr10" onclick="edit('#subfield_show_<%= field.id %>','#subfield_edit_<%= field.id %>');">编辑</a>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</ul>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function edit(show_id, edit_id){
|
||||||
|
$(show_id).toggle();
|
||||||
|
$(edit_id).toggle();
|
||||||
|
$(edit_id).find('input').focus();
|
||||||
|
$(edit_id).find('input').on('keypress',function(e){
|
||||||
|
if(e.keyCode == 13){
|
||||||
|
this.blur();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
function update_subfield(show_id, edit_id, field_id, input_value) {
|
||||||
|
if ($(show_id).html().trim() != input_value.trim()) {
|
||||||
|
if (confirm('确定修改为' + input_value + "?"))
|
||||||
|
$.ajax({
|
||||||
|
url :"/org_subfields/" + field_id + "?name=" + input_value,
|
||||||
|
type :'put'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
$(show_id).show();
|
||||||
|
$(edit_id).hide();
|
||||||
|
// $(edit_id).focus();
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -0,0 +1 @@
|
||||||
|
window.location.href = "<%= organization_path(@org) %>";
|
|
@ -0,0 +1,108 @@
|
||||||
|
|
||||||
|
<% @nav_dispaly_organization_label = 1
|
||||||
|
@nav_dispaly_forum_label = 1 %>
|
||||||
|
<%= error_messages_for 'organization' %>
|
||||||
|
<div class="organization_r_h02">
|
||||||
|
<h2 class="organization_h2">编辑组织</h2>
|
||||||
|
</div>
|
||||||
|
<div class="ml15 mr15" id="orgContent_1">
|
||||||
|
<!--<div class="orgLogo mb10"><a href="javascript:void(0);"><img src="images/0" width="55" height="55" alt="组织logo" class="mr10 logoBorder fl ml10" /></a>-->
|
||||||
|
<!--<a href="javascript:void(0);" class="logoEnter fl linkGrey4">上传图片</a>-->
|
||||||
|
<%#= form_for( @organization,{:controller => 'organizations',:action => 'update',:id=>@organization,:html=>{:id=>'update_org_form',:method=>'put'}}) do %>
|
||||||
|
<%= labelled_form_for @organization, :html => {:id => "edit_organization_#{@organization.id}"} do |f|%>
|
||||||
|
<%= render :partial=>"new_org_avatar_form",:locals=> {source:@organization} %>
|
||||||
|
<!--<div class="cl"></div>-->
|
||||||
|
<!--</div>-->
|
||||||
|
<div class="orgRow mb10"><span class="c_red">* </span>组织名称:<input type="text" name="organization[name]" id="organization_name" maxlength="100" onblur="check_uniq(<%=@organization.id %>);" onfocus="$('#check_name_hint').hide()" class="orgNameInput" value="<%= @organization.name%>" />
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div style="margin-left: 80px " id="check_name_hint"></div>
|
||||||
|
<div class="orgRow mb10"><span class="ml10">组织描述:</span><textarea type="text" name="organization[description]" class="orgDes" id="org_desc" placeholder="最多3000个汉字(或6000个英文字符)"><%= @organization.description%></textarea>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div style="margin-left: 80px " id="check_desc_hint"></div>
|
||||||
|
<!--<div class="orgRow mb10"><span class="ml10">组织URL:</span>-->
|
||||||
|
<!--<div class="w607 fr">https://-->
|
||||||
|
<!--<input type="text" name="organization[domain]" value="<%= @organization.domain%>" class="orgUrlInput" />-->
|
||||||
|
<!--.trustie.net<a href="javascript:void(0);" class="linkBlue ml15" style="text-decoration:underline;">申请</a>-->
|
||||||
|
<!--<p id="apply_hint"></p></div>-->
|
||||||
|
<!--<!–class="c_green f12" 您的申请已提交,系统会以消息的形式通知您结果 –>-->
|
||||||
|
<!--</div>-->
|
||||||
|
<!--<div class="cl"></div>-->
|
||||||
|
<div class="orgRow mb10 mt5"><span style="margin-left:38px;" >公开 : </span>
|
||||||
|
<input type="checkbox" name="organization[is_public]" <%= @organization.is_public ? 'checked': ''%> class="ml3" />
|
||||||
|
</div>
|
||||||
|
<a href="javascript:void(0);" class="saveBtn ml80 db fl" onclick="update_org(<%=@organization.id %>);">保存</a>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
<% html_title(l(:label_edit_organization)) -%>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function update_org(id){
|
||||||
|
check_uniq(id);
|
||||||
|
if( $checkName){
|
||||||
|
$("#edit_organization_"+id).submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//新建组织
|
||||||
|
//验证组织名称
|
||||||
|
function regex_organization_name()
|
||||||
|
{
|
||||||
|
var name = $.trim($("#organization_name").val());
|
||||||
|
if(name.length == 0)
|
||||||
|
{
|
||||||
|
$("#organization_name_notice").html('<span class="c_red">名字不能为空<span>').show();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$("#organization_name_notice").html('').hide();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var $checkName = false;
|
||||||
|
|
||||||
|
function check_uniq(dom){
|
||||||
|
if($("#organization_name").val().trim() == ""){
|
||||||
|
$("#organization_name_notice").html('<span class="c_red">名字不能为空<span>').show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$.get(
|
||||||
|
'<%= check_uniq_organizations_path%>'+'?org_name='+$("#organization_name").val().trim()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
//提交新建项目
|
||||||
|
function submit_new_organization()
|
||||||
|
{
|
||||||
|
$.get(
|
||||||
|
'<%= check_uniq_organizations_path%>'+'?org_name='+$("#organization_name").val().trim()
|
||||||
|
)
|
||||||
|
if(regex_organization_name() && $checkName)
|
||||||
|
{
|
||||||
|
$("#new_organization").submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function(){
|
||||||
|
$('#organization_new_type').change(function(){
|
||||||
|
var type = $('#organization_new_type').val();
|
||||||
|
if(type == '1'){
|
||||||
|
$(this).next().html("<%= l(:label_type_des_development)%>");
|
||||||
|
}
|
||||||
|
else if(type == '2'){
|
||||||
|
$(this).next().html("<%= l(:label_type_des_research)%>");
|
||||||
|
}
|
||||||
|
else if(type == '3'){
|
||||||
|
$(this).next().html("<%= l(:label_type_des_friend)%>");
|
||||||
|
}
|
||||||
|
// var p1=$(this).children('option:selected').val("研讨模式:面向小组研究,支持任务分工、论坛交流、资源分享等。");//这就是selected的值
|
||||||
|
// var p2=$('#param2').val();//获取本页面其他标签的值
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
$('#topnav_course_menu').hide();
|
$('#topnav_course_menu').hide();
|
||||||
|
|
||||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'join_course_menu', :locals => {:organization_id => @organization.id}) %>');
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'join_course_menu', :locals => {:organization_id => @organization.id}) %>');
|
||||||
$('#ajax-modal').show();
|
showModal('ajax-modal', '320px');
|
||||||
|
$('#ajax-modal').siblings().hide();
|
||||||
|
$('#ajax-modal').before(
|
||||||
|
"<a href='javascript:' onclick='hideModal();location.reload();' class='resourceClose' style='margin-left: 300px;'></a>");
|
||||||
|
//$('#ajax-modal').css('position','absolute')
|
||||||
|
$('#ajax-modal').css("top","").css("left","");
|
||||||
|
$('#ajax-modal').parent().addClass("resourceSharePopup");
|
||||||
|
|
||||||
|
|
|
@ -3,3 +3,4 @@ $("#homepageLeftMenuCourses").append("<ul>");
|
||||||
$("#homepageLeftMenuCourses").append("<%= escape_javascript(render :partial => 'layouts/org_courses',
|
$("#homepageLeftMenuCourses").append("<%= escape_javascript(render :partial => 'layouts/org_courses',
|
||||||
:locals=>{:courses=>@organization.courses.reorder('created_at').uniq.limit(5),:org_id=>@organization.id,:page=> 1}) %>");
|
:locals=>{:courses=>@organization.courses.reorder('created_at').uniq.limit(5),:org_id=>@organization.id,:page=> 1}) %>");
|
||||||
$("#homepageLeftMenuCourses").append("</ul>");
|
$("#homepageLeftMenuCourses").append("</ul>");
|
||||||
|
$("#homepageLeftMenuCourses").show();
|
|
@ -1,3 +1,11 @@
|
||||||
$('#topnav_project_menu').hide();
|
$('#topnav_project_menu').hide();
|
||||||
|
|
||||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'join_project_menu', :locals => {:organization_id => @organization.id}) %>');
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'join_project_menu', :locals => {:organization_id => @organization.id}) %>');
|
||||||
$('#ajax-modal').show();
|
showModal('ajax-modal', '320px');
|
||||||
|
$('#ajax-modal').siblings().hide();
|
||||||
|
$('#ajax-modal').before(
|
||||||
|
"<a href='javascript:' onclick='hideModal();location.reload();' class='resourceClose' style='margin-left: 300px;'></a>");
|
||||||
|
//$('#ajax-modal').css('position','absolute');
|
||||||
|
$('#ajax-modal').css("top","").css("left","");
|
||||||
|
$('#ajax-modal').parent().addClass("resourceSharePopup");
|
||||||
|
|
||||||
|
|
|
@ -3,3 +3,4 @@ $("#homepageLeftMenuProjects").append("<ul>");
|
||||||
$("#homepageLeftMenuProjects").append("<%= escape_javascript(render :partial => 'layouts/org_projects',
|
$("#homepageLeftMenuProjects").append("<%= escape_javascript(render :partial => 'layouts/org_projects',
|
||||||
:locals=>{:projects=>@organization.projects.reorder('created_at').uniq.limit(5),:org_id=>@organization.id,:page=> 1}) %>");
|
:locals=>{:projects=>@organization.projects.reorder('created_at').uniq.limit(5),:org_id=>@organization.id,:page=> 1}) %>");
|
||||||
$("#homepageLeftMenuProjects").append("</ul>");
|
$("#homepageLeftMenuProjects").append("</ul>");
|
||||||
|
$("#homepageLeftMenuProjects").show();
|
|
@ -1,2 +1,2 @@
|
||||||
//location.reload();
|
//location.reload();
|
||||||
window.location.href ='<%= organization_path(@org)%>'
|
window.location.href ='<%= organization_path(@org, :show_homepage => 1)%>';
|
|
@ -2,7 +2,7 @@
|
||||||
function g(o){return document.getElementById(o);}
|
function g(o){return document.getElementById(o);}
|
||||||
function HoverLi(n){
|
function HoverLi(n){
|
||||||
//如果有N个标签,就将i<=N;
|
//如果有N个标签,就将i<=N;
|
||||||
for(var i=1;i<=2;i++){
|
for(var i=1;i<=3;i++){
|
||||||
g('orgSetting_'+i).className='orgSettingOp';
|
g('orgSetting_'+i).className='orgSettingOp';
|
||||||
g('orgContent_'+i).className='undis';}
|
g('orgContent_'+i).className='undis';}
|
||||||
g('orgContent_'+n).className='dis ml15 mr15';
|
g('orgContent_'+n).className='dis ml15 mr15';
|
||||||
|
@ -34,6 +34,7 @@
|
||||||
<ul class="mb10">
|
<ul class="mb10">
|
||||||
<li class="orgSettingOp orgOpActive" id="orgSetting_1" onclick="HoverLi(1);">信息</li>
|
<li class="orgSettingOp orgOpActive" id="orgSetting_1" onclick="HoverLi(1);">信息</li>
|
||||||
<li class="orgSettingOp" id="orgSetting_2" onclick="HoverLi(2);">成员</li>
|
<li class="orgSettingOp" id="orgSetting_2" onclick="HoverLi(2);">成员</li>
|
||||||
|
<li class="orgSettingOp" id="orgSetting_3" onclick="HoverLi(3);">栏目</li>
|
||||||
<li class="orgBorder"></li>
|
<li class="orgBorder"></li>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -45,13 +46,11 @@
|
||||||
<%= render :partial=>"new_org_avatar_form",:locals=> {source:@organization} %>
|
<%= render :partial=>"new_org_avatar_form",:locals=> {source:@organization} %>
|
||||||
<!--<div class="cl"></div>-->
|
<!--<div class="cl"></div>-->
|
||||||
<!--</div>-->
|
<!--</div>-->
|
||||||
<div class="orgRow mb10"><span class="c_red">* </span>组织名称:
|
<div class="orgRow mb10"><span class="c_red">* </span>组织名称:<input type="text" name="organization[name]" id="organization_name" maxlength="100" onblur="check_uniq(<%=@organization.id %>);" onfocus="$('#check_name_hint').hide()" class="orgNameInput" value="<%= @organization.name%>" />
|
||||||
<input type="text" name="organization[name]" id="organization_name" maxlength="100" onblur="check_uniq(<%=@organization.id %>);" onfocus="$('#check_name_hint').hide()" class="orgNameInput" value="<%= @organization.name%>" />
|
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-left: 80px " id="check_name_hint"></div>
|
<div style="margin-left: 80px " id="check_name_hint"></div>
|
||||||
<div class="orgRow mb10"><span class="ml10">组织描述:</span>
|
<div class="orgRow mb10"><span class="ml10">组织描述:</span><textarea type="text" name="organization[description]" class="orgDes" id="org_desc" placeholder="最多3000个汉字(或6000个英文字符)"><%= @organization.description%></textarea>
|
||||||
<textarea type="text" name="organization[description]" class="orgDes" id="org_desc" placeholder="最多3000个汉字(或6000个英文字符)"><%= @organization.description%></textarea>
|
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-left: 80px " id="check_desc_hint"></div>
|
<div style="margin-left: 80px " id="check_desc_hint"></div>
|
||||||
|
@ -106,4 +105,37 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="undis ml15 mr15" id="orgContent_3">
|
||||||
|
<div class="orgMemberList" id="org_subfield_list">
|
||||||
|
<%= render :partial => 'organizations/subfield_list', :locals => {:subfields => @organization.org_subfields } %>
|
||||||
|
</div>
|
||||||
|
<div class="fr orgMemContainer">
|
||||||
|
<div class="orgMemberAdd">
|
||||||
|
<p class="fontBlue fb mb5">新增栏目</p>
|
||||||
|
<%= form_tag url_for(:controller => 'org_subfields', :action => 'create', :organization_id => @organization.id), :id=> 'add_subfield_form',:remote => true do %>
|
||||||
|
<input type="text" id="subfield_name" name="name" placeholder="栏目名称" class="orgAddSearch mb20" />
|
||||||
|
<ul class="orgAddRole">
|
||||||
|
<li class="fontGrey3 fb mb10">栏目类型</li>
|
||||||
|
<li>
|
||||||
|
<input type="radio" id="orgMng" value="Post" name="field_type" checked="checked"/>
|
||||||
|
<label for="orgMng">帖子</label>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<input type="radio" id="orgMeb" value="Resource" name="field_type" />
|
||||||
|
<label for="orgMeb">资源</label>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<a href="javascript:void(0);" class="saveBtn db fl mt10" onclick="add_org_subfield();">确定</a>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
function add_org_subfield(){
|
||||||
|
if ($("#subfield_name").val().trim() != "")
|
||||||
|
$("#add_subfield_form").submit();
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -16,54 +16,56 @@
|
||||||
.homepagePostReplyInputContainer .ke-inline-block {display: none;}
|
.homepagePostReplyInputContainer .ke-inline-block {display: none;}
|
||||||
.homepagePostReplyInputContainer .ke-container {float: left;}
|
.homepagePostReplyInputContainer .ke-container {float: left;}
|
||||||
</style>
|
</style>
|
||||||
|
<% if params[:show_homepage].nil? %>
|
||||||
<div class="homepageRightBanner">
|
<div class="homepageRightBanner">
|
||||||
<div class="NewsBannerName">最新动态</div>
|
<div class="NewsBannerName"><%= @org_subfield.nil? ? "最新动态":"#{@org_subfield.name}" %></div>
|
||||||
<ul class="resourcesSelect">
|
<% if params[:org_subfield_id].nil? %>
|
||||||
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
|
<ul class="resourcesSelect">
|
||||||
<ul class="homepagePostType">
|
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
|
||||||
<li>
|
<ul class="homepagePostType">
|
||||||
<ul class="homepagePostTypeHomework fl">
|
<li>
|
||||||
<li class="f14">课程动态</li>
|
<ul class="homepagePostTypeHomework fl">
|
||||||
<li><%= link_to "作业动态", {:controller => "organizations", :action => "show", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%>
|
<li class="f14">课程动态</li>
|
||||||
<!--<a href="javascript:void(0);" class="homepagePostTypeAssignment postTypeGrey">作业动态</a>--></li>
|
<li><%= link_to "作业动态", {:controller => "organizations", :action => "show", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%>
|
||||||
<li><%= link_to "通知动态", {:controller => "organizations", :action => "show", :type => "course_news"}, :class => "homepagePostTypeNotice postTypeGrey"%>
|
<!--<a href="javascript:void(0);" class="homepagePostTypeAssignment postTypeGrey">作业动态</a>--></li>
|
||||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeNotice postTypeGrey">通知动态</a></li>-->
|
<li><%= link_to "通知动态", {:controller => "organizations", :action => "show", :type => "course_news"}, :class => "homepagePostTypeNotice postTypeGrey"%>
|
||||||
<li><%= link_to "论坛动态", {:controller => "organizations", :action => "show", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
|
<!--<li><a href="javascript:void(0);" class="homepagePostTypeNotice postTypeGrey">通知动态</a></li>-->
|
||||||
<li><%= link_to "问卷动态", {:controller => "organizations", :action => "show", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%>
|
<li><%= link_to "论坛动态", {:controller => "organizations", :action => "show", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
|
||||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
|
<li><%= link_to "问卷动态", {:controller => "organizations", :action => "show", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%>
|
||||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>-->
|
<!--<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
|
||||||
</ul>
|
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>-->
|
||||||
</li>
|
</ul>
|
||||||
<li>
|
</li>
|
||||||
<ul class="homepagePostTypeProject fl">
|
<li>
|
||||||
<li class="f14">项目动态</li>
|
<ul class="homepagePostTypeProject fl">
|
||||||
<li><%= link_to "问题动态", {:controller => "organizations", :action => "show", :type => "project_issue"}, :class => "homepagePostTypeQuestion postTypeGrey"%>
|
<li class="f14">项目动态</li>
|
||||||
<li><%= link_to "论坛动态", {:controller => "organizations", :action => "show", :type => "project_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
|
<li><%= link_to "问题动态", {:controller => "organizations", :action => "show", :type => "project_issue"}, :class => "homepagePostTypeQuestion postTypeGrey"%>
|
||||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuestion postTypeGrey">问题动态</a></li>
|
<li><%= link_to "论坛动态", {:controller => "organizations", :action => "show", :type => "project_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
|
||||||
<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
|
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuestion postTypeGrey">问题动态</a></li>
|
||||||
</ul>
|
<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>-->
|
||||||
</li>
|
</ul>
|
||||||
<li>
|
</li>
|
||||||
<ul class="homepagePostTypeProject fl">
|
<li>
|
||||||
<li class="f14">更多</li>
|
<ul class="homepagePostTypeProject fl">
|
||||||
<li class="mt-4"><%= link_to "组织动态", {:controller => "organizations", :action => "show", :type => "org"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
|
<li class="f14">更多</li>
|
||||||
<li class="mt-4"><%= link_to "全部动态", {:controller => "organizations", :action => "show", :type => nil}, :class =>"homepagePostTypeAll postTypeGrey"%>
|
<li class="mt-4"><%= link_to "组织动态", {:controller => "organizations", :action => "show", :type => "org"}, :class =>"homepagePostTypeMessage postTypeGrey"%>
|
||||||
|
<li class="mt-4"><%= link_to "全部动态", {:controller => "organizations", :action => "show", :type => nil}, :class =>"homepagePostTypeAll postTypeGrey"%>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
<% end %>
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<% end %>
|
||||||
<% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 %>
|
<% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 and params[:org_subfield_id].nil? %>
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
init_activity_KindEditor_data(<%= OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?",@organization.home_id).first.id %>, null, "87%", 'OrgActivity');
|
init_activity_KindEditor_data(<%= OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?",@organization.home_id).first.id %>, null, "87%", 'OrgActivity');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<% act = OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?", @organization.home_id).first %>
|
<% act = OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?", @organization.home_id).first %>
|
||||||
<%= render :partial => 'show_org_document', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id, :act => act} %>
|
<%= render :partial => 'show_home_page', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id, :act => act} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if @org_activities %>
|
<% if @org_activities %>
|
||||||
<%= render :partial => 'organizations/org_activities',
|
<%= render :partial => 'organizations/org_activities',
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
<div class="resources mt10" id="user_activity_<%= user_activity_id %>">
|
||||||
|
<div class="homepagePostBrief">
|
||||||
|
<div class="homepagePostPortrait">
|
||||||
|
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostDes">
|
||||||
|
<div class="homepagePostTo break_word mt-4">
|
||||||
|
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||||
|
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
|
<% end %> TO
|
||||||
|
<%= link_to activity.project.name.to_s+" | 项目附件", project_news_index_path(activity.project), :class => "newsBlue ml15" %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostTitle break_word hidden fl m_w600">
|
||||||
|
<%= link_to format_activity_title("#{l(:label_attachment)}: #{activity.filename}"), {:controller => 'attachments', :action => 'show', :id => activity.id}, :class => "problem_tit fl fb" %>
|
||||||
|
<%#= link_to activity.title.to_s, news_path(activity), :class => "postGrey" %>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="homepagePostDate">
|
||||||
|
发布时间:<%= format_time(activity.created_on) %>
|
||||||
|
</div>
|
||||||
|
<p class="mt5 break_word"><%= textAreailizable act, :description %><br/></p>
|
||||||
|
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id %>">
|
||||||
|
<div id="intro_content_<%= user_activity_id %>">
|
||||||
|
<%#= activity.description.html_safe %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
|
@ -0,0 +1,102 @@
|
||||||
|
<%= javascript_include_tag "/assets/kindeditor/kindeditor", '/assets/kindeditor/pasteimg', "init_activity_KindEditor" %>
|
||||||
|
<style type="text/css">
|
||||||
|
/*回复框*/
|
||||||
|
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-url{background-image:url( /images/public_icon.png )}
|
||||||
|
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:hover{background-position:-79px -671px;width:50px;height:26px;}
|
||||||
|
div.ke-toolbar .ke-outline{border:none;}
|
||||||
|
.ke-inline-block{display: none;}
|
||||||
|
div.ke-container{float:left;}
|
||||||
|
</style>
|
||||||
|
<% unless forge_acts.empty? %>
|
||||||
|
<% forge_acts.each do |activity| -%>
|
||||||
|
<script>
|
||||||
|
function expand_reply(container, btnid) {
|
||||||
|
var target = $(container);
|
||||||
|
var btn = $(btnid);
|
||||||
|
if (btn.data('init') == '0') {
|
||||||
|
btn.data('init', 1);
|
||||||
|
btn.html('收起回复');
|
||||||
|
target.show();
|
||||||
|
} else {
|
||||||
|
btn.data('init', 0);
|
||||||
|
btn.html('展开更多');
|
||||||
|
target.hide();
|
||||||
|
target.eq(0).show();
|
||||||
|
target.eq(1).show();
|
||||||
|
target.eq(2).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
init_activity_KindEditor_data(<%= activity.id%>, null, "87%");
|
||||||
|
showNormalImage('activity_description_<%= activity.id %>');
|
||||||
|
if ($("#intro_content_<%= activity.id %>").height() > 360) {
|
||||||
|
$("#intro_content_show_<%= activity.id %>").show();
|
||||||
|
}
|
||||||
|
$("#intro_content_show_<%= activity.id %>").click(function () {
|
||||||
|
$("#activity_description_<%= activity.id %>").toggleClass("maxh360");
|
||||||
|
$("#activity_description_<%= activity.id%>").toggleClass("lh18");
|
||||||
|
$("#intro_content_show_<%= activity.id %>").hide();
|
||||||
|
$("#intro_content_hide_<%= activity.id %>").show();
|
||||||
|
});
|
||||||
|
$("#intro_content_hide_<%= activity.id %>").click(function () {
|
||||||
|
$("#activity_description_<%= activity.id %>").toggleClass("maxh360");
|
||||||
|
$("#activity_description_<%= activity.id%>").toggleClass("lh18");
|
||||||
|
$("#intro_content_hide_<%= activity.id %>").hide();
|
||||||
|
$("#intro_content_show_<%= activity.id %>").show();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<!--创建-->
|
||||||
|
<% case activity.forge_act_type %>
|
||||||
|
<% when "ProjectCreateInfo" %>
|
||||||
|
<%= render :partial => 'projects/project_create', :locals => {:activity => activity, :user_activity_id => activity.id} %>
|
||||||
|
<!--缺陷动态-->
|
||||||
|
<% when "Issue" %>
|
||||||
|
<%= render :partial => 'users/project_issue', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id} %>
|
||||||
|
|
||||||
|
<!--message -->
|
||||||
|
<% when "Message" %>
|
||||||
|
<%= render :partial => 'users/project_message', :locals => {:activity => activity.forge_act,:user_activity_id =>activity.id} %>
|
||||||
|
<!--new 新闻-->
|
||||||
|
<% when "News" %>
|
||||||
|
<% if !activity.forge_act.nil? and activity.forge_act.project %>
|
||||||
|
<%= render :partial => 'projects/project_news', :locals => {:activity=>activity.forge_act, :user_activity_id=>activity.id} %>
|
||||||
|
<% end %>
|
||||||
|
<!--Attachment -->
|
||||||
|
<% when "Attachment" %>
|
||||||
|
<%= render :partial => 'projects/attachment_acts', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id } %>
|
||||||
|
<!--<div class="problem_main">-->
|
||||||
|
<!--<a class="problem_pic fl"><%#= image_tag(url_to_avatar(activity.user), :width => "42", :height => "42") %></a>-->
|
||||||
|
|
||||||
|
<!--<div class="problem_txt fl mt5 break_word">-->
|
||||||
|
<!--<a class="problem_name fl ">-->
|
||||||
|
<!--<%#= h(e.project) if @project.nil? || @project.id != e.project_id %>-->
|
||||||
|
<!--<%#= link_to h(activity.user), user_path(activity.user_id), :class => "problem_name c_orange fl" %></a><span class="fl"> <%#= l(:label_new_activity) %>-->
|
||||||
|
<!--:</span>-->
|
||||||
|
<%#= link_to format_activity_title("#{l(:label_attachment)}: #{act.filename}"), {:controller => 'attachments', :action => 'show', :id => act.id}, :class => "problem_tit fl fb" %>
|
||||||
|
<!--<br/>-->
|
||||||
|
|
||||||
|
<!--<p class="mt5 break_word"><#%= textAreailizable act, :description %><br/>-->
|
||||||
|
<!--<%#= l :label_create_time %>-->
|
||||||
|
<!--:<%#= format_activity_day(act.created_on) %> <%#= format_time(act.created_on, false) %></p>-->
|
||||||
|
<!--</div>-->
|
||||||
|
<!--<div class="cl"></div>-->
|
||||||
|
<!--</div>-->
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% if forge_acts.count == 10 %>
|
||||||
|
<div id="show_more_forge_activities" class="loadMore mt10 f_grey">展开更多<%= link_to "", project_path(@project.id, :type => type, :page => page), :id => "more_forge_activities_link", :remote => "true", :class => "none" %></div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$("#show_more_forge_activities").mouseover(function () {
|
||||||
|
$("#more_forge_activities_link").click();
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -0,0 +1,38 @@
|
||||||
|
<% project = Project.find(activity.project_id) %>
|
||||||
|
<% user = User.find(project.user_id)%>
|
||||||
|
<div class="resources mt10">
|
||||||
|
<div class="homepagePostBrief">
|
||||||
|
<div class="homepagePostPortrait">
|
||||||
|
<%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_path(user), :alt => "用户头像" %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostDes">
|
||||||
|
<div class="homepagePostTo break_word mt-4">
|
||||||
|
<% if user.try(:realname) == ' ' %>
|
||||||
|
<%= link_to user, user_path(user), :class => "newsBlue mr15" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to user.try(:realname), user_path(user), :class => "newsBlue mr15" %>
|
||||||
|
<% end %>
|
||||||
|
TO
|
||||||
|
<%= link_to project.to_s+" | 项目", project_path(project.id,:host=>Setting.host_course), :class => "newsBlue ml15" %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostTitle break_word" >
|
||||||
|
<%= link_to project.name, project_path(project.id,:host=>Setting.host_course), :class => "postGrey" %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostDate">
|
||||||
|
创建时间:<%= format_time(project.created_on) %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
||||||
|
<ul>
|
||||||
|
<li class="homepagePostSettingIcon">
|
||||||
|
<ul class="homepagePostSettiongText">
|
||||||
|
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||||
|
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||||
|
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -32,7 +32,8 @@
|
||||||
<p nhname="contentmsg"></p>
|
<p nhname="contentmsg"></p>
|
||||||
<div class="fl mt10" style="padding-top:5px;" nhname="toolbar_container"></div>
|
<div class="fl mt10" style="padding-top:5px;" nhname="toolbar_container"></div>
|
||||||
<%#= submit_tag l(:button_leave_meassge), :name => nil , :class => "blue_btn fr mt10 mb10" %>
|
<%#= submit_tag l(:button_leave_meassge), :name => nil , :class => "blue_btn fr mt10 mb10" %>
|
||||||
<%= link_to l(:button_leave_meassge), "javascript:void(0)", :onclick => 'submitProjectFeedback();', :onmouseover => 'submitFocus(this);', :class => 'blue_btn fr mt10 mb10' %>
|
<a href="javascript:void(0);" class="blue_btn fr ml10 mt10" id="submit_feedback_project" >留言</a>
|
||||||
|
<%#= link_to l(:button_leave_meassge), "javascript:void(0)", :onclick => 'submitProjectFeedback();', :onmouseover => 'submitFocus(this);', :class => 'blue_btn fr mt10 mb10' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -46,6 +47,9 @@
|
||||||
<div style="display:none;"><a href="#" id="nhjump"></a></div>
|
<div style="display:none;"><a href="#" id="nhjump"></a></div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
|
$("#submit_feedback_project").one('click',function() {
|
||||||
|
$("#project_feedback_form").submit();
|
||||||
|
});
|
||||||
|
|
||||||
function init_editor(params){
|
function init_editor(params){
|
||||||
params.textarea.removeAttr('placeholder');
|
params.textarea.removeAttr('placeholder');
|
||||||
|
|
|
@ -0,0 +1,106 @@
|
||||||
|
<div class="resources mt10" id="user_activity_<%= user_activity_id %>">
|
||||||
|
<div class="homepagePostBrief">
|
||||||
|
<div class="homepagePostPortrait">
|
||||||
|
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostDes">
|
||||||
|
<div class="homepagePostTo break_word mt-4">
|
||||||
|
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||||
|
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||||
|
<% end %> TO
|
||||||
|
<%= link_to activity.project.name.to_s+" | 项目新闻", project_news_index_path(activity.project), :class => "newsBlue ml15" %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostTitle break_word hidden fl m_w600"> <!--+"(通知标题)"-->
|
||||||
|
<%= link_to activity.title.to_s, news_path(activity), :class => "postGrey" %>
|
||||||
|
</div>
|
||||||
|
<% if activity.sticky == 1%>
|
||||||
|
<span class="sticky_btn_cir ml10">置顶</span>
|
||||||
|
<% end%>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="homepagePostDate">
|
||||||
|
发布时间:<%= format_time(activity.created_on) %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id %>">
|
||||||
|
<div id="intro_content_<%= user_activity_id %>">
|
||||||
|
<%= activity.description.html_safe %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div id="intro_content_show_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||||
|
<div id="intro_content_hide_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% count=activity.comments.count %>
|
||||||
|
<div class="homepagePostReply">
|
||||||
|
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
|
||||||
|
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
|
||||||
|
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">
|
||||||
|
回复(<%= count %>)
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||||
|
<%if count>3 %>
|
||||||
|
<div class="homepagePostReplyBannerMore">
|
||||||
|
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
|
||||||
|
展开更多
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<% replies_all_i = 0 %>
|
||||||
|
<% if count > 0 %>
|
||||||
|
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||||
|
<ul>
|
||||||
|
<% activity.comments.reorder("created_on desc").each do |comment| %>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function(){
|
||||||
|
showNormalImage('reply_content_<%= comment.id %>');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<% replies_all_i = replies_all_i + 1 %>
|
||||||
|
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
|
||||||
|
<div class="homepagePostReplyPortrait">
|
||||||
|
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "用户头像" %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostReplyDes">
|
||||||
|
<div class="homepagePostReplyPublisher mt-4">
|
||||||
|
<% if comment.try(:author).try(:realname) == ' ' %>
|
||||||
|
<%= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
|
||||||
|
<% else %>
|
||||||
|
<%= link_to comment.try(:author).try(:realname), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
|
||||||
|
<% end %>
|
||||||
|
<%= format_time(comment.created_on) %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
|
||||||
|
<%= comment.comments.html_safe %></div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||||
|
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||||
|
<div class="homepagePostReplyInputContainer mb10">
|
||||||
|
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||||
|
<%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%>
|
||||||
|
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||||
|
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment[comments]"></textarea>
|
||||||
|
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
|
||||||
|
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||||
|
<% end%>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -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>
|
||||||
|
|
|
@ -1,114 +1,33 @@
|
||||||
<%= javascript_include_tag "jquery.infinitescroll.js" %>
|
<%#= stylesheet_link_tag 'courses' %>
|
||||||
<div class="project_r_h">
|
<script type="text/javascript">
|
||||||
<h2 class="project_h2"><%= l(:label_activity) %></h2>
|
$(function () {
|
||||||
|
$("#RSide").removeAttr("id");
|
||||||
|
$("#Container").css("width", "1000px");
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<input type="hidden" value="<%= @type %>" name="type" id="user_activities_type">
|
||||||
|
<div class="homepageRight mt0 ml10">
|
||||||
|
<div class="homepageRightBanner">
|
||||||
|
<div class="NewsBannerName">项目动态</div>
|
||||||
|
<ul class="resourcesSelect" class="resourcesSelect">
|
||||||
|
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
|
||||||
|
<ul class="homepagePostType">
|
||||||
|
<li>
|
||||||
|
<ul class="homepagePostTypeHomework fl">
|
||||||
|
<li><%= link_to "全部动态", {:controller => "projects", :action => "show", :type => nil}, :class => "homepagePostTypeAll postTypeGrey" %></li>
|
||||||
|
<li><%= link_to "问题动态", {:controller => "projects", :action => "show", :type => "issue"}, :class => "homepagePostTypeMessage postTypeGrey" %></li>
|
||||||
|
<!--<li><%#= link_to "作业动态", {:controller => "courses", :action => "show", :type => "homework"}, :class => "homepagePostTypeAssignment postTypeGrey" %></li>-->
|
||||||
|
<li><%= link_to "新闻动态", {:controller => "projects", :action => "show", :type => "news"}, :class => "homepagePostTypeNotice postTypeGrey" %></li>
|
||||||
|
<!--<li><%#= link_to "资源库动态", {:controller => "projects", :action => "show", :type => "attachment"}, :class => "homepagePostTypeResource resourcesGrey" %></li>-->
|
||||||
|
<li><%= link_to "讨论区动态", {:controller => "projects", :action => "show", :type => "message"}, :class => "homepagePostTypeForum postTypeGrey" %></li>
|
||||||
|
<!--<li><%#= link_to "问卷动态", {:controller => "courses", :action => "show", :type => "poll"}, :class => "homepagePostTypeQuiz postTypeGrey" %></li>-->
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<!--CONTENT LIST-->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<%= render :partial => "project_activities", :locals => {:forge_acts => @events_pages, :page => 0, :type => @type} %>
|
||||||
</div>
|
</div>
|
||||||
<!--CONTENT LIST-->
|
|
||||||
<% unless @events_pages.empty? %>
|
|
||||||
<% @events_pages.each do |e| -%>
|
|
||||||
<!--创建-->
|
|
||||||
<% if e.forge_act_type == "ProjectCreateInfo"%>
|
|
||||||
<div class="problem_main">
|
|
||||||
<a class="problem_pic fl"><%= image_tag(url_to_avatar(e.user), :width => "42", :height => "42") %></a>
|
|
||||||
<div class="problem_txt fl mt5 break_word">
|
|
||||||
<%= link_to e.user, user_path(e.user), :class => "problem_name c_orange fl" %> <span class="fl"> <%= l(:label_project_create) %> :</span>
|
|
||||||
<%= link_to e.project.name,{} ,:class => "problem_tit fl fb" %></a><br />
|
|
||||||
<p class="mt5"><br /> <%= l :label_create_time %> :<%= format_time(e.project.created_on) %></p>
|
|
||||||
</div>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
<% next if e.forge_act_type.safe_constantize.nil?
|
|
||||||
act = e.forge_act;
|
|
||||||
next if act.nil? %>
|
|
||||||
<!--缺陷动态-->
|
|
||||||
<% if e.forge_act_type == "Issue" %>
|
|
||||||
<div class="problem_main">
|
|
||||||
<a class="problem_pic fl"><%= image_tag(url_to_avatar(act.author), :width => "42", :height => "42") %></a>
|
|
||||||
<div class="problem_txt fl mt5 break_word list_style">
|
|
||||||
<a class="problem_name fl ">
|
|
||||||
<%= h(e.project) if @project.nil? || @project.id != e.project_id %>
|
|
||||||
<%= link_to act.author, user_path(act.author), :class => "problem_name c_orange fl" %><span class="fl"> <%= l(:label_new_activity) %> :</span>
|
|
||||||
<%= link_to format_activity_title("#{act.source_from}##{act.project_issues_index} (#{act.status}): #{act.tracker.name} #{act.subject}"),
|
|
||||||
{:controller => 'issues',
|
|
||||||
:action => 'show',
|
|
||||||
:id => act.id},
|
|
||||||
:class => "problem_tit fl fb " %>
|
|
||||||
</a><br />
|
|
||||||
<p class="mt5 break_word"><%= act.description.html_safe %><br />
|
|
||||||
<%= l :label_activity_time %> :<%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</div>
|
|
||||||
<!--缺陷 jou留言 -->
|
|
||||||
<% elsif e.forge_act_type == "Journal" %>
|
|
||||||
<div class="problem_main">
|
|
||||||
<a class="problem_pic fl"><%= image_tag(url_to_avatar(e.user), :width => "42", :height => "42") %></a>
|
|
||||||
<div class="problem_txt fl mt5 break_word">
|
|
||||||
<a class="problem_name fl ">
|
|
||||||
<%= h(e.project) if @project.nil? || @project.id != e.project_id %>
|
|
||||||
<%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %><span class="fl"> <%= l(:label_new_activity) %> :</span>
|
|
||||||
<%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.project_issues_index}: #{act.issue.subject}"),
|
|
||||||
{:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"}, :class => "problem_tit fl fb" %>
|
|
||||||
</a><br />
|
|
||||||
<p class="mt5 break_word"><%= act.notes.html_safe %><br />
|
|
||||||
<%= l :label_activity_time %> :<%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></p>
|
|
||||||
</div>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</div>
|
|
||||||
<!--message -->
|
|
||||||
<% elsif e.forge_act_type == "Message" %>
|
|
||||||
<div class="problem_main">
|
|
||||||
<a class="problem_pic fl"><%= image_tag(url_to_avatar(e.user), :width => "42", :height => "42") %></a>
|
|
||||||
<div class="problem_txt fl mt5 break_word list_style">
|
|
||||||
<a class="problem_name fl ">
|
|
||||||
<%= h(e.project) if @project.nil? || @project.id != e.project_id %>
|
|
||||||
<%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %></a><span class="fl"> <%= l(:label_new_activity) %> :</span>
|
|
||||||
|
|
||||||
<%= link_to format_activity_title("#{act.board.name}: #{act.subject}"),
|
|
||||||
project_boards_path(@project,:topic_id => act.id),
|
|
||||||
:class => "problem_tit fl fb " %>
|
|
||||||
<br />
|
|
||||||
<p class="mt5 break_word"><%= textAreailizable act,:content %><br />
|
|
||||||
<div class="cl"></div>
|
|
||||||
<%= l :label_create_time %> :<%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></p>
|
|
||||||
</div>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</div>
|
|
||||||
<!--new 新闻-->
|
|
||||||
<% elsif e.forge_act_type == "News" %>
|
|
||||||
<div class="problem_main">
|
|
||||||
<a class="problem_pic fl"><%= image_tag(url_to_avatar(e.user), :width => "42", :height => "42") %></a>
|
|
||||||
<div class="problem_txt fl mt5 break_word list_style">
|
|
||||||
<a class="problem_name fl ">
|
|
||||||
<%= h(e.project) if @project.nil? || @project.id != e.project_id %>
|
|
||||||
<%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %></a><span class="fl"> <%= l(:label_new_activity) %> :</span>
|
|
||||||
<a class="problem_tit fl fb">
|
|
||||||
<% unless act.nil? %>
|
|
||||||
<%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id}, :class => "problem_tit fl fb " %>
|
|
||||||
<% end %>
|
|
||||||
</a><br />
|
|
||||||
<p class="mt5 break_word"><%= textAreailizable act,:description %><br />
|
|
||||||
<%= l :label_create_time %> :<%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></p>
|
|
||||||
</div>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!--Attachment -->
|
|
||||||
<% elsif e.forge_act_type == "Attachment" %>
|
|
||||||
<div class="problem_main">
|
|
||||||
<a class="problem_pic fl"><%= image_tag(url_to_avatar(e.user), :width => "42", :height => "42") %></a>
|
|
||||||
<div class="problem_txt fl mt5 break_word">
|
|
||||||
<a class="problem_name fl ">
|
|
||||||
<%= h(e.project) if @project.nil? || @project.id != e.project_id %>
|
|
||||||
<%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %></a><span class="fl"> <%= l(:label_new_activity) %> :</span>
|
|
||||||
<%= link_to format_activity_title("#{l(:label_attachment)}: #{act.filename}"), {:controller => 'attachments', :action => 'show', :id => act.id}, :class => "problem_tit fl fb" %></a><br />
|
|
||||||
<p class="mt5 break_word"><%= textAreailizable act,:description %><br />
|
|
||||||
<%= l :label_create_time %> :<%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></p>
|
|
||||||
</div>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
<%= paginate @events_pages, :left => 3, :right => 3 %>
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
$("#show_more_forge_activities").replaceWith("<%= escape_javascript( render :partial => 'projects/project_activities',:locals => {:forge_acts => @events_pages, :page => @page,:type => @type} )%>");
|
|
@ -15,20 +15,22 @@
|
||||||
版本库地址:<%= @repos_url %>
|
版本库地址:<%= @repos_url %>
|
||||||
<% else %>
|
<% else %>
|
||||||
版本库地址:<%= h @repository.url %>
|
版本库地址:<%= h @repository.url %>
|
||||||
<% end %>-
|
<% end %>
|
||||||
<!-- added by bai -->
|
<!-- added by bai -->
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= render :partial => 'navigation' %>
|
<%= render :partial => 'navigation' %>
|
||||||
<div class="fl c_grey02 mt5 mr5">克隆网址:</div>
|
<div class="fl c_grey02 mt5 mr5">克隆网址:</div>
|
||||||
<textarea id="copy_rep_content" class="cloneUrl mt5 fl" type="input" placeholder="http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git"><%=@repository.type.to_s=="Repository::Gitlab" ? @repos_url.to_s.lstrip : @repository.url %></textarea>
|
<textarea id="copy_rep_content" class="cloneUrl mt5 fl" type="input" ><%=@repository.type.to_s=="Repository::Gitlab" ? @repos_url.to_s.lstrip : @repository.url %></textarea>
|
||||||
<a href="javascript:void(0);" class="clone_btn mt5" onclick="jsCopy()"><span class="vl_copy" title="点击复制版本库地址"></span></a>
|
<a href="javascript:void(0);" class="clone_btn mt5" onclick="jsCopy()"><span class="vl_copy" title="点击复制版本库地址"></span></a>
|
||||||
<div class="fl mt5 ml15"><a href="javascript:void(0);" class="vl_btn fb" onclick="zip()"><span class="vl_zip"></span>ZIP</a> </div>
|
<div class="fl mt5 ml15"><a href="javascript:void(0);" class="vl_btn fb" onclick="zip()"><span class="vl_zip"></span>ZIP</a> </div>
|
||||||
<!--<div class="fr mt5"><a href="javascript:void(0);" class="vl_btn fb" onclick="zip()"><span class="vl_fork"></span>Fork</a> <span href="javascript:void(0);" class="vl_btn_2 fb">0</span> </div>-->
|
<%# 针对公开项目:用户必须创建了项目,否则用户无法同步 %>
|
||||||
|
<% if User.current.id != @project.user_id %>
|
||||||
<div class="fr mt5"><span class="vl_fork"></span><%= link_to "Fork", :controller => 'repositories', :action => 'forked'%>
|
<div class="fr mt5"><%= link_to "<span class='vl_fork'></span>".html_safe+"Fork", {:controller => 'repositories', :action => 'forked'}, :class=>"vl_btn"%>
|
||||||
<span href="javascript:void(0);" class="vl_btn_2 fb"><%= @project.forked_count.to_i %></span> </div>
|
<span href="javascript:void(0);" class="vl_btn_2 fb"><%= @project.forked_count.to_i %></span>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="recordBanner mt10">
|
<div class="recordBanner mt10">
|
||||||
<% if @changesets && !@changesets.empty? %>
|
<% if @changesets && !@changesets.empty? %>
|
||||||
|
@ -50,12 +52,13 @@
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span class="fr mr5"><font class="fb ml2 mr2 vl_commit">
|
<span class="fr mr5"><font class="fb ml2 mr2 vl_commit">
|
||||||
<%=link_to @changesets_all_count, {: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>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
|
||||||
<!--contextual end-->
|
<!--contextual end-->
|
||||||
|
|
||||||
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
|
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
|
||||||
|
@ -64,14 +67,14 @@
|
||||||
<%# end %>
|
<%# end %>
|
||||||
<%= render :partial => 'dir_list' %>
|
<%= render :partial => 'dir_list' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= render_properties(@properties) %>
|
<%#= render_properties(@properties) %>
|
||||||
|
|
||||||
<!-- 代码修订 -->
|
<!-- 代码修订 -->
|
||||||
<%= render_properties(@properties) %>
|
<%#= render_properties(@properties) %>
|
||||||
|
|
||||||
|
|
||||||
<a href="https://<%=Setting.host_name %>/forums/1/memos/1232" >如何提交代码</a>
|
<a href="https://<%=Setting.host_name %>/forums/1/memos/1232" >如何提交代码</a>
|
||||||
|
</div>
|
||||||
<% content_for :header_tags do %>
|
<% content_for :header_tags do %>
|
||||||
<%= stylesheet_link_tag "scm" %>
|
<%= stylesheet_link_tag "scm" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue