Merge branch 'develop' into cxt_course
Conflicts: app/views/student_work/new.html.erb app/views/users/_user_homework_form.html.erb db/schema.rb public/stylesheets/courses.css
This commit is contained in:
commit
b61a0a98e5
|
@ -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/
|
|
@ -374,6 +374,7 @@ class CoursesController < ApplicationController
|
|||
|
||||
def settings
|
||||
if User.current.allowed_to?(:as_teacher,@course)
|
||||
@select_tab = params[:tab]
|
||||
@issue_custom_fields = IssueCustomField.sorted.all
|
||||
@issue_category ||= IssueCategory.new
|
||||
@member ||= @course.members.new
|
||||
|
|
|
@ -6,6 +6,18 @@ class ExerciseController < ApplicationController
|
|||
include ExerciseHelper
|
||||
|
||||
def index
|
||||
publish_exercises = Exercise.where("publish_time is not null and exercise_status = 1 and publish_time <=?",Time.now)
|
||||
publish_exercises.each do |exercise|
|
||||
exercise.update_column('exercise_status', 2)
|
||||
course = exercise.course
|
||||
course.members.each do |m|
|
||||
exercise.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => 2)
|
||||
end
|
||||
end
|
||||
end_exercises = Exercise.where("end_time <=? and exercise_status = 2",Time.now)
|
||||
end_exercises.each do |exercise|
|
||||
exercise.update_column('exercise_status', 3)
|
||||
end
|
||||
if @course.is_public == 0 && !User.current.member_of_course?(@course)
|
||||
render_403
|
||||
return
|
||||
|
@ -24,6 +36,18 @@ class ExerciseController < ApplicationController
|
|||
end
|
||||
|
||||
def show
|
||||
publish_exercises = Exercise.where("publish_time is not null and exercise_status = 1 and publish_time <=?",Time.now)
|
||||
publish_exercises.each do |exercise|
|
||||
exercise.update_column('exercise_status', 2)
|
||||
course = exercise.course
|
||||
course.members.each do |m|
|
||||
exercise.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => 2)
|
||||
end
|
||||
end
|
||||
end_exercises = Exercise.where("end_time <=? and exercise_status = 2",Time.now)
|
||||
end_exercises.each do |exercise|
|
||||
exercise.update_column('exercise_status', 3)
|
||||
end
|
||||
unless User.current.member_of_course?(@course)
|
||||
render_403
|
||||
return
|
||||
|
@ -316,6 +340,9 @@ class ExerciseController < ApplicationController
|
|||
@exercise.exercise_status = 2
|
||||
@exercise.publish_time = Time.now
|
||||
if @exercise.save
|
||||
@exercise.course.members.each do |m|
|
||||
@exercise.course_messages << CourseMessage.create(:user_id =>m.user_id, :course_id => @exercise.course.id, :viewed => false,:status=>2)
|
||||
end
|
||||
#redirect_to exercise_index_url(:course_id=> @course.id)
|
||||
respond_to do |format|
|
||||
format.js
|
||||
|
@ -331,6 +358,7 @@ class ExerciseController < ApplicationController
|
|||
@exercise.exercise_questions.each do |exercise_question|
|
||||
exercise_question.exercise_answers.destroy_all
|
||||
end
|
||||
@exercise.course_messages.destroy_all
|
||||
@exercise.exercise_users.destroy_all
|
||||
@exercise.exercise_status = 1
|
||||
@exercise.publish_time = nil
|
||||
|
@ -484,6 +512,10 @@ class ExerciseController < ApplicationController
|
|||
@exercise.update_attributes(:show_result => params[:show_result])
|
||||
@exercise.update_attributes(:exercise_status => 2)
|
||||
@exercise.update_attributes(:publish_time => Time.now)
|
||||
course = @exercise.course
|
||||
course.members.each do |m|
|
||||
@exercise.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => 2)
|
||||
end
|
||||
redirect_to exercise_url(@exercise)
|
||||
return
|
||||
elsif @exercise.publish_time > Time.now
|
||||
|
|
|
@ -73,6 +73,7 @@ class MemosController < ApplicationController
|
|||
end
|
||||
end
|
||||
#end
|
||||
format.js
|
||||
format.html { redirect_to back_memo_url, notice: "#{l :label_memo_create_succ}" }
|
||||
format.json { render json: @memo, status: :created, location: @memo }
|
||||
else
|
||||
|
@ -152,6 +153,7 @@ class MemosController < ApplicationController
|
|||
end
|
||||
|
||||
def update
|
||||
@flag = false
|
||||
respond_to do |format|
|
||||
if( #@memo.update_column(:subject, params[:memo][:subject]) &&
|
||||
@memo.update_column(:content, params[:memo][:content]) &&
|
||||
|
@ -159,10 +161,12 @@ class MemosController < ApplicationController
|
|||
@memo.update_column(:lock, params[:memo][:lock]) &&
|
||||
@memo.update_column(:subject,params[:memo][:subject]))
|
||||
@memo.save_attachments(params[:attachments] || (params[:memo] && params[:memo][:uploads]))
|
||||
@memo.save
|
||||
@flag = @memo.save
|
||||
# @memo.root.update_attribute(:updated_at, @memo.updated_at)
|
||||
format.js
|
||||
format.html {redirect_to back_memo_url, notice: "#{l :label_memo_create_succ}"}
|
||||
else
|
||||
format.js
|
||||
format.html { render action: "edit" }
|
||||
format.json { render json: @person.errors, status: :unprocessable_entity }
|
||||
end
|
||||
|
|
|
@ -169,6 +169,11 @@ class MessagesController < ApplicationController
|
|||
course_activity.updated_at = Time.now
|
||||
course_activity.save
|
||||
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
|
||||
if user_activity
|
||||
user_activity.updated_at = Time.now
|
||||
|
|
|
@ -13,7 +13,7 @@ class OrgDocumentCommentsController < ApplicationController
|
|||
@org_document_comment.content = params[:org_document_comment][:content]
|
||||
if @org_document_comment.save
|
||||
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)
|
||||
else
|
||||
redirect_to new_org_document_comment_path(:organization_id => @organization.id)
|
||||
|
@ -36,13 +36,18 @@ class OrgDocumentCommentsController < ApplicationController
|
|||
if @org_document.parent.nil?
|
||||
act = OrgActivity.where("org_act_type='OrgDocumentComment' and org_act_id =?", @org_document.id).first
|
||||
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
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
if params[:flag].to_i == 0
|
||||
redirect_to organization_org_document_comments_path(:organization_id => @org_document.organization.id)
|
||||
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)
|
||||
end
|
||||
end
|
||||
}
|
||||
end
|
||||
|
@ -81,10 +86,10 @@ class OrgDocumentCommentsController < ApplicationController
|
|||
def destroy
|
||||
@org_document_comment = OrgDocumentComment.find(params[:id])
|
||||
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.id == org.id
|
||||
org.home_id == nil
|
||||
end
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
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)
|
||||
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
|
||||
end
|
|
@ -320,9 +320,20 @@ class ProjectsController < ApplicationController
|
|||
@activity.scope_select {|t| !has["show_#{t}"].nil?}
|
||||
=end
|
||||
|
||||
@page = params[:page] ? params[:page].to_i + 1 : 0
|
||||
# 根据私密性,取出符合条件的所有数据
|
||||
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)
|
||||
else
|
||||
@events_pages = ForgeActivity.includes(:project).where("forge_activities.project_id = ? and projects.is_public
|
||||
|
|
|
@ -64,32 +64,53 @@ class RepositoriesController < ApplicationController
|
|||
end
|
||||
|
||||
def forked
|
||||
# 被forked的标识如果不满足单个用户唯一性,则不执行fork
|
||||
if is_sigle_identifier?(User.current, @repository.identifier)
|
||||
# REDO: 那些人有权限forked项目
|
||||
g = Gitlab.client
|
||||
gproject = g.post ("/projects/fork/#{@project.gpid}?user_id=#{User.current.gid}")
|
||||
if gproject
|
||||
copy_project(@project, gproject)
|
||||
end
|
||||
# 如果当前用户已经fork过该项目,不会新fork项目,则跳至已fork的项
|
||||
unless has_forked?(@project, User.current)
|
||||
project = project_from_current_project(@project.id, User.current.id)
|
||||
redirect_to project_path(project)
|
||||
else
|
||||
flash[:notice] = l(:project_gitlab_fork_double_message)
|
||||
redirect_to settings_project_url(@project, :tab => 'repositories')
|
||||
# 单个用户只能拥有一个名字一样的版本库,否则不能fork
|
||||
# if is_sigle_identifier?(User.current, @repository.identifier)
|
||||
# REDO: 那些人有权限forked项目
|
||||
g = Gitlab.client
|
||||
gproject = g.fork(@project.gpid, User.current.gid)
|
||||
if gproject
|
||||
copy_project(@project, gproject)
|
||||
forked_count = @project.forked_count.to_i + 1
|
||||
@project.update_attributes(:forked_count => forked_count)
|
||||
end
|
||||
# else
|
||||
# flash[:notice] = l(:project_gitlab_fork_double_message)
|
||||
# redirect_to settings_project_url(@project, :tab => 'repositories')
|
||||
# end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# 判断用户是否已经fork过该项目
|
||||
def has_forked?(project, user)
|
||||
projects = Project.where("user_id =?", user)
|
||||
projects.map(&:forked_from_project_id).detect{|s| s == @project.id}.nil? ? true : false
|
||||
end
|
||||
|
||||
# 获取当前用户fork过的项目
|
||||
def project_from_current_project(project, user)
|
||||
project = Project.where("user_id =? and forked_from_project_id =?",user, project).first
|
||||
end
|
||||
|
||||
# copy a project for fork
|
||||
def copy_project(project, gproject)
|
||||
def copy_project(tproject, gproject)
|
||||
project = Project.new
|
||||
project.name = @project.name
|
||||
project.is_public = @project.is_public
|
||||
project.status = @project.status
|
||||
project.description = @project.description
|
||||
project.hidden_repo = @project.hidden_repo
|
||||
project.name = tproject.name
|
||||
project.is_public = tproject.is_public
|
||||
project.status = tproject.status
|
||||
project.description = tproject.description
|
||||
project.hidden_repo = tproject.hidden_repo
|
||||
project.user_id = User.current.id
|
||||
project.project_type = 0
|
||||
project.project_new_type = @project.project_new_type
|
||||
project.project_new_type = tproject.project_new_type
|
||||
project.gpid = gproject.id
|
||||
project.forked_from_project_id = tproject.id
|
||||
if project.save
|
||||
r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first
|
||||
m = Member.new(:user => User.current, :roles => [r])
|
||||
|
@ -124,16 +145,16 @@ class RepositoriesController < ApplicationController
|
|||
|
||||
def copy_repository(project, gproject)
|
||||
# 避免
|
||||
if is_sigle_identifier?(project.user_id, gproject.name)
|
||||
# if is_sigle_identifier?(project.user_id, gproject.name)
|
||||
repository = Repository.factory('Git')
|
||||
repository.project_id = project.id
|
||||
repository.type = 'Repository::Gitlab'
|
||||
repository.url = gproject.name
|
||||
repository.identifier = gproject.name
|
||||
repository = repository.save
|
||||
else
|
||||
flash[:notice] = l(:project_gitlab_create_double_message)
|
||||
end
|
||||
# else
|
||||
# flash[:notice] = l(:project_gitlab_create_double_message)
|
||||
# end
|
||||
end
|
||||
|
||||
def newrepo
|
||||
|
|
|
@ -4,7 +4,7 @@ class StudentWorkController < ApplicationController
|
|||
require 'bigdecimal'
|
||||
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_work, :only => [:edit, :update, :show, :destroy, :add_score, :praise_student_work,:retry_work]
|
||||
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 :author_of_work, :only => [:edit, :update, :destroy]
|
||||
before_filter :teacher_of_course, :only => [:student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :set_score_rule, :forbidden_anonymous_comment]
|
||||
|
@ -527,6 +527,18 @@ class StudentWorkController < ApplicationController
|
|||
@course_activity = params[:course_activity].to_i
|
||||
end
|
||||
|
||||
def revise_attachment
|
||||
Attachment.attach_filesex(@work, params[:attachments], params[:attachment_type])
|
||||
revise_attachments = @work.attachments.where("attachtype = 7").reorder("created_on desc")
|
||||
if revise_attachments.count == 2
|
||||
revise_attachments.last.destroy
|
||||
end
|
||||
#@attachment = @work.attachments.where("attachtype = 7").order("created_on desc").first
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def hsd_committed_work?(user, homework)
|
||||
sw = StudentWork.where("user_id =? and homework_common_id =?", user, homework).first
|
||||
|
|
|
@ -92,7 +92,7 @@ class UsersController < ApplicationController
|
|||
end
|
||||
|
||||
# 用户消息
|
||||
# 说明: homework 发布作业;message:讨论区; news:新闻; poll:问卷;works_reviewers:作品评阅;works_reply:作品回复
|
||||
# 说明: homework 发布作业;message:讨论区; news:新闻; poll:问卷;works_reviewers:作品评阅;works_reply:作品回复,exercise:课程测验
|
||||
# issue:问题;journal:缺陷状态更新; forum:公共贴吧: user_feedback: 用户留言; new_reply:新闻回复(comment)
|
||||
def user_messages
|
||||
if !User.current.logged?
|
||||
|
@ -128,7 +128,7 @@ class UsersController < ApplicationController
|
|||
|
||||
#课程相关消息
|
||||
when 'homework'
|
||||
@message_alls = CourseMessage.where("course_message_type in ('HomeworkCommon','StudentWorksScore','JournalsForMessage','StudentWork') and user_id =?", @user).order("created_at desc")
|
||||
@message_alls = CourseMessage.where("course_message_type in ('HomeworkCommon','StudentWorksScore','JournalsForMessage','StudentWork','Exercise') and user_id =?", @user).order("created_at desc")
|
||||
when 'course_message'
|
||||
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Message", @user).order("created_at desc")
|
||||
when 'course_news'
|
||||
|
@ -1438,6 +1438,7 @@ class UsersController < ApplicationController
|
|||
@course = @user.courses
|
||||
.select { |course| @user.allowed_to?(:as_teacher,course)}
|
||||
end
|
||||
@search = params[:search]
|
||||
#这里仅仅是传递需要发送的资源id
|
||||
@send_id = params[:send_id]
|
||||
@send_ids = params[:checkbox1] || params[:send_ids]
|
||||
|
@ -1454,6 +1455,7 @@ class UsersController < ApplicationController
|
|||
else
|
||||
@projects = @user.projects
|
||||
end
|
||||
@search = params[:search]
|
||||
#这里仅仅是传递需要发送的资源id
|
||||
@send_id = params[:send_id]
|
||||
@send_ids = params[:checkbox1] || params[:send_ids] #搜索的时候 和 直接 用表格提交的时候的send_ids
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
module OrgSubfieldsHelper
|
||||
end
|
|
@ -126,4 +126,15 @@ module StudentWorkHelper
|
|||
end
|
||||
type
|
||||
end
|
||||
|
||||
def revise_attachment_status homework, attach
|
||||
date = Time.parse(format_time(attach.created_on.to_s)).strftime("%Y-%m-%d")
|
||||
status = ""
|
||||
if homework.homework_detail_manual && ((homework.anonymous_comment == 0 &&homework.homework_detail_manual.evaluation_start.to_s <= date) || (homework.anonymous_comment == 1 && homework.end_time < date))
|
||||
status = "此时其他同学作品已公开"
|
||||
else
|
||||
status = "此时其他同学作品尚未公开"
|
||||
end
|
||||
return status
|
||||
end
|
||||
end
|
|
@ -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})"
|
||||
has_many :principals, :through => :member_principals, :source => :principal
|
||||
has_many :users, :through => :members
|
||||
has_many :org_courses
|
||||
has_many :org_courses, :dependent => :destroy
|
||||
has_many :organizations, :through => :org_courses
|
||||
# has_many :homeworks, :through => :homework_for_courses, :source => :bid, :dependent => :destroy
|
||||
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
class EditorOfDocument < ActiveRecord::Base
|
||||
belongs_to :user, :class_name => 'User', :foreign_key => 'editor_id'
|
||||
belongs_to :org_document_comment
|
||||
end
|
|
@ -6,4 +6,18 @@ class Exercise < ActiveRecord::Base
|
|||
has_many :exercise_questions, :dependent => :destroy,:order => "#{ExerciseQuestion.table_name}.question_number"
|
||||
has_many :exercise_users, :dependent => :destroy
|
||||
has_many :users, :through => :exercise_users #该测试被哪些用户提交答案过
|
||||
# 课程消息
|
||||
has_many :course_messages, :class_name =>'CourseMessage', :as => :course_message, :dependent => :destroy
|
||||
after_create :acts_as_course_message
|
||||
def acts_as_course_message
|
||||
if self.course
|
||||
if self.exercise_status == 2 #未发布
|
||||
#self.course.members.each do |m|
|
||||
self.course_messages << CourseMessage.create(:user_id => User.current.id, :course_id => self.course_id, :viewed => false,:status=>2)
|
||||
#end
|
||||
# else
|
||||
# self.course_messages.destroy_all 这里的destory_all值得商榷。因为我这里是通过status来控制不同的status的
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -48,8 +48,10 @@ class ForgeActivity < ActiveRecord::Base
|
|||
def add_org_activity
|
||||
if self.forge_act_type == 'Message' && !self.forge_act.parent_id.nil?
|
||||
org_activity = OrgActivity.where("org_act_type = 'Message' and org_act_id = #{self.forge_act.parent.id}").first
|
||||
org_activity.created_at = self.created_at
|
||||
org_activity.save
|
||||
if org_activity
|
||||
org_activity.created_at = self.created_at
|
||||
org_activity.save
|
||||
end
|
||||
else
|
||||
OrgActivity.create(:user_id => self.user_id,
|
||||
:org_act_id => self.forge_act_id,
|
||||
|
|
|
@ -3,7 +3,7 @@ class OrgDocumentComment < ActiveRecord::Base
|
|||
include Redmine::SafeAttributes
|
||||
belongs_to :organization
|
||||
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"
|
||||
has_many :org_acts, :class_name => 'OrgActivity',:as =>:org_act ,:dependent => :destroy
|
||||
after_create :document_save_as_org_activity
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
class OrgSubfield < ActiveRecord::Base
|
||||
belongs_to :organization, :foreign_key => :organization_id
|
||||
end
|
|
@ -5,7 +5,8 @@ class Organization < ActiveRecord::Base
|
|||
has_many :projects,:through => :org_projects
|
||||
has_many :courses, :through => :org_courses
|
||||
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
|
||||
validates_uniqueness_of :name
|
||||
after_create :save_as_org_activity
|
||||
|
|
|
@ -10,6 +10,7 @@ class StudentWork < ActiveRecord::Base
|
|||
has_many :student_work_tests, order: 'id desc'
|
||||
# course's message
|
||||
has_many :course_messages, :class_name =>'CourseMessage', :as => :course_message, :dependent => :destroy
|
||||
has_many :attachments, :dependent => :destroy
|
||||
|
||||
before_destroy :delete_praise
|
||||
before_save :set_program_score, :set_src
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
<% if @is_destroy%>
|
||||
$("#attachment_<%= @attachment.id%>").remove();
|
||||
if(document.getElementById("uploadReviseBox")) {
|
||||
$("#uploadReviseBox").removeClass('disable_link');
|
||||
$("#choose_revise_attach").attr("onclick","_file.click();");
|
||||
}
|
||||
<%else%>
|
||||
var attachment_html_obj = $('#attachments_<%= j params[:attachment_id] %>');
|
||||
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 start
|
||||
|
@ -26,5 +30,10 @@
|
|||
$('#upload_file_count'+containerid).html("<span id=\"count\">"+count+"</span>"+"个文件"+"已上传");
|
||||
}
|
||||
}
|
||||
|
||||
if(document.getElementById("uploadReviseBox")) {
|
||||
$("#uploadReviseBox").removeClass('disable_link');
|
||||
$("#choose_revise_attach").attr("onclick","_file.click();");
|
||||
}
|
||||
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 end
|
||||
<% end%>
|
|
@ -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}) %>");
|
||||
|
||||
<% 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%");
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= @subPage_title%></h2>
|
||||
</div>
|
||||
<% if @subPage_title == l(:label_student_list)%>
|
||||
<%= render :partial => 'course_student', :locals => {:members => @members} %>
|
||||
<% else%>
|
||||
<%= render :partial => 'course_teacher', :locals => {:members => @members} %>
|
||||
<% end%>
|
||||
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2 fl"><%= @subPage_title%></h2>
|
||||
<% if User.current.allowed_to?(:as_teacher,@course) %>
|
||||
<span class="fr f14 fontGrey2" style="height: 40px; line-height: 40px; margin-right: 15px;">
|
||||
<%=link_to "修改角色", :controller => 'courses', :action => 'settings', :id => @course.id, :tab=>'member' %>
|
||||
</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if @subPage_title == l(:label_student_list)%>
|
||||
<%= render :partial => 'course_student', :locals => {:members => @members} %>
|
||||
<% else%>
|
||||
<%= render :partial => 'course_teacher', :locals => {:members => @members} %>
|
||||
<% end%>
|
||||
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= l(:label_course_modify_settings)%></h2>
|
||||
</div>
|
||||
<script>
|
||||
$(function(){
|
||||
<% if @select_tab == 'member'%>
|
||||
$("#tb_2").click();
|
||||
<% end %>
|
||||
})
|
||||
</script>
|
||||
<div class="hwork_new">
|
||||
<div id="tb_" class="hwork_tb_">
|
||||
<ul>
|
||||
|
@ -118,4 +125,4 @@
|
|||
}
|
||||
$("#time_selected").click(select);
|
||||
$("#term_selected").click(select);
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
@ -35,6 +35,5 @@
|
|||
$("#exercise_time").val("<%=exercise.time if exercise.time!= -1 %>");
|
||||
$("#exercise_publish_time").val("<%= Time.parse(format_time(exercise.publish_time)).strftime("%Y-%m-%d") if !exercise.publish_time.nil?%>");
|
||||
/*$("#exercise_description").text("<%#=exercise.exercise_description.html_safe %>");*/
|
||||
document.getElementById("exercise_description").innerHTML = <%=exercise.exercise_description.html_safe %>;
|
||||
}
|
||||
</script>
|
|
@ -16,7 +16,7 @@
|
|||
<div class="postDetailCreater">最后回复:<a href="<%= user_path(author) %>" class="linkBlue2" target="_blank"><%= author.name%></a></div>
|
||||
<div class="postDetailDate"><%= format_date(topic.last_reply.created_at)%></div>
|
||||
<% end%>
|
||||
|
||||
<span class=" fr" style="color: #888888; font-size: 12px;">更新时间:<%= format_date(topic.updated_at)%></span>
|
||||
</div>
|
||||
<div class="postDetailReply">
|
||||
<a href="<%= forum_memo_path(topic.forum, topic)%>" class="postReplyIcon mr5" target="_blank"></a>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="postRightContainer">
|
||||
<div id="create_memo_div" style="display: none">
|
||||
<div id="error" class="red fl mb10" style="display: none">error</div>
|
||||
<%= labelled_form_for(@memo, :url => forum_memos_path(@forum)) do |f| %>
|
||||
<%= labelled_form_for(@memo, :url => forum_memos_path(@forum),:remote=>true) do |f| %>
|
||||
<div>
|
||||
<textarea type="text" name="memo[subject]" id="memo_subject" maxlength="50" onblur="check_memo_name();" onfocus="$('#error').hide();" onmouseover="this.style.borderColor='#d9d9d9'" class="postDetailInput" placeholder="输入帖子标题" ></textarea>
|
||||
<script>
|
||||
|
@ -112,7 +112,21 @@
|
|||
}
|
||||
if($("textarea[name='memo[subject]']").val().trim() != "" && !memo_content.isEmpty() ){
|
||||
memo_content.sync();
|
||||
$("#new_memo").submit();
|
||||
$.ajax({
|
||||
url:'/forums/'+'<%= @forum.id.to_s%>'+'/memos',
|
||||
type:'post',
|
||||
data:{
|
||||
'memo[content]':$("#memo_content").val(),
|
||||
'memo[subject]':$("#memo_subject").val()
|
||||
},
|
||||
success:function(data){
|
||||
|
||||
},
|
||||
error:function(){
|
||||
alert('请检查当前网络连接')
|
||||
}
|
||||
});
|
||||
//$("#new_memo").submit();
|
||||
}else if($("textarea[name='memo[subject]']").val().trim() == "" && memo_content.isEmpty()){
|
||||
$("#error").html("主题和内容不能为空").show();
|
||||
}
|
||||
|
|
|
@ -7,5 +7,5 @@
|
|||
remote: data-remote
|
||||
-%>
|
||||
<li>
|
||||
<%= link_to_unless current_page.last?, t('views.pagination.next').html_safe, url, :rel => 'next', :remote => remote, :class => "next c_blue" %>
|
||||
<%= link_to_unless false, t('views.pagination.next').html_safe, url, :rel => 'next', :remote => remote, :class => "next c_blue" %>
|
||||
</li>
|
||||
|
|
|
@ -208,7 +208,7 @@
|
|||
<div class="cl"></div>
|
||||
<% unless contributor_course_scor(@course.id).count == 0 %>
|
||||
<ul class="rankList">
|
||||
<h4>课程贡献榜</h4>
|
||||
<h4>课程活跃度</h4>
|
||||
<% contributor_course_scor(@course.id).each do |contributor_score| %>
|
||||
<% unless contributor_score.total_score ==0 %>
|
||||
<li> <a href="javascript:void:(0);"><%=link_to image_tag(url_to_avatar(contributor_score.user), :width => "35", :height => "35", :class=> "rankPortrait"),user_path(contributor_score.user) %></a>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<%= favicon %>
|
||||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','application','prettify', 'nyan','leftside', :media => 'all' %>
|
||||
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
|
||||
<%= javascript_heads %>
|
||||
<%= javascript_include_tag('jquery-1.8.3-ui-1.9.2-ujs-2.0.3', 'application', 'jquery.colorbox-min') %>
|
||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' ,'prettify' %>
|
||||
<%= heads_for_theme %>
|
||||
|
||||
|
@ -241,7 +241,8 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div>
|
||||
<div id="ajax-modal" style="display:none;"></div>
|
||||
<div class="cl"></div>
|
||||
<%= render :partial => 'layouts/footer' %>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -23,13 +23,33 @@
|
|||
</head>
|
||||
<!--add by huang-->
|
||||
<body onload="prettyPrint();">
|
||||
<div class="navContainer">
|
||||
<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"> <%= link_to '首页', organization_path(@organization, :show_homepage => 1),:class=>"linkGrey8 f14" %></li>
|
||||
<% if User.current.logged? %>
|
||||
<%= render :partial => 'layouts/logined_header' %>
|
||||
<li class="navOrgMenu fr"><%=link_to User.current, user_path(User.current), :class => "linkGrey8 f14" %></li>
|
||||
<% 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 %>
|
||||
</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="homepageContentContainer">
|
||||
<div class="homepageContent">
|
||||
|
@ -81,62 +101,11 @@
|
|||
<%= 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">
|
||||
<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>
|
||||
<%=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 class="homepageLeftMenuContainer" id="sub_field_left_lists">
|
||||
<%= render :partial => "organizations/org_left_subfield_list", :locals => {:organization => @organization} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepageRight">
|
||||
<div class="homepageRight" style="margin-top:<%= params[:show_homepage].nil? ? '10px':'0px' %>;">
|
||||
<%= render_flash_messages %>
|
||||
<%= yield %>
|
||||
<%= call_hook :view_layouts_base_content %>
|
||||
|
@ -147,7 +116,22 @@
|
|||
|
||||
<!--页面底部-->
|
||||
<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 id="ajax-modal" style="display:none;"></div>
|
||||
|
||||
|
|
|
@ -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>
|
|
@ -12,7 +12,7 @@
|
|||
<%= favicon %>
|
||||
<%= javascript_heads %>
|
||||
<%= heads_for_theme %>
|
||||
<%= stylesheet_link_tag 'public', 'pleft', 'project','prettify','jquery/jquery-ui-1.9.2','header','repository' %>
|
||||
<%= stylesheet_link_tag 'public', 'pleft', 'project','courses','prettify','jquery/jquery-ui-1.9.2','header','repository' %>
|
||||
<%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move','attachments' %>
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<!-- page specific tags -->
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<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>
|
||||
<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>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
window.location.href='<%= forum_memo_path(:forum_id=>@memo.forum_id,:id=>@memo.id ) %>'
|
|
@ -13,7 +13,21 @@
|
|||
return false;
|
||||
}
|
||||
memo_content.sync();
|
||||
$("#edit_memo").submit();
|
||||
$.ajax({
|
||||
url:' /forums/'+'<%= @memo.forum_id.to_s %>'+'/memos/<%= @memo.id.to_s%>',
|
||||
type:'put',
|
||||
data:{
|
||||
'memo[subject]':$("#memo_subject").val(),
|
||||
'memo[content]':$("#memo_content").val()
|
||||
},
|
||||
success:function(data){
|
||||
|
||||
},
|
||||
error:function(){
|
||||
alert('请检查当前网络连接')
|
||||
}
|
||||
});
|
||||
//$("#edit_memo").submit();
|
||||
}else if($("textarea[name='memo[subject]']").val().trim() == "" && !memo_content.isEmpty() ){
|
||||
$("#error").html("主题不能为空").show();
|
||||
}else if($("textarea[name='memo[subject]']").val().trim() != "" && memo_content.isEmpty()){
|
||||
|
|
|
@ -79,6 +79,8 @@
|
|||
<%= render :partial => 'attachments_links', :locals => {:attachments => @memo.attachments, :options => options, :is_float => true} %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<span class=" fr" style="color: #888888; font-size: 12px;">更新时间:<%= format_date(@memo.updated_at)%></span>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<% if @flag%>
|
||||
window.location.href='<%= forum_memo_path(:forum_id=>@memo.forum_id,:id=>@memo.id ) %>'
|
||||
<%else%>
|
||||
$("#error").html('内容填写存在错误');
|
||||
<% end %>
|
|
@ -1,3 +1,3 @@
|
|||
|
||||
$("#organization_document_<%= @act.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document, :act => @act}) %>");
|
||||
$("#organization_document_<%= @act.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document,:flag => params[:flag], :act => @act}) %>");
|
||||
init_activity_KindEditor_data(<%= @act.id %>,"","87%");
|
|
@ -19,6 +19,6 @@
|
|||
init_activity_KindEditor_data(<%= OrgActivity.where("org_act_type='OrgDocumentComment'and org_act_id=?", document.id).first.id %>, null, "87%");
|
||||
});
|
||||
</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 %>
|
|
@ -25,7 +25,7 @@
|
|||
<div class="homepagePostDate">
|
||||
发布时间:<%= format_activity_day(@document.created_at) %> <%= format_time(@document.created_at, false) %></div>
|
||||
<% unless @document.content.blank? %>
|
||||
<div class="homepagePostIntro">
|
||||
<div class="homepagePostIntro" style="width:640px;">
|
||||
<%= @document.content.html_safe %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
@ -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,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(){
|
||||
location.reload();
|
||||
$(".resourceSharePopup").css("display","none");
|
||||
});
|
||||
});
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
|
||||
$(".resourcePopupClose").click(function(){
|
||||
location.reload();
|
||||
$(".resourceSharePopup").css("display","none");
|
||||
});
|
||||
});
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
</div>
|
||||
<% end %>
|
||||
<% 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} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if act.container_type == 'Project' %>
|
||||
|
@ -56,7 +56,7 @@
|
|||
<% end %>
|
||||
|
||||
<% 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"%>
|
||||
<% end%>
|
||||
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<div class="homepageLeftMenuBlock">
|
||||
<%= link_to "组织首页",organization_path(@organization, :show_homepage => 1), :class => 'homepageMenuText' %>
|
||||
</div>
|
||||
<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>
|
||||
<%=link_to "", join_project_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联项目"%>
|
||||
</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>
|
||||
<%=link_to "", join_course_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联课程"%>
|
||||
</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">
|
||||
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses_#{field.id}').slideToggle();"><%= field.name %></a>
|
||||
<%=link_to "", :title => "关联#{field.name}"%>
|
||||
</div>
|
||||
<div class="homepageLeftMenuCourses" id="homepageLeftMenuField_<%= field.id %>" style="display:none;">
|
||||
</div>
|
||||
<% end %>
|
|
@ -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,24 +8,20 @@
|
|||
<%= 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" %>
|
||||
|
|
||||
<% if document.organization.home_id == document.id %>
|
||||
<span style="color:#269ac9;">首页</span>
|
||||
<% else %>
|
||||
<span style="color:#269ac9;">组织文章</span>
|
||||
<% end %>
|
||||
</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">
|
||||
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %></div>
|
||||
<% unless document.content.blank? %>
|
||||
<div class="homepagePostIntro">
|
||||
<div class="homepagePostIntro" style="width:640px;">
|
||||
<%= document.content.html_safe %>
|
||||
</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) %>
|
||||
<% 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">
|
||||
|
@ -36,7 +32,7 @@
|
|||
<% end %>
|
||||
</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), :class => "postOptionLink" %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "删除文章", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete',
|
||||
|
@ -92,7 +88,7 @@
|
|||
</div>
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<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 %>"/>
|
||||
<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="orgListRole fb">状态</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<ul class="orgListRow">
|
||||
<li class="orgListUser">组织首页</li>
|
||||
<li class="orgListUser">默认</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<ul class="orgListRow">
|
||||
<li class="orgListUser">动态</li>
|
||||
<li class="orgListUser">默认</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<ul class="orgListRow">
|
||||
<li class="orgListUser">项目</li>
|
||||
<li class="orgListUser">默认</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<ul class="orgListRow">
|
||||
<li class="orgListUser">课程</li>
|
||||
<li class="orgListUser">默认</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>
|
||||
<%= 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_organization_new)) -%>
|
||||
|
||||
<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>
|
||||
|
|
@ -2,4 +2,5 @@ $("#homepageLeftMenuCourses").html("");
|
|||
$("#homepageLeftMenuCourses").append("<ul>");
|
||||
$("#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}) %>");
|
||||
$("#homepageLeftMenuCourses").append("</ul>");
|
||||
$("#homepageLeftMenuCourses").append("</ul>");
|
||||
$("#homepageLeftMenuCourses").show();
|
|
@ -2,4 +2,5 @@ $("#homepageLeftMenuProjects").html("");
|
|||
$("#homepageLeftMenuProjects").append("<ul>");
|
||||
$("#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}) %>");
|
||||
$("#homepageLeftMenuProjects").append("</ul>");
|
||||
$("#homepageLeftMenuProjects").append("</ul>");
|
||||
$("#homepageLeftMenuProjects").show();
|
|
@ -2,7 +2,7 @@
|
|||
function g(o){return document.getElementById(o);}
|
||||
function HoverLi(n){
|
||||
//如果有N个标签,就将i<=N;
|
||||
for(var i=1;i<=2;i++){
|
||||
for(var i=1;i<=3;i++){
|
||||
g('orgSetting_'+i).className='orgSettingOp';
|
||||
g('orgContent_'+i).className='undis';}
|
||||
g('orgContent_'+n).className='dis ml15 mr15';
|
||||
|
@ -34,6 +34,7 @@
|
|||
<ul class="mb10">
|
||||
<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_3" onclick="HoverLi(3);">栏目</li>
|
||||
<li class="orgBorder"></li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
|
@ -45,13 +46,11 @@
|
|||
<%= 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="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="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>
|
||||
|
@ -106,4 +105,26 @@
|
|||
</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" />
|
||||
<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>
|
||||
<script>
|
||||
function add_org_subfield(){
|
||||
if ($("#subfield_name").val().trim() != "")
|
||||
$("#add_subfield_form").submit();
|
||||
}
|
||||
</script>
|
|
@ -12,6 +12,7 @@
|
|||
.homepagePostReplyInputContainer .ke-inline-block {display: none;}
|
||||
.homepagePostReplyInputContainer .ke-container {float: left;}
|
||||
</style>
|
||||
<% if params[:show_homepage].nil? %>
|
||||
<div class="homepageRightBanner">
|
||||
<div class="NewsBannerName">最新动态</div>
|
||||
<ul class="resourcesSelect">
|
||||
|
@ -49,17 +50,16 @@
|
|||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 %>
|
||||
<% end %>
|
||||
<% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 %>
|
||||
<script>
|
||||
$(function() {
|
||||
init_activity_KindEditor_data(<%= OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?",@organization.home_id).first.id %>, null, "87%");
|
||||
});
|
||||
</script>
|
||||
<% 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 %>
|
||||
<% if @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>
|
|
@ -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>
|
|
@ -1,114 +1,33 @@
|
|||
<%= javascript_include_tag "jquery.infinitescroll.js" %>
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= l(:label_activity) %></h2>
|
||||
</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>
|
||||
<%#= stylesheet_link_tag 'courses' %>
|
||||
<script type="text/javascript">
|
||||
$(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-->
|
||||
|
||||
<%= 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 %>
|
||||
</div>
|
||||
<%= render :partial => "project_activities", :locals => {:forge_acts => @events_pages, :page => 0, :type => @type} %>
|
||||
</div>
|
|
@ -0,0 +1 @@
|
|||
$("#show_more_forge_activities").replaceWith("<%= escape_javascript( render :partial => 'projects/project_activities',:locals => {:forge_acts => @events_pages, :page => @page,:type => @type} )%>");
|
|
@ -22,11 +22,15 @@
|
|||
<% else %>
|
||||
<%= render :partial => 'navigation' %>
|
||||
<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>
|
||||
<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>
|
||||
<!--<div class="fr mt5"><a href="javascript:void(0);" class="vl_btn fb" onclick="zip()"><span class="vl_fork"></span><%= link_to "Fork", :controller => 'repositories', :action => 'forked' %></a> <span href="javascript:void(0);" class="vl_btn_2 fb">0</span> </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>-->
|
||||
|
||||
<div class="fr mt5"><%= link_to "<span class='vl_fork'></span>".html_safe+"Fork", {:controller => 'repositories', :action => 'forked'}, :class=>"vl_btn"%>
|
||||
<%#= link_to "<span id='span'>My span </span>#{@user.profile.my_data}".html_safe, "#", class: 'button white' %>
|
||||
|
||||
<span href="javascript:void(0);" class="vl_btn_2 fb"><%= @project.forked_count.to_i %></span> </div>
|
||||
<div class="cl"></div>
|
||||
<div class="recordBanner mt10">
|
||||
<% if @changesets && !@changesets.empty? %>
|
||||
|
|
|
@ -89,6 +89,11 @@
|
|||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="revise_attachment">
|
||||
<%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="ping_box fl" id="score_list_<%= work.id%>" style="<%= work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
|
||||
<%student_work_scores.each do |student_score|%>
|
||||
<div id="work_score_<%= student_score.id%>">
|
||||
|
@ -99,4 +104,26 @@
|
|||
<!---ping_box end--->
|
||||
<a href="javascript:void(0);" class="fr linkBlue mt5 mb5" onclick="$('#about_hwork_<%= work.id%>').html('');">收起</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function show_upload(){
|
||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>');
|
||||
showModal('ajax-modal', '452px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
||||
$('#ajax-modal').parent().css("top","40%").css("left","46%");
|
||||
$('#ajax-modal').parent().addClass("resourceUploadPopup");
|
||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
||||
}
|
||||
function submit_files(){
|
||||
$("#upload_form").submit();
|
||||
}
|
||||
function closeModal(){
|
||||
hideModal($(".uploadBoxContainer"));
|
||||
}
|
||||
function disable_choose(){
|
||||
if ($("#attachments_fields .attachment").size() >= 1) {
|
||||
$("#choose_revise_attach").attr("onclick","return false;").addClass(disable_link);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
<% revise_attachment = work.attachments.where("attachtype = 7").first %>
|
||||
<% if @homework.end_time < Date.today %>
|
||||
<% if revise_attachment && @is_teacher %>
|
||||
<div class="resubAtt mb15">
|
||||
<span class="resubTitle">追加修订附件</span>
|
||||
</div>
|
||||
<div class="mb10">
|
||||
<span class="tit_fb"> 追加附件:</span>
|
||||
<%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 2} %>
|
||||
<span class="tit_fb">追加时间:</span><%=format_time revise_attachment.created_on.to_s %> (<%=revise_attachment_status @homework,revise_attachment %>)
|
||||
</div>
|
||||
<% end %>
|
||||
<% if work.user == User.current %>
|
||||
<div class="resubAtt mb15">
|
||||
<span class="resubTitle">追加修订附件</span>
|
||||
</div>
|
||||
<% if revise_attachment %>
|
||||
<div class="mb10">
|
||||
<span class="tit_fb"> 追加附件:</span>
|
||||
<%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 1} %>
|
||||
<span class="tit_fb">追加时间:</span><%=format_time revise_attachment.created_on.to_s %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="mb10">
|
||||
<a href="javascript:void(0);" onclick="show_upload();" class="blueCir ml5" title="请选择文件上传">上传附件</a>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -41,17 +41,18 @@
|
|||
</li>
|
||||
<li >
|
||||
<span class="tit_fb"> 附件:</span>
|
||||
<% if work.attachments.empty?%>
|
||||
<% com_attachments = work.attachments.where("attachtype IS NULL OR attachtype <> 7") %>
|
||||
<% if com_attachments.empty?%>
|
||||
<span style="color: #999999">尚未提交附件</span>
|
||||
<% else%>
|
||||
<div class="fl" style="width: 90%;">
|
||||
<%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments, :status => @homework.homework_detail_manual.comment_status} %>
|
||||
<%= render :partial => 'work_attachments_status', :locals => {:attachments => com_attachments, :status => @homework.homework_detail_manual.comment_status} %>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li >
|
||||
<% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && work.user != User.current )%>
|
||||
<% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && work.user != User.current)%>
|
||||
<!-- 老师 || 开启匿评状态 && 不是当前用户自己的作品 -->
|
||||
<div id="add_student_score_<%= work.id%>" class="mt10 evaluation">
|
||||
<%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
|
||||
|
@ -61,6 +62,11 @@
|
|||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="revise_attachment">
|
||||
<%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="ping_box fl" id="score_list_<%= work.id%>" style="<%= work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
|
||||
<%student_work_scores.each do |student_score|%>
|
||||
<div id="work_score_<%= student_score.id%>">
|
||||
|
@ -71,4 +77,26 @@
|
|||
<!---ping_box end--->
|
||||
<a href="javascript:void(0);" class="fr linkBlue mt5 mb5" onclick="$('#about_hwork_<%= work.id%>').html('');">收起</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function show_upload(){
|
||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>');
|
||||
showModal('ajax-modal', '452px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
||||
$('#ajax-modal').parent().css("top","40%").css("left","46%");
|
||||
$('#ajax-modal').parent().addClass("resourceUploadPopup");
|
||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
||||
}
|
||||
function submit_files(){
|
||||
$("#upload_form").submit();
|
||||
}
|
||||
function closeModal(){
|
||||
hideModal($(".uploadBoxContainer"));
|
||||
}
|
||||
function disable_choose(){
|
||||
if ($("#attachments_fields .attachment").size() >= 1) {
|
||||
$("#choose_revise_attach").attr("onclick","return false;").addClass(disable_link);
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1,50 @@
|
|||
<!--<div class="resourceUploadPopup">-->
|
||||
<span class="uploadDialogText">上传附件</span>
|
||||
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>-->
|
||||
<div class="uploadBoxContainer">
|
||||
<%= form_tag(revise_attachment_student_work_path(work.id), :multipart => true,:remote => !ie8?,:name=>"upload_form",:id=>'upload_form') do %>
|
||||
<div>
|
||||
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
|
||||
</span>
|
||||
</div>
|
||||
<div class="uploadBox" id="uploadReviseBox">
|
||||
<input type="hidden" name="attachment_type" value="7">
|
||||
<a href="javascript:void(0);" class="uploadIcon f14" name="button" id="choose_revise_attach" onclick="_file.click();" onmouseover="" style="<%= ie8? ? 'display:none' : ''%>">
|
||||
<span class="chooseFile">选择文件</span></a>
|
||||
<%= file_field_tag 'attachments[dummy][file]',
|
||||
:id => '_file',
|
||||
:class => ie8? ? '':'file_selector',
|
||||
:multiple => true,
|
||||
:onchange => 'addReviseInputFiles(this,"'+'upload_files_submit_btn'+'");',
|
||||
: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)
|
||||
} %>
|
||||
<div class="cl"></div>
|
||||
<!--<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="closeModal();"><%#= l(:button_cancel)%></a>-->
|
||||
<!--<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%#= l(:button_confirm)%></a>-->
|
||||
</div>
|
||||
<div class="uploadResourceIntr">
|
||||
<div class="uploadResourceName">最多只能上传一个小于<span class="c_red">50MB</span>的附件</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div style="margin-top: 10px" >
|
||||
<div class="courseSendSubmit">
|
||||
<%= submit_tag '确定',:onclick=>'submit_files();',:onfocus=>'this.blur()',:id=>'upload_files_submit_btn',:class=>'sendSourceText' %>
|
||||
</div>
|
||||
<div class="courseSendCancel">
|
||||
<a href="javascript:void(0);" id="upload_files_cancle_btn" class="sendSourceText" onclick="closeModal();">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
|
@ -0,0 +1,33 @@
|
|||
<div id="popbox02">
|
||||
<div class="ni_con">
|
||||
<span class="f16 fontBlue fb">请您确认刚刚上传的作品信息</span>
|
||||
<p class="f14 mt5">
|
||||
<span class="fb">作品名称:</span><%=@student_work.name%>
|
||||
</p>
|
||||
<p class="f14 mt5">
|
||||
<span class="fb">作品描述:</span><%=@student_work.description%>
|
||||
</p>
|
||||
<p class="mt5">
|
||||
<span class="fl fb mr30">附</span><span class="fb fl">件:</span>
|
||||
<% if @student_work.attachments.empty? %>
|
||||
<span class="fl c_red"><%= "无附件"%></span>
|
||||
<% else %>
|
||||
<div class="fl grey_c">
|
||||
<%= render :partial => 'work_attachments_status', :locals => {:attachments => @student_work.attachments, :status => 2} %>
|
||||
</div>
|
||||
<% end %>
|
||||
</p>
|
||||
<div class="cl"></div>
|
||||
<div class="ni_btn mt10">
|
||||
<a href="javascript:" class="tijiao" onclick="clickOK();" style="margin-bottom: 15px; margin-left: 55px;" >
|
||||
确 定
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function clickOK() {
|
||||
window.location.href = '<%= student_work_index_url(:homework => @homework.id)%>';
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1,2 @@
|
|||
closeModal();
|
||||
$("#revise_attachment").html('<%= escape_javascript( render :partial => 'revise_attachment' ,:locals=>{ :work => @work})%>');
|
|
@ -1,5 +1,5 @@
|
|||
<% if @submit_result%>
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/work_information') %>');
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/work_edit_information') %>');
|
||||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
|
|
|
@ -17,7 +17,10 @@
|
|||
:remote=>true,:id=>'search_user_project_form',:class=>'resourcesSearchBox' do %>
|
||||
<%= hidden_field_tag(:send_id, send_id) %>
|
||||
<%= hidden_field_tag(:send_ids, send_ids) %>
|
||||
<input type="text" name="search" placeholder="输入项目ID或者名称搜索" class="searchResourcePopup" />
|
||||
<input type="text" id="search_project_input" value="<%= @search %>" name="search" placeholder="输入项目ID或者名称搜索" class="searchResourcePopup" />
|
||||
<script>
|
||||
observeSearchfieldOnInput('search_project_input','<%= search_user_project_user_path(user)%>','<%= send_id %>','<%= send_ids%>')
|
||||
</script>
|
||||
<!--<a href="javascript:void(0);" class="searchIconPopup"></a>-->
|
||||
<%= submit_tag '',:class=>'searchIconPopup',:onfocus=>"this.blur();",:style=>'border-style:none' %>
|
||||
<% end %>
|
||||
|
|
|
@ -17,7 +17,10 @@
|
|||
:remote=>true,:id=>'search_user_course_form',:class=>'resourcesSearchBox' do %>
|
||||
<%= hidden_field_tag(:send_id, send_id) %>
|
||||
<%= hidden_field_tag(:send_ids, send_ids) %>
|
||||
<input type="text" name="search" placeholder="输入课程ID或者名称搜索" class="searchResourcePopup" />
|
||||
<input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入课程ID或者名称搜索" class="searchResourcePopup" />
|
||||
<script>
|
||||
observeSearchfieldOnInput('search_course_input','<%= search_user_course_user_path(user)%>','<%= send_id %>','<%= send_ids%>')
|
||||
</script>
|
||||
<!--<a href="javascript:void(0);" class="searchIconPopup"></a>-->
|
||||
<%= submit_tag '',:class=>'searchIconPopup',:onfocus=>"this.blur();",:style=>'border-style:none' %>
|
||||
<% end %>
|
||||
|
|
|
@ -579,7 +579,7 @@
|
|||
</ul>
|
||||
<% end %>
|
||||
|
||||
<!-被老师移出课程-->
|
||||
<!--被老师移出课程-->
|
||||
<% if ma.course_message_type == "RemoveFromCourse" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
|
@ -612,4 +612,74 @@
|
|||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<!--老师发布测验 发给学生看-->
|
||||
<% if ma.course_message_type == "Exercise" && ma.status == 2 %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a></li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<span><%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
|
||||
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %></span><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了课程测验 :</span></li>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= link_to "测验题目:" + ma.course_message.exercise_name, exercise_path(:id => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))"%>
|
||||
</li>
|
||||
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p>
|
||||
<%= User.current.lastname + User.current.firstname %><%= User.current.allowed_to?(:as_teacher,ma.course_message.course) ? '老师':'同学'%>您好!
|
||||
<%= User.current.eql?(ma.course_message.user)?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname+"老师") %>发布了课程测验 ,测验详情如下:
|
||||
</p>
|
||||
<ul class="ul_normal_color">
|
||||
<li>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
|
||||
<li>测验标题:<%= ma.course_message.exercise_name %></li>
|
||||
<!--<li>测验描述:<%#= ma.course_message.exercise_description %></li>-->
|
||||
<!--<li>测验状态:<%#= ma.course_message.exercise_status == 1 ? '未发布':'已发布'%></li>-->
|
||||
<!--<%# if ma.course_message.publish_time %>-->
|
||||
<!--<li>发布时间:<%#= ma.course_message.publish_time.to_s.gsub("+0800","").to_datetime.strftime("%Y-%m-%d %H:%M:%S") %></li>-->
|
||||
<!--<%# end %>-->
|
||||
<li>截止时间:<%= ma.course_message.end_time.to_s.gsub("+0800","").to_datetime.strftime("%Y-%m-%d %H:%M:%S") %></li>
|
||||
<li>答题时长:<%= ma.course_message.time == -1 ? '不限时' : ma.course_message.time.to_s + '分钟' %></li>
|
||||
<% if !User.current.allowed_to?(:as_teacher,ma.course_message.course)%>
|
||||
<p>请记得在截止时间前完成测验噢,辛苦啦!</p>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% if ma.course_message_type == "Exercise" && ma.status == 3 %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a></li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<span> <%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
|
||||
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %></span><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布的测验:</span></li>
|
||||
<li class="homepageHomeworkContent fl">
|
||||
<%= link_to "测验题目:" + ma.course_message.exercise_name, exercise_path(:id => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||
:onmouseover =>"message_titile_show($(this),event)",
|
||||
:onmouseout => "message_titile_hide($(this))"%>
|
||||
|
||||
</li>
|
||||
|
||||
<div style="display: none" class="message_title_red system_message_style">
|
||||
<p>
|
||||
<%= User.current.lastname + User.current.firstname %><%= User.current.allowed_to?(:as_teacher,ma.course_message.course) ? '老师':'同学'%>您好!
|
||||
<%= User.current.eql?(ma.course_message.user)?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname+"老师") %>发布的课程测验截止时间快到了,测验详情如下:
|
||||
</p>
|
||||
|
||||
<ul class="ul_normal_color">
|
||||
<li>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)</li>
|
||||
<li>测验标题:<%= ma.course_message.exercise_name %></li>
|
||||
<li>截止时间:<%= ma.course_message.end_time.to_s.gsub("+0800","").to_datetime.strftime("%Y-%m-%d %H:%M:%S") %></li>
|
||||
<li>答题时长:<%= ma.course_message.time == -1 ? '无限制' : ma.course_message.time.to_s + '分钟' %></li>
|
||||
<p>请及时完成课程测验,辛苦啦!</p>
|
||||
</ul>
|
||||
</div>
|
||||
<li class="homepageHomeworkContentWarn fl">截止时间快到啦 </li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -5,5 +5,6 @@ $("#res_count").html(0);
|
|||
$("#checkboxAll").attr('checked',false);
|
||||
$("#res_all_count").html(<%= @atta_count%>);
|
||||
closePopUp();
|
||||
alert("发送成功")
|
||||
<% else%>
|
||||
<% end %>
|
|
@ -5,5 +5,6 @@ $("#res_count").html(0);
|
|||
$("#checkboxAll").attr('checked',false);
|
||||
$("#res_all_count").html(<%= @atta_count%>);
|
||||
closePopUp();
|
||||
alert("发送成功")
|
||||
<% else%>
|
||||
<% end %>
|
|
@ -143,7 +143,7 @@
|
|||
//资源名称的链接
|
||||
var res_link;
|
||||
var id; //资源id
|
||||
var sendType; //发送到课程 1 发送到项目 2
|
||||
var sendType = '1'; //发送到课程 1 发送到项目 2
|
||||
var lastSendType; //保存上次发送的发送类型
|
||||
$("#resources_list").mousedown(function(e) {
|
||||
//如果是右键的话
|
||||
|
@ -309,15 +309,15 @@
|
|||
document.oncontextmenu = function() {return true;}
|
||||
line.children().css("background-color",'white');
|
||||
id = line.children().last().html();
|
||||
if (lastSendType === '1'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。
|
||||
if (lastSendType === '2'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '<%= search_user_course_user_path(@user)%>' + '?send_id=' + id
|
||||
url: '<%= search_user_project_user_path(@user)%>' + '?send_id=' + id
|
||||
});
|
||||
}else{
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '<%= search_user_project_user_path(@user)%>' + '?send_id=' + id
|
||||
url: '<%= search_user_course_user_path(@user)%>' + '?send_id=' + id
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -327,16 +327,17 @@
|
|||
alert('暂时不支持多页选择,您当前页没有选择任何资源');
|
||||
return ;
|
||||
}
|
||||
if (lastSendType === '1'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '<%= search_user_course_user_path(@user)%>' + '?'+ $("#resources_list_form").serialize()
|
||||
});
|
||||
}else{
|
||||
if (lastSendType === '2'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '<%= search_user_project_user_path(@user)%>' + '?' + $("#resources_list_form").serialize()
|
||||
});
|
||||
}else{
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '<%= search_user_course_user_path(@user)%>' + '?'+ $("#resources_list_form").serialize()
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -480,5 +481,36 @@
|
|||
|
||||
lastSendType = sendType;
|
||||
}
|
||||
|
||||
function observeSearchfieldOnInput(fieldId, url,send_id,send_ids) {
|
||||
$('#'+fieldId).each(function() {
|
||||
var $this = $(this);
|
||||
$this.addClass('autocomplete');
|
||||
$this.attr('data-value-was', $this.val());
|
||||
var check = function() {
|
||||
var val = $this.val();
|
||||
if ($this.attr('data-value-was') != val){
|
||||
$this.attr('data-value-was', val);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'get',
|
||||
data: {search: $this.val(),send_id:send_id,send_ids:send_ids},
|
||||
success: function(data){ },
|
||||
beforeSend: function(){ $this.addClass('ajax-loading'); },
|
||||
complete: function(){ $this.removeClass('ajax-loading'); }
|
||||
});
|
||||
}
|
||||
};
|
||||
var reset = function() {
|
||||
if (timer) {
|
||||
clearInterval(timer);
|
||||
timer = setInterval(check, 300);
|
||||
}
|
||||
};
|
||||
var timer = setInterval(check, 300);
|
||||
$this.bind('keyup click mousemove', reset);
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
|
|
@ -26,6 +26,6 @@ zh:
|
|||
mail_attention: "请您关注!"
|
||||
mail_homework_endtime: "作业截止时间快到了!"
|
||||
mail_homework: "作业:"
|
||||
mail_anonymous_comment_close: "作业匿评已经关闭!"
|
||||
mail_anonymous_comment_open: "作业匿评已经开启!"
|
||||
mail_anonymous_comment_failed: "作业匿评开启失败!"
|
||||
mail_anonymous_comment_close: "作业匿评已经关闭,请您关注!"
|
||||
mail_anonymous_comment_open: "作业匿评已经开启,请您关注!"
|
||||
mail_anonymous_comment_failed: "作业匿评开启失败,请您关注!"
|
|
@ -36,6 +36,7 @@ RedmineApp::Application.routes.draw do
|
|||
get 'setting'#, :action => 'settings', :as => 'settings'
|
||||
get 'clear_org_avatar_temp'
|
||||
put 'set_homepage'
|
||||
put 'cancel_homepage'
|
||||
get 'members'
|
||||
get 'more_org_projects'
|
||||
get 'more_org_courses'
|
||||
|
@ -69,6 +70,10 @@ RedmineApp::Application.routes.draw do
|
|||
end
|
||||
end
|
||||
|
||||
resources :org_subfields do
|
||||
|
||||
end
|
||||
|
||||
resources :org_document_comments do
|
||||
member do
|
||||
post 'add_reply'
|
||||
|
@ -206,6 +211,7 @@ RedmineApp::Application.routes.draw do
|
|||
resources :student_work do
|
||||
member do
|
||||
post 'add_score'
|
||||
post 'revise_attachment'
|
||||
get 'retry_work'
|
||||
get 'praise_student_work'
|
||||
get 'forbidden_anonymous_comment'
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
class CreateOrgDocumeEditor < ActiveRecord::Migration
|
||||
def up
|
||||
create_table :editor_of_documents do |t|
|
||||
t.integer :editor_id
|
||||
t.integer :org_document_comment_id
|
||||
t.timestamp :created_at
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -0,0 +1,12 @@
|
|||
class CopyDocumentCreatedAtForEditorOfDocument < ActiveRecord::Migration
|
||||
def up
|
||||
OrgDocumentComment.all.each do |doc|
|
||||
if doc.parent.nil?
|
||||
EditorOfDocument.create(:editor_id => doc.creator_id, :org_document_comment_id => doc.id, :created_at => doc.updated_at)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -0,0 +1,9 @@
|
|||
# encoding: utf-8
|
||||
class AddAttachmentType < ActiveRecord::Migration
|
||||
def up
|
||||
Attachmentstype.create(typeId:3,typeName:'修订附件')
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddForkedFromProjectIdToProjects < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :projects, :forked_from_project_id, :integer
|
||||
end
|
||||
end
|
|
@ -0,0 +1,13 @@
|
|||
class CreateOrgSubfields < ActiveRecord::Migration
|
||||
def up
|
||||
create_table :org_subfields do |t|
|
||||
t.integer :organization_id
|
||||
t.integer :priority
|
||||
t.string :name
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddForkedCountToProjects < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :projects, :forked_count, :integer
|
||||
end
|
||||
end
|
36
db/schema.rb
36
db/schema.rb
|
@ -11,8 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20151202064455) do
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20151130033906) do
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
t.string "act_type", :null => false
|
||||
|
@ -565,6 +564,12 @@ ActiveRecord::Schema.define(:version => 20151202064455) do
|
|||
t.integer "id", :null => false
|
||||
end
|
||||
|
||||
create_table "editor_of_documents", :force => true do |t|
|
||||
t.integer "editor_id"
|
||||
t.integer "org_document_comment_id"
|
||||
t.datetime "created_at"
|
||||
end
|
||||
|
||||
create_table "enabled_modules", :force => true do |t|
|
||||
t.integer "project_id"
|
||||
t.string "name", :null => false
|
||||
|
@ -974,6 +979,7 @@ ActiveRecord::Schema.define(:version => 20151202064455) do
|
|||
t.integer "course_group_id", :default => 0
|
||||
end
|
||||
|
||||
add_index "members", ["course_id"], :name => "index_members_on_course_id"
|
||||
add_index "members", ["project_id"], :name => "index_members_on_project_id"
|
||||
add_index "members", ["user_id", "project_id", "course_id"], :name => "index_members_on_user_id_and_project_id", :unique => true
|
||||
add_index "members", ["user_id"], :name => "index_members_on_user_id"
|
||||
|
@ -1174,6 +1180,14 @@ ActiveRecord::Schema.define(:version => 20151202064455) do
|
|||
t.datetime "created_at"
|
||||
end
|
||||
|
||||
create_table "org_subfields", :force => true do |t|
|
||||
t.integer "organization_id"
|
||||
t.integer "priority"
|
||||
t.string "name"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "organizations", :force => true do |t|
|
||||
t.string "name"
|
||||
t.text "description"
|
||||
|
@ -1307,27 +1321,29 @@ ActiveRecord::Schema.define(:version => 20151202064455) do
|
|||
end
|
||||
|
||||
create_table "projects", :force => true do |t|
|
||||
t.string "name", :default => "", :null => false
|
||||
t.string "name", :default => "", :null => false
|
||||
t.text "description"
|
||||
t.string "homepage", :default => ""
|
||||
t.boolean "is_public", :default => true, :null => false
|
||||
t.string "homepage", :default => ""
|
||||
t.boolean "is_public", :default => true, :null => false
|
||||
t.integer "parent_id"
|
||||
t.datetime "created_on"
|
||||
t.datetime "updated_on"
|
||||
t.string "identifier"
|
||||
t.integer "status", :default => 1, :null => false
|
||||
t.integer "status", :default => 1, :null => false
|
||||
t.integer "lft"
|
||||
t.integer "rgt"
|
||||
t.boolean "inherit_members", :default => false, :null => false
|
||||
t.boolean "inherit_members", :default => false, :null => false
|
||||
t.integer "project_type"
|
||||
t.boolean "hidden_repo", :default => false, :null => false
|
||||
t.integer "attachmenttype", :default => 1
|
||||
t.boolean "hidden_repo", :default => false, :null => false
|
||||
t.integer "attachmenttype", :default => 1
|
||||
t.integer "user_id"
|
||||
t.integer "dts_test", :default => 0
|
||||
t.integer "dts_test", :default => 0
|
||||
t.string "enterprise_name"
|
||||
t.integer "organization_id"
|
||||
t.integer "project_new_type"
|
||||
t.integer "gpid"
|
||||
t.integer "forked_from_project_id"
|
||||
t.integer "forked_count"
|
||||
end
|
||||
|
||||
add_index "projects", ["lft"], :name => "index_projects_on_lft"
|
||||
|
|
|
@ -241,8 +241,9 @@ class Gitlab::Client
|
|||
|
||||
# Forks a project into the user namespace of the authenticated user.
|
||||
# @param [Integer] - The ID of the project to be forked
|
||||
def fork(id)
|
||||
post("/projects/fork/#{id}")
|
||||
def fork(gpid, gid)
|
||||
post ("/projects/fork/#{gpid}?user_id=#{gid}")
|
||||
# post("/projects/fork/#{id}")
|
||||
end
|
||||
|
||||
# Mark this project as forked from the other
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
#coding=utf-8
|
||||
#需要在0点以后执行
|
||||
namespace :exercise_deadline_warn do
|
||||
desc "exercise deadline warn"
|
||||
task :deadline_warn => :environment do
|
||||
#exercise_status 1 未发布 2 已发布 3已截止
|
||||
exercises = Exercise.where("exercise_status = 2 and date_format(end_time,'%Y-%m-%d')= '#{Date.today}'") #截止日期都是当天 23.59分,所以年月日相等的一定是今晚会截止的测验
|
||||
exercises.each do |exercise|
|
||||
course = exercise.course
|
||||
course.members.each do |m|
|
||||
#CourseMessage status 1 未发布 status 2 已发布 status 3 已发布快截止了
|
||||
exercise.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => 3) unless m.user.allowed_to?(:as_teacher,m)
|
||||
end
|
||||
# if homework.course_acts.size == 0
|
||||
# homework.course_acts << CourseActivity.new(:user_id => homework.user_id,:course_id => homework.course_id)
|
||||
# end
|
||||
# 邮件通知
|
||||
#Mailer.run.homework_added(homework)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,22 @@
|
|||
#coding=utf-8
|
||||
|
||||
namespace :exercise_publish do
|
||||
desc "publish exercise and end exercise"
|
||||
task :publish => :environment do
|
||||
exercises = Exercise.where("publish_time is not null and exercise_status = 1 and publish_time <=?",Time.now)
|
||||
exercises.each do |exercise|
|
||||
exercise.update_column('exercise_status', 2)
|
||||
course = exercise.course
|
||||
course.members.each do |m|
|
||||
exercise.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => 2)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
task :end => :environment do
|
||||
exercises = Exercise.where("end_time <=? and exercise_status = 2",Time.now)
|
||||
exercises.each do |exercise|
|
||||
exercise.update_column('exercise_status', 3)
|
||||
end
|
||||
end
|
||||
end
|
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
|
@ -154,6 +154,73 @@ function addFile(inputEl, file, eagerUpload,btnId) {
|
|||
}
|
||||
addFile.nextAttachmentId = 1;
|
||||
|
||||
function addReviseFile(inputEl, file, eagerUpload,btnId) {
|
||||
|
||||
var attachments_frame = '#attachments_fields';
|
||||
if ($(attachments_frame).children().length < 30) {
|
||||
deleteallfiles = $(inputEl).data('deleteAllFiles');
|
||||
var attachmentId = addFile.nextAttachmentId++;
|
||||
|
||||
var fileSpan = $('<span>', {
|
||||
'id': 'attachments_' + attachmentId,
|
||||
'class': 'attachment'
|
||||
});
|
||||
|
||||
fileSpan.append(
|
||||
$('<input>', {
|
||||
'type': 'text',
|
||||
'class': 'upload_filename readonly',
|
||||
'name': 'attachments[' + attachmentId + '][filename]',
|
||||
'readonly': 'readonly'
|
||||
}).val(file.name),
|
||||
// $('<input>', {
|
||||
// 'type': 'text',
|
||||
// 'class': 'description',
|
||||
// 'name': 'attachments[' + attachmentId + '][description]',
|
||||
// 'maxlength': 254,
|
||||
// 'placeholder': $(inputEl).data('descriptionPlaceholder')
|
||||
// }).toggle(!eagerUpload),
|
||||
// $('<span >' + $(inputEl).data('fieldIsPublic') + ':</span>').attr({
|
||||
// 'class': 'ispublic-label'
|
||||
// }),
|
||||
// $('<input>', {
|
||||
// 'type': 'checkbox',
|
||||
// 'class': 'is_public_checkbox',
|
||||
// 'value': 1,
|
||||
// 'name': 'attachments[' + attachmentId + '][is_public_checkbox]',
|
||||
// checked: 'checked'
|
||||
// }).toggle(!eagerUpload),
|
||||
$('<a> </a>').attr({
|
||||
'href': "#",
|
||||
'class': 'remove-upload'
|
||||
}).click(function() {
|
||||
if (confirm($(inputEl).data('areYouSure'))) {
|
||||
removeReviseFile();
|
||||
if (!eagerUpload) {
|
||||
(function(e) {
|
||||
reload(e);
|
||||
})(fileSpan);
|
||||
}
|
||||
}
|
||||
|
||||
}).toggle(!eagerUpload),
|
||||
$('<div>', {
|
||||
'class': 'div_attachments',
|
||||
'name': 'div_' + 'attachments_' + attachmentId
|
||||
})
|
||||
).appendTo('#attachments_fields');
|
||||
|
||||
$("#uploadReviseBox").addClass('disable_link');
|
||||
$("#choose_revise_attach").attr("onclick","return false;");
|
||||
|
||||
if (eagerUpload) {
|
||||
ajaxUpload(file, attachmentId, fileSpan, inputEl,btnId);
|
||||
}
|
||||
return attachmentId;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function ajaxUpload(file, attachmentId, fileSpan, inputEl,btnId) {
|
||||
//上传开始调用函数
|
||||
function onLoadstart(e) {
|
||||
|
@ -293,6 +360,13 @@ function removeFile() {
|
|||
return false;
|
||||
}
|
||||
|
||||
function removeReviseFile() {
|
||||
$(this).parent('span').remove();
|
||||
$("#uploadReviseBox").removeClass('disable_link');
|
||||
$("#choose_revise_attach").attr("onclick","_file.click();");
|
||||
return false;
|
||||
}
|
||||
|
||||
//gcm delete all file
|
||||
//modify by yutao 2015-5-14 <20><>1<EFBFBD><31>ҳ<EFBFBD><D2B3><EFBFBD><EFBFBD>ڶ<EFBFBD><DAB6><EFBFBD>ϴ<EFBFBD><CFB4>ؼ<EFBFBD>ʱ<EFBFBD>˿<EFBFBD><CBBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>bug <20>ʸ<EFBFBD>֮ start
|
||||
function removeAll(containerid) {
|
||||
|
@ -346,6 +420,30 @@ function uploadBlob(blob, uploadUrl, attachmentId, options) {
|
|||
});
|
||||
}
|
||||
|
||||
function addReviseInputFiles(inputEl,btnId) {
|
||||
// var clearedFileInput = $(inputEl).clone().val('');
|
||||
if (inputEl.files) {
|
||||
uploadAndAttachReviseFiles(inputEl.files, inputEl,btnId);
|
||||
// $(inputEl).remove();
|
||||
} else {
|
||||
// browser not supporting the file API, upload on form submission
|
||||
var attachmentId;
|
||||
var aFilename = inputEl.value.split(/\/|\\/);
|
||||
var count = $('#attachments_fields>span').length;
|
||||
attachmentId = addReviseFile(inputEl, {
|
||||
name: aFilename[aFilename.length - 1]
|
||||
}, false);
|
||||
if (attachmentId) {
|
||||
$(inputEl).attr({
|
||||
name: 'attachments[' + attachmentId + '][file]'
|
||||
}).hide();
|
||||
if (count <= 0) count = 1;
|
||||
}
|
||||
}
|
||||
|
||||
//clearedFileInput.insertAfter('#attachments_fields');
|
||||
}
|
||||
|
||||
function addInputFiles(inputEl,btnId) {
|
||||
// var clearedFileInput = $(inputEl).clone().val('');
|
||||
if (inputEl.files) {
|
||||
|
@ -405,6 +503,26 @@ function addInputFiles_board(inputEl, id,btnId) {
|
|||
//clearedFileInput.insertAfter('#attachments_fields');
|
||||
}
|
||||
|
||||
function uploadAndAttachReviseFiles(files, inputEl,btnId) {
|
||||
|
||||
var maxFileSize = $(inputEl).data('max-file-size');
|
||||
var maxFileSizeExceeded = $(inputEl).data('max-file-size-message');
|
||||
|
||||
var sizeExceeded = false;
|
||||
$.each(files, function() {
|
||||
if (this.size && maxFileSize != null && this.size > parseInt(maxFileSize)) {
|
||||
sizeExceeded = true;
|
||||
}
|
||||
});
|
||||
if (sizeExceeded) {
|
||||
window.alert(maxFileSizeExceeded);
|
||||
} else {
|
||||
$.each(files, function() {
|
||||
addReviseFile(inputEl, this, true,btnId);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function uploadAndAttachFiles(files, inputEl,btnId) {
|
||||
|
||||
var maxFileSize = $(inputEl).data('max-file-size');
|
||||
|
|
|
@ -34,7 +34,7 @@ function submit_article()
|
|||
function regexTopicDescription()
|
||||
{
|
||||
var name = message_content_editor.html();
|
||||
if(name.length ==0)
|
||||
if(message_content_editor.isEmpty())
|
||||
{
|
||||
$("#message_content_span").text("描述不能为空");
|
||||
$("#message_content_span").css('color','#ff0000');
|
||||
|
@ -55,7 +55,7 @@ function regexTopicDescription()
|
|||
|
||||
function MessageReplayVevify() {
|
||||
var content = message_content_editor.html();//$.trim($("#message_content").val());
|
||||
if (content.length == 0) {
|
||||
if (message_content_editor.isEmpty()) {
|
||||
$("#message_content_span").text("回复不能为空");
|
||||
$("#message_content_span").css('color', '#ff0000');
|
||||
return false;
|
||||
|
|
|
@ -1192,3 +1192,25 @@ a:hover.memberBtn{background: url(/images/course/hwork_icon.png) -80px -90px no-
|
|||
.addMemberCP {width:514px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; z-index:1000;}
|
||||
.rightArrow {margin:50px 15px 0px 15px; float:left;}
|
||||
.relateText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight: bold;}
|
||||
|
||||
.resubAtt {border-top:1px solid #dddddd; position:relative; margin-top:15px;}
|
||||
.resubTitle {position:absolute; top:-10px; left:5px; background-color:#ffffff; display:block; font-weight:bold; padding:0px 2px;}
|
||||
a.blueCir{ display:inline-block; padding:2px 5px; background-color:#ffffff;border:1px solid #3598db; color:#3598db; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
|
||||
a:hover.blueCir{ background:#3598db; color:#fff;}
|
||||
|
||||
/*上传资源弹窗*/
|
||||
.resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9 !important; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;}
|
||||
.uploadDialogText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; width:140px; display:inline-block; font-weight: bold;}
|
||||
.uploadBoxContainer {height:33px; line-height:33px; margin-top:10px; position:relative}
|
||||
.uploadBox {width:100px; height:33px; line-height:33px; text-align:center; vertical-align:middle; background-color:#269ac9; border-radius:3px; float:left; margin-right:12px;}
|
||||
a.uploadBoxIcon {background:url(images/resource_icon_list.png) -35px 10px no-repeat; float:left; display:block; width:81px; height:30px; padding-left:22px; font-size:14px; color:#ffffff;}
|
||||
a.uploadIcon {background:url(images/resource_icon_list.png) 8px -60px no-repeat; width:100px; height:33px;}
|
||||
.chooseFile {color:#ffffff; display:block; margin-left:32px;}
|
||||
.uploadResourceIntr {width:250px; height:33px; float:left; line-height:33px; font-size:12px;}
|
||||
.uploadResourceName {width:250px; display:inline-block; line-height:15px; font-size:12px; color:#444444; margin-bottom:2px;}
|
||||
.uploadResourceIntr2 {width:250px; display:inline-block; line-height:15px; font-size:12px; color:#444444;}
|
||||
.uploadType {margin:10px 0; border:1px solid #e6e6e6; width:100px; height:30px; outline:none; font-size:12px; color:#888888;}
|
||||
.uploadKeyword {margin-bottom:10px; outline:none; border:1px solid #e6e6e6; height:30px; width:280px;}
|
||||
.mb10 {margin-bottom: 10px}
|
||||
.mb15 {margin-bottom: 15px}
|
||||
div.disable_link {background-color: #c1c1c1 !important;}
|
|
@ -54,4 +54,14 @@ a.cancelBtn:hover {background-color:#717171; color:#ffffff;}
|
|||
|
||||
/*关联项目弹窗*/
|
||||
.projectRelate {float:left; max-height:118px;margin-right:16px;margin-bottom:10px; overflow:auto; overflow-x:hidden; width:288px;}
|
||||
.relateText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight: bold;}
|
||||
.relateText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight: bold;}
|
||||
|
||||
/*组织首页新151204Tim*/
|
||||
.orgNav {width:1000px; height:30px; background-color:#cfcfcf; margin:0 auto;}
|
||||
.orgContainer {width:100%; margin:0 auto; background-color:#cfcfcf;}
|
||||
.navOrgLogo {width:21px; height:30px; margin-left:2px; margin-right:15px;}
|
||||
.navOrgMenu {display:inline-block;height:30px; line-height:30px; vertical-align:middle;}
|
||||
a.linkGrey8 {color:#888888;}
|
||||
a.linkGrey8:hover {color:#585858;}
|
||||
.orgBorder {width:583px; height:21px; border-bottom:3px solid #e4e4e4; float:left;}
|
||||
.orgListRow {border-bottom:1px solid #e4e4e4; padding-bottom:5px; color:#555555;}
|
|
@ -410,7 +410,7 @@ a:hover.search_btn{ background: #0fa9bb;}
|
|||
.resourcesSendTo {float:left; height:20px; margin-top:15px;}
|
||||
.resourcesSendType {border:1px solid #e6e6e6; width:60px; height:24px; outline:none; font-size:14px; color:#888888;}
|
||||
.resourcePopupClose {width:20px; height:20px; display:inline-block; float:right;}
|
||||
.resourceClose {background:url(../images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block;}
|
||||
.resourceClose {background:url(images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000;}
|
||||
.resourcesSearchBox {border:1px solid #e6e6e6; width:225px; height:25px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;}
|
||||
.searchResourcePopup {border:none; outline:none; background-color:#ffffff; width:184px; height:25px; padding-left:10px; display:inline-block; float:left;}
|
||||
.courseSend {width:260px; height:15px; line-height:15px; margin-bottom:10px;}
|
||||
|
|
|
@ -566,7 +566,7 @@ a.uploadIcon {background:url(images/resource_icon_list.png) 8px -60px no-repeat;
|
|||
.resourceSharePopup {width:300px; height:auto; border:3px solid #15bccf; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-150px; z-index:1000;}
|
||||
.sendText {font-size:16px; color:#15bccf; line-height:16px; padding-top:20px; width:100px; display:inline-block;}
|
||||
.resourcePopupClose {width:20px; height:20px; display:inline-block; float:right;}
|
||||
.resourceClose {background:url(images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block;}
|
||||
.resourceClose {background:url(images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000;}
|
||||
.resourcesSearchBox {border:1px solid #e6e6e6; width:225px; height:25px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;}
|
||||
.searchResourcePopup {border:none; outline:none; background-color:#ffffff; width:184px; height:25px; padding-left:10px; display:inline-block; float:left;}
|
||||
.searchIconPopup{width:31px; height:25px; background-color:#ffffff; background:url(images/resource_icon_list.png) -40px -18px no-repeat; display:inline-block; float:left;}
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe OrgSubfieldsController, :type => :controller do
|
||||
|
||||
end
|
Loading…
Reference in New Issue