Merge branch 'develop' into hjq_new_course

This commit is contained in:
huang 2015-12-21 14:11:28 +08:00
commit 6193dc8f0a
125 changed files with 1323 additions and 420 deletions

View File

@ -49,7 +49,7 @@ group :development do
end
end
group :development, :test do
group :development, :test do
unless RUBY_PLATFORM =~ /w32/
gem 'pry-rails'
if RUBY_VERSION >= '2.0.0'
@ -58,7 +58,7 @@ group :development, :test do
gem 'pry-stack_explorer'
if RUBY_PLATFORM =~ /darwin/
gem 'puma'
end
end
end
gem 'rspec-rails', '~> 3.0'
@ -72,7 +72,7 @@ group :assets do
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', :platforms => :ruby
gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end

View File

@ -0,0 +1,152 @@
#coding=utf-8
class AtController < ApplicationController
respond_to :json
def show
@logger = Logger.new(Rails.root.join('log', 'at.log').to_s)
users = find_at_users(params[:type], params[:id])
@users = users
@users = users.uniq { |u| u.id }.delete_if { |u| u.id == User.current.id } if users
end
private
def find_at_users(type, id)
@logger.info("#{type}, #{id}")
case type
when "Issue"
find_issue(id)
when 'Project'
find_project(id)
when 'Course'
find_course(id)
when 'Activity', 'CourseActivity', 'ForgeActivity','UserActivity', 'OrgActivity','PrincipalActivity'
find_activity(id, type)
when 'Attachment'
find_attachment(id)
when 'Message'
find_message(id)
when 'HomeworkCommon'
find_homework(id)
when 'Topic'
find_topic(id)
else
nil
end
end
def find_topic(id)
end
def find_issue(id)
#1. issues list persons
#2. project persons
issue = Issue.find(id)
journals = issue.journals
at_persons = journals.map(&:user) + issue.project.users
at_persons.uniq { |u| u.id }.delete_if { |u| u.id == User.current.id }
end
def find_project(id)
at_persons = Project.find(id).users
at_persons.delete_if { |u| u.id == User.current.id }
end
def find_course(id)
at_persons = Course.find(id).users
at_persons.delete_if { |u| u.id == User.current.id }
end
def find_activity(id, type)
## 基本上是本类型中的 加上所属类型的用户
case type
when 'Activity'
activity = Activity.find(id)
(find_at_users(activity.act_type, activity.act_id) ||[]) +
(find_at_users(activity.activity_container_type, activity.activity_container_id) || [])
when 'CourseActivity'
activity = CourseActivity.find(id)
(find_at_users(activity.course_act_type, activity.course_act_id) || []) + (find_course(activity.course.id) || [])
when 'ForgeActivity'
activity = ForgeActivity.find(id)
(find_at_users(activity.forge_act_type, activity.forge_act_id) ||[]) +
(find_project(activity.project_id) || [])
when 'UserActivity'
activity = UserActivity.find(id)
(find_at_users(activity.act_type, activity.act_id) || []) +
(find_at_users(activity.container_type, activity.container_id) || [])
when 'OrgActivity'
activity = OrgActivity.find(id)
(find_at_users(activity.org_act_type, activity.org_act_id) || []) +
(find_at_users(activity.container_type, activity.container_id) || [])
when 'PrincipalActivity'
activity = PrincipalActivity.find(id)
find_at_users(activity.principal_act_type, activity.principal_act_id)
else
nil
end
end
#作业应该是关联课程,取课程的用户列表
def find_homework(id)
homework = HomeworkCommon.find(id)
find_course(homework.course_id)
end
def find_attachment(id)
attachment = Attachment.find(id)
find_at_users(attachment.container_type, attachment.container_id)
end
#Message
def find_message(id)
message = Message.find(id)
at_persons = message.board.messages.map(&:author)
(at_persons || []) + (find_project(message.board.project_id)||[])
end
#News
def find_news(id)
find_project(News.find(id).project_id)
end
#JournalsForMessage
def find_journals_for_message(id)
jounrnal = JournalsForMessage.find(id)
find_at_users(jounrnal.jour_type, jounrnal.jour_id)
end
#Poll
def find_poll(id)
end
#Journal
def find_journal(id)
journal = Journal.find(id)
find_at_users(journal.journalized_type, journal.journalized_id)
end
#Document
def find_document(id)
find_project(Document.find(id).project_id)
end
#ProjectCreateInfo
def find_project_create_info(id)
end
#Principal
def find_principal(id)
end
#BlogComment
def find_blog_comment(id)
blog = BlogComment.find(id).blog
blog.users
end
end

View File

@ -79,6 +79,13 @@ class BoardsController < ApplicationController
end
end
end
@project.boards.each do |board|
board.messages.each do |m|
User.current.at_messages.unviewed('Message', m.id).each {|x| x.viewed!}
end
end
elsif @course
query_course_messages = @board.messages
query_course_messages.each do |query_course_message|
@ -146,6 +153,7 @@ class BoardsController < ApplicationController
end
end
@page = params[:page] ? params[:page].to_i + 1 : 0
@message = Message.new(:board => @board)
#modify by nwb
respond_to do |format|

View File

@ -16,10 +16,7 @@ class ExerciseController < ApplicationController
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)||User.current.admin?)
render_403
return
@ -46,10 +43,7 @@ class ExerciseController < ApplicationController
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) || User.current.admin?
render_403
return

View File

@ -24,7 +24,7 @@ class FilesController < ApplicationController
before_filter :auth_login1, :only => [:index]
before_filter :logged_user_by_apptoken,:only => [:index]
before_filter :find_project_by_project_id#, :except => [:getattachtype]
before_filter :authorize, :except => [:create,:getattachtype,:quote_resource_show,:search,:searchone4reload,:search_project,:quote_resource_show_project,:search_tag_attachment]
before_filter :authorize, :except => [:create,:getattachtype,:quote_resource_show,:search,:searchone4reload,:search_project,:quote_resource_show_project,:search_tag_attachment,:subfield_upload_file,:search_org_subfield_tag_attachment,:search_tag_attachment,:quote_resource_show_org_subfield,:find_org_subfield_attache,:search_files_in_subfield]
helper :sort
include SortHelper

View File

@ -19,6 +19,14 @@ class HomeworkCommonController < ApplicationController
@is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course))
@is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher))
@is_new = params[:is_new]
#设置at已读
@homeworks.each do |homework|
homework.journals_for_messages.each do |j|
User.current.at_messages.unviewed('JournalsForMessage', j.id).each {|x| x.viewed!}
end
end
respond_to do |format|
format.js
format.html
@ -167,6 +175,7 @@ class HomeworkCommonController < ApplicationController
end
end
@homework_detail_manual.update_column('comment_status', 2)
@homework_detail_manual.update_column('evaluation_start', Date.today)
@statue = 1
# 匿评开启消息邮件通知
send_message_anonymous_comment(@homework, m_status = 2)
@ -186,6 +195,7 @@ class HomeworkCommonController < ApplicationController
#关闭匿评
def stop_anonymous_comment
@homework_detail_manual.update_column('comment_status', 3)
@homework_detail_manual.update_column('evaluation_end', Date.today)
#计算缺评扣分
work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")"
@homework.student_works.each do |student_work|
@ -266,7 +276,13 @@ class HomeworkCommonController < ApplicationController
#启动匿评参数设置
def start_evaluation_set
if params[:user_activity_id]
@user_activity_id = params[:user_activity_id]
else
@user_activity_id = -1
end
@is_in_course = params[:is_in_course]
@course_activity = params[:course_activity].to_i
end
#设置匿评参数
@ -282,6 +298,9 @@ class HomeworkCommonController < ApplicationController
@homework_detail_manual.evaluation_num = params[:evaluation_num]
@homework_detail_manual.save
@user_activity_id = params[:user_activity_id].to_i
@is_in_course = params[:is_in_course].to_i
@course_activity = params[:course_activity].to_i
end
end

View File

@ -24,7 +24,7 @@ class IssuesController < ApplicationController
before_filter :find_issues, :only => [:bulk_edit, :bulk_update, :destroy]
before_filter :find_project, :only => [:new, :create, :update_form]
#before_filter :authorize, :except => [:index, :show]
before_filter :authorize, :except => [:index,:add_journal, :add_journal_in_org]
before_filter :authorize, :except => [:index,:add_journal, :add_journal_in_org,:delete_journal,:reply,:add_reply]
before_filter :find_optional_project, :only => [:index]
before_filter :check_for_default_issue_status, :only => [:new, :create]
@ -118,6 +118,14 @@ class IssuesController < ApplicationController
# 当前用户查看指派给他的缺陷消息,则设置消息为已读
query = ForgeMessage.where("forge_message_type =? and user_id =? and forge_message_id =?", "Issue", User.current, @issue).first
query.update_attribute(:viewed, true) unless query.nil?
# issue 新建的at消息
User.current.at_messages.unviewed('Issue', @issue.id).each {|x| x.viewed!}
# 回复的at消息
@issue.journals.each do |j|
User.current.at_messages.unviewed('Journal', j.id).each {|x| x.viewed!}
end
# 缺陷状态更新
query_journals = @issue.journals
query_journals.each do |query_journal|
@ -145,24 +153,17 @@ class IssuesController < ApplicationController
@project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'#by young
@available_watchers = (@issue.project.users.sort + @issue.watcher_users).uniq
#id name email
#1. issues list persons
#2. project persons
@at_persons = @journals.map(&:user) + @issue.project.users
@at_persons = @at_persons.uniq{|u| u.id}.delete_if{|u| u.id == User.current.id}
@at_persons = nil
respond_to do |format|``
format.html {
retrieve_previous_and_next_issue_ids
render :template => 'issues/show', :layout => @project_base_tag#by young
}
format.api
format.atom { render :template => 'journals/index', :layout => false, :content_type => 'application/atom+xml' }
format.pdf {
pdf = issue_to_pdf(@issue, :journals => @journals)
send_data(pdf, :type => 'application/pdf', :filename => filename_for_content_disposition("#{@project.identifier}-#{@issue.id}.pdf") )
}
respond_to do |format|
format.html {
retrieve_previous_and_next_issue_ids
render :template => 'issues/show', :layout => @project_base_tag#by young
}
format.api
format.atom { render :template => 'journals/index', :layout => false, :content_type => 'application/atom+xml' }
format.pdf {
pdf = issue_to_pdf(@issue, :journals => @journals)
send_data(pdf, :type => 'application/pdf', :filename => filename_for_content_disposition("#{@project.identifier}-#{@issue.id}.pdf") )
}
end
end

View File

@ -120,15 +120,16 @@ class SchoolController < ApplicationController
condition.scan(/./).each_with_index do |char,index|
if char =~ /[a-zA-Z0-9]/
pinyin << char
elsif char =~ /\'/
else
chinese << char
end
end
if(condition == '')
@school = School.page((params[:page].to_i || 1) - 1).per(100)
@school = School.reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100)
@school_count = School.count
else
@school = School.where("name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").page((params[:page].to_i || 1) - 1).per(100)
@school = School.where("name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100)
@school_count = School.where("name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").count
end

View File

@ -1752,6 +1752,13 @@ module ApplicationHelper
#
def javascript_include_tag(*sources)
options = sources.last.is_a?(Hash) ? sources.pop : {}
@sources ||= []
sources = sources.delete_if do|source|
@sources.include?(source)
end
@sources += sources
if plugin = options.delete(:plugin)
sources = sources.map do |source|
if plugin
@ -1761,7 +1768,12 @@ module ApplicationHelper
end
end
end
super sources, options
if sources && !sources.empty?
super(sources, options)
else
''
end
end
def content_for(name, content = nil, &block)
@ -2712,18 +2724,11 @@ int main(int argc, char** argv){
end
def import_ke(default_opt={})
opt = {enable_at: true, prettify: false, init_activity: false}.merge default_opt
opt = {enable_at: false, prettify: false, init_activity: false}.merge default_opt
ss = ''
if opt[:enable_at]
ss = '<script type="text/javascript">'
ss += 'window.atPersonLists = [];'
@at_persons && @at_persons.each_with_index do |person,index|
ss += "var o = {id: #{index}, name: '#{person.show_name}', login: '#{person.login}', searchKey: '#{person.get_at_show_name}'};"
ss += "atPersonLists.push(o);"
end
ss += "</script>"
unless Setting.at_enabled?
opt[:enable_at] = false
end
ss += javascript_include_tag("/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg')

View File

@ -22,8 +22,10 @@ module ProjectScoreHelper
#代码提交数量
def changesets_num project
# commit_count(project)
project.changesets.count
g = Gitlab.client
project.gpid.nil? ? 0 : g.commits_total_count(project.gpid).count
# # commits_total_count(project.gpid)
# project.changesets.count
end
#讨论区帖子数量

View File

@ -89,7 +89,8 @@ module UsersHelper
forge_count = ForgeMessage.where("user_id =? and viewed =?", user, 0).count
user_feedback_count = UserFeedbackMessage.where("user_id =? and viewed =?", user, 0).count
user_memo_count = MemoMessage.where("user_id =? and viewed =?", user, 0).count
messages_count = course_count + forge_count + user_feedback_count + user_memo_count
at_count = user.at_messages.where(viewed: false).count
messages_count = course_count + forge_count + user_feedback_count + user_memo_count + at_count
end
def user_mail_notification_options(user)

102
app/models/at_message.rb Normal file
View File

@ -0,0 +1,102 @@
#coding=utf-8
class AtMessage < ActiveRecord::Base
belongs_to :user
belongs_to :sender, class_name: "User", foreign_key: "sender_id"
attr_accessible :at_message, :container, :viewed, :user_id, :sender_id
belongs_to :at_message, polymorphic: true
belongs_to :container, polymorphic: true
has_many :message_alls, :class_name => 'MessageAll',:as =>:message, :dependent => :destroy
validates :user_id, :sender_id, :at_message_id, :at_message_type, presence: true
after_create :add_user_message
scope :unviewed, ->(type, id){
where(at_message_type: type, at_message_id:id, viewed: false)
}
def viewed!
update_attribute :viewed, true
end
def at_valid?
return true if at_message_type == 'Issue'
return true if 'Journal' == at_message_type
return true if 'JournalsForMessage' == at_message_type
return true if 'Message' == at_message_type
false
end
def add_user_message
if MessageAll.where(message_type: self.class.name,message_id: self.id).empty?
self.message_alls << MessageAll.new(:user_id => self.user_id)
end
end
def subject
case at_message_type
when "Issue"
"新建问题: " + at_message.subject
when "Journal"
"问题留言: " + at_message.journalized.subject
when 'Message'
if(at_message.topic?)
"发布新帖: "
else
"回复帖子: "
end + at_message.subject
when 'JournalsForMessage'
"作业: #{at_message.jour.name} 中留言"
else
logger.error "error type: #{at_message_type}"
end
end
def description
case at_message_type
when "Issue"
at_message.description
when "Journal"
at_message.notes
when 'Message'
at_message.content
when "JournalsForMessage"
at_message.notes
else
logger.error "error type: #{at_message_type}"
end
end
def author
case at_message_type
when "Issue"
at_message.author
when "Journal"
at_message.user
when 'Message'
at_message.author
when 'JournalsForMessage'
at_message.user
else
logger.error "error type: #{at_message_type}"
end
end
def url
case at_message_type
when "Issue"
{controller: :issues, action: :show, id: at_message}
when "Journal"
{controller: :issues, action: :show, id: at_message.journalized}
when 'Message'
{controller: :boards, action: :show, project_id: at_message.board.project, id: at_message.board}
when 'JournalsForMessage'
{controller: :homework_common, action: :index, course: at_message.jour.course_id}
else
logger.error "error type: #{at_message_type}"
end
end
end

View File

@ -52,6 +52,7 @@ class Issue < ActiveRecord::Base
# ForgeMessage虚拟关联(多态)
has_many :forge_messages, :class_name => 'ForgeMessage',:as =>:forge_message ,:dependent => :destroy
has_many :at_messages, class_name: 'AtMessage', as: :at_message ,:dependent => :destroy
acts_as_nested_set :scope => 'root_id', :dependent => :destroy
acts_as_attachable :before_add => :attachment_added, :after_remove => :attachment_removed
@ -82,7 +83,7 @@ class Issue < ActiveRecord::Base
attr_reader :current_journal
# fq
after_create :act_as_activity,:be_user_score_new_issue,:act_as_forge_activity, :act_as_forge_message
after_create :act_as_activity,:be_user_score_new_issue,:act_as_forge_activity, :act_as_forge_message, :act_as_at_message
after_update :be_user_score
after_destroy :down_user_score
# after_create :be_user_score
@ -156,6 +157,14 @@ class Issue < ActiveRecord::Base
end
end
# at 功能添加消息提醒
def act_as_at_message
users = self.description.scan /<span class="at" data-user-id="(\d+?)">/m
users && users.flatten.uniq.each do |uid|
self.at_messages << AtMessage.new(user_id: uid, sender_id: self.author_id)
end
end
# 更新缺陷
#def act_as_forge_message_update
# unless self.author_id == self.assigned_to_id

View File

@ -28,10 +28,12 @@ class Journal < ActiveRecord::Base
has_one :journal_reply
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
# 被ForgeActivity虚拟关联
has_many :forge_acts, :class_name => 'ForgeActivity',:as =>:forge_act ,:dependent => :destroy
#has_many :forge_acts, :class_name => 'ForgeActivity',:as =>:forge_act ,:dependent => :destroy 评论不应该算入
# 被ForgeMessage虚拟关联
has_many :forge_messages, :class_name => 'ForgeMessage',:as =>:forge_message ,:dependent => :destroy
# end
has_many :at_messages, as: :at_message, dependent: :destroy
attr_accessor :indice
acts_as_event :title =>Proc.new {|o| status = ((s = o.new_status) ? " (#{s})" : nil); "#{o.issue.tracker} ##{o.issue.project_index}#{status}: #{o.issue.subject}" },
@ -50,7 +52,7 @@ class Journal < ActiveRecord::Base
before_create :split_private_notes
# fq
after_save :act_as_activity,:be_user_score,:act_as_forge_activity, :act_as_forge_message
after_save :act_as_activity,:be_user_score, :act_as_forge_message, :act_as_at_message
# end
#after_destroy :down_user_score
#before_save :be_user_score
@ -160,14 +162,14 @@ class Journal < ActiveRecord::Base
end
# end
# Time 2015-02-27 13:30:19
# Author lizanle
# Description 公共表中需要保存一份该记录
def act_as_forge_activity
self.forge_acts << ForgeActivity.new(:user_id => self.user_id,
:project_id => self.issue.project.id)
end
# # Time 2015-02-27 13:30:19
# # Author lizanle
# # Description 公共表中需要保存一份该记录
# def act_as_forge_activity
# self.forge_acts << ForgeActivity.new(:user_id => self.user_id,
# :project_id => self.issue.project.id)
#
# end
# 缺陷状态更改,消息提醒
def act_as_forge_message
@ -184,6 +186,13 @@ class Journal < ActiveRecord::Base
end
end
def act_as_at_message
users = self.notes.scan /<span class="at" data-user-id="(\d+?)">/m
users && users.flatten.uniq.each do |uid|
self.at_messages << AtMessage.new(user_id: uid, sender_id: self.user_id)
end
end
# 更新用户分数 -by zjc
def be_user_score
#新建了缺陷留言且留言不为空,不为空白

View File

@ -64,8 +64,10 @@ class JournalsForMessage < ActiveRecord::Base
has_many :course_messages, :class_name => 'CourseMessage',:as =>:course_message ,:dependent => :destroy
has_many :user_feedback_messages, :class_name => 'UserFeedbackMessage', :as =>:journals_for_message, :dependent => :destroy
has_many :at_messages, as: :at_message, dependent: :destroy
validates :notes, presence: true, if: :is_homework_jour?
after_create :act_as_activity, :act_as_course_activity, :act_as_course_message, :act_as_user_feedback_message, :act_as_principal_activity, :act_as_student_score
after_create :act_as_activity, :act_as_course_activity, :act_as_course_message, :act_as_at_message, :act_as_user_feedback_message, :act_as_principal_activity, :act_as_student_score
after_create :reset_counters!
after_destroy :reset_counters!
after_save :be_user_score
@ -240,6 +242,12 @@ class JournalsForMessage < ActiveRecord::Base
end
end
def act_as_at_message
users = self.notes.scan /<span class="at" data-user-id="(\d+?)">/m
users && users.flatten.uniq.each do |uid|
self.at_messages << AtMessage.new(user_id: uid, sender_id: self.user_id)
end
end
# 用户留言消息通知
def act_as_user_feedback_message
# 主留言

View File

@ -38,7 +38,7 @@ class Message < ActiveRecord::Base
# 课程/项目 消息
has_many :course_messages, :class_name =>'CourseMessage', :as => :course_message, :dependent => :destroy
has_many :forge_messages, :class_name => 'ForgeMessage', :as => :forge_message, :dependent => :destroy
#end
has_many :at_messages, as: :at_message, dependent: :destroy
has_many :ActivityNotifies,:as => :activity, :dependent => :destroy
@ -74,7 +74,7 @@ class Message < ActiveRecord::Base
after_update :update_messages_board
after_destroy :reset_counters!,:down_user_score,:delete_kindeditor_assets
after_create :act_as_activity,:act_as_course_activity,:be_user_score,:act_as_forge_activity, :act_as_system_message, :send_mail, :act_as_student_score
after_create :act_as_activity,:act_as_course_activity,:be_user_score,:act_as_forge_activity, :act_as_system_message, :send_mail, :act_as_student_score, :act_as_at_message
#before_save :be_user_score
scope :visible, lambda {|*args|
@ -96,6 +96,10 @@ class Message < ActiveRecord::Base
end
}
def topic?
parent_id.nil?
end
def visible?(user=User.current)
if project
!user.nil? && user.allowed_to?(:view_messages, project)
@ -237,6 +241,13 @@ class Message < ActiveRecord::Base
end
end
end
def act_as_at_message
users = self.content.scan /<span class="at" data-user-id="(\d+?)">/m
users && users.flatten.uniq.each do |uid|
self.at_messages << AtMessage.new(user_id: uid, sender_id: self.author_id)
end
end
#更新用户分数 -by zjc
def be_user_score

View File

@ -41,7 +41,7 @@ class News < ActiveRecord::Base
validates_presence_of :title, :description
validates_length_of :title, :maximum => 60
validates_length_of :summary, :maximum => 255
validates_length_of :description, :maximum => 10000
# validates_length_of :description, :maximum => 10000
acts_as_attachable :delete_permission => :manage_news
acts_as_searchable :columns => ['title', 'summary', "#{table_name}.description"], :include => :project

View File

@ -161,6 +161,7 @@ class User < Principal
has_many :user_feedback_messages
has_one :onclick_time
has_many :system_messages
has_many :at_messages
# 虚拟转换
has_many :new_jours, :as => :jour, :class_name => 'JournalsForMessage', :conditions => "status=1"
@ -400,16 +401,7 @@ class User < Principal
end
def show_name
name = ""
unless self.user_extensions.nil?
if self.user_extensions.identity == 2
name = firstname
else
name = lastname+firstname
end
else
name = lastname+firstname
end
name = lastname + firstname
name.empty? || name.nil? ? login : name
end
## end

View File

@ -0,0 +1,6 @@
[
<% @users && @users.each_with_index do |person,index| %>
{"id":<%=index%>, "userid": <%=person.id%>, "name": "<%=person.show_name%>", "login": "<%=person.login%>", "searchKey": "<%=person.get_at_show_name%>"}
<%= index != @users.size-1 ? ',' : '' %>
<% end %>
]

View File

@ -15,10 +15,10 @@
<label class="fl" >&nbsp;&nbsp;<%= l(:field_quote)%>&nbsp;&nbsp;</label>
<!--<textarea name="bid[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="hwork_text fl"></textarea>-->
<% if edit_mode %>
<%= f.kindeditor :description,:width=>'91%',:editor_id => 'bid_description_editor',:owner_id => bid.id,:owner_type =>OwnerTypeHelper::BID,:resizeType => 0 %>
<%= f.kindeditor :description,:width=>'91%',:editor_id => 'bid_description_editor',:owner_id => bid.id,:owner_type =>OwnerTypeHelper::BID,:resizeType => 0,act_id: @course.id, act_type: @course.class.to_s %>
<% else %>
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
<%= f.kindeditor :description,:width=>'91%',:editor_id => 'bid_description_editor',:resizeType => 0 %>
<%= f.kindeditor :description,:width=>'91%',:editor_id => 'bid_description_editor',:resizeType => 0, act_id: @course.id, act_type: @course.class.to_s %>
<% end %>
</li>
<div class="cl"></div>

View File

@ -1,5 +1,5 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false) %>
<%= import_ke(enable_at: true, prettify: false) %>
<%= javascript_include_tag 'blog' %>
<% end %>
@ -34,7 +34,9 @@
:class => 'talk_text fl',
:input_html => { :id => 'message_content',
:class => 'talk_text fl',
:maxlength => 5000 }%>
:maxlength => 5000 },
act_id: article.id, act_type: article.class.to_s
%>
<div class="cl"></div>
<p id="message_content_span"></p>
</div>

View File

@ -1,5 +1,5 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false) %>
<%= import_ke(enable_at: true, prettify: false) %>
<% end %>
<li>
<div style="display: none ;" class="fl"><label><span class="c_red">*</span>&nbsp;<%= l(:field_subject) %>&nbsp;&nbsp;</label></div>
@ -27,7 +27,9 @@
:minHeight=>100,
:input_html => { :id => 'message_content',
:class => 'talk_text fl',
:maxlength => 5000 }%>
:maxlength => 5000 },
at_id: article.id, at_type: article.class.to_s
%>
<div class="cl"></div>
<p id="message_content_span"></p>
</li>

View File

@ -3,7 +3,7 @@ if($("#reply_message_<%= @blogComment.id%>").length > 0) {
$(function(){
$('#reply_subject').val("<%= raw escape_javascript(@subject) %>");
$('#quote_quote').val("<%= raw escape_javascript(@temp.content.html_safe) %>");
init_activity_KindEditor_data(<%= @blogComment.id%>,null,"85%");
init_activity_KindEditor_data(<%= @blogComment.id%>,null,"85%", "<%=@blogComment.class.to_s%>");
});
}else if($("#reply_to_message_<%= @blogComment.id%>").length >0) {
$("#reply_to_message_<%= @blogComment.id%>").replaceWith("<p id='reply_message_<%= @blogComment.id%>'></p>");

View File

@ -1,7 +1,7 @@
<% if @in_user_center%>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity');
<% else%>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'blogs/article', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity');
<% end %>

View File

@ -27,7 +27,7 @@
}
}
$(function() {
init_activity_KindEditor_data(<%= @article.id%>,null,"85%");
init_activity_KindEditor_data(<%= @article.id%>,null,"85%", '<%=@article.class.to_s%>');
showNormalImage('message_description_<%= @article.id %>');
});
</script>

View File

@ -74,7 +74,7 @@
}
$(function () {
init_activity_KindEditor_data(<%= topic.id%>, null, "87%");
init_activity_KindEditor_data(<%= topic.id%>, null, "87%", "<%=topic.class.to_s%>");
showNormalImage('activity_description_<%= topic.id %>');
/*var description_images=$("div#activity_description_<%#= topic.id %>").find("img");
if (description_images.length>0) {

View File

@ -1,5 +1,5 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false) %>
<%= import_ke(enable_at: true, prettify: false) %>
<% end %>
<%= error_messages_for 'message' %>
@ -34,7 +34,9 @@
:class => 'talk_text fl',
:input_html => { :id => 'message_content',
:class => 'talk_text fl',
:maxlength => 5000 }%>
:maxlength => 5000 },
at_id: topic.id, at_type: topic.class.to_s
%>
<div class="cl"></div>
<p id="message_content_span"></p>
</div>

View File

@ -1,20 +1,3 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false) %>
<%= javascript_include_tag "init_activity_KindEditor" %>
<% end %>
<style type="text/css">
/*回复框*/
.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}
.homepagePostReplyInputContainer .ke-toolbar-icon {line-height: 26px; font-size: 14px; padding-left: 26px;}
.homepagePostReplyInputContainer .ke-toolbar-icon-url {background-image: url(/images/public_icon.png)}
.homepagePostReplyInputContainer .ke-outline {padding: 0px 0px; line-height: 26px; font-size: 14px;}
.homepagePostReplyInputContainer .ke-icon-emoticons {background-position: 0px -671px; width: 50px; height: 26px;}
.homepagePostReplyInputContainer .ke-icon-emoticons:hover {background-position: -79px -671px; width: 50px; height: 26px;}
.homepagePostReplyInputContainer .ke-outline {border: none;}
.homepagePostReplyInputContainer .ke-inline-block {display: none;}
.homepagePostReplyInputContainer .ke-container {float: left;}
</style>
<script type="text/javascript">
$(function(){
$("#RSide").removeAttr("id");
@ -45,61 +28,8 @@
<% if User.current.logged? %>
<%= labelled_form_for @message, :url =>{:controller=>'messages',:action => 'new', :board_id => @board.id, :is_board => 'true'},
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'course_new', :locals => {:f => f, :topic => @message, :edit_mode => false, :course => course} %>
<%= render :partial => 'course_new', :locals => {:f => f, :topic => @message, :edit_mode => false, :course => @board.course} %>
<% end %>
<% end %>
<% if topics%>
<% topics.each do |topic| %>
<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 expand_reply_input(id) {
$(id).toggle();
}
$(function () {
init_activity_KindEditor_data(<%= topic.id%>, null, "87%");
showNormalImage('activity_description_<%= topic.id %>');
/*var description_images=$("div#activity_description_<%#= topic.id %>").find("img");
if (description_images.length>0) {
for (var i=0; i<description_images.length; i++){
var image=$(description_images[i]);
var element=$("<a></a>").attr("href",image.attr('src'));
image.wrap(element);
}
}
$('#activity_description_<%#= topic.id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false});*/
});
</script>
<% if topic %>
<%= render :partial => 'users/course_message', :locals => {:activity => topic, :user_activity_id => topic.id} %>
<% end %>
<% end %>
<% if topics.count == 10 %>
<div id="show_more_course_topic" class="loadMore mt10 f_grey">展开更多<%= link_to "", boards_topic_path(@board, :course_id => @board.course.id ,:page => page), :id => "more_topic_link", :remote => "true", :class => "none" %></div>
<% end %>
<% end%>
<%= render :partial=> 'course_show_detail',:locals =>{:topics => @topics, :page => 0} %>
</div>
<script type="text/javascript">
$("#show_more_course_topic").mouseover(function () {
$("#more_topic_link").click();
});
</script>

View File

@ -0,0 +1,70 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false) %>
<%= javascript_include_tag "init_activity_KindEditor" %>
<% end %>
<style type="text/css">
/*回复框*/
.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}
.homepagePostReplyInputContainer .ke-toolbar-icon {line-height: 26px; font-size: 14px; padding-left: 26px;}
.homepagePostReplyInputContainer .ke-toolbar-icon-url {background-image: url(/images/public_icon.png)}
.homepagePostReplyInputContainer .ke-outline {padding: 0px 0px; line-height: 26px; font-size: 14px;}
.homepagePostReplyInputContainer .ke-icon-emoticons {background-position: 0px -671px; width: 50px; height: 26px;}
.homepagePostReplyInputContainer .ke-icon-emoticons:hover {background-position: -79px -671px; width: 50px; height: 26px;}
.homepagePostReplyInputContainer .ke-outline {border: none;}
.homepagePostReplyInputContainer .ke-inline-block {display: none;}
.homepagePostReplyInputContainer .ke-container {float: left;}
</style>
<% if topics%>
<% topics.each do |topic| %>
<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 expand_reply_input(id) {
$(id).toggle();
}
$(function () {
init_activity_KindEditor_data(<%= topic.id%>, null, "87%");
showNormalImage('activity_description_<%= topic.id %>');
/*var description_images=$("div#activity_description_<%#= topic.id %>").find("img");
if (description_images.length>0) {
for (var i=0; i<description_images.length; i++){
var image=$(description_images[i]);
var element=$("<a></a>").attr("href",image.attr('src'));
image.wrap(element);
}
}
$('#activity_description_<%#= topic.id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false});*/
});
</script>
<% if topic %>
<%= render :partial => 'users/course_message', :locals => {:activity => topic, :user_activity_id => topic.id} %>
<% end %>
<% end %>
<% if topics.count == 10 %>
<div id="show_more_course_topic" class="loadMore mt10 f_grey">展开更多<%= link_to "", boards_topic_path(@board, :course_id => @board.course.id ,:page => page), :id => "more_topic_link", :remote => "true", :class => "none" %></div>
<% end %>
<% end%>
<script type="text/javascript">
$("#show_more_course_topic").mouseover(function () {
$("#more_topic_link").click();
});
</script>

View File

@ -20,7 +20,7 @@
<% end %>
<div class="cl"></div>
<div class=" talklist_box" >
<div class="talk_new ml15 mb10" nhname="about_talk" style="display:none;">
<div class="talk_new ml15 mb10" nhname="about_talk" data-at-id="<%= project.id %>" data-at-type="Project" style="display:none;">
<ul>
<%= render :partial => 'project_new_topic' %>
</ul>
@ -111,7 +111,7 @@
<a href="javascript:void(0)" nhname="showbtn_reply" class="c_dblue fr f14" style="margin-right:10px;"><%= l(:button_reply) %></a>
<% end %>
<div class="cl"></div>
<div class="talk_new ml15 mb10" nhname='about_talk' id="about_newtalk<%=topic.id%>" style="display: none;border-top: 1px dashed #d9d9d9;padding-top:5px;margin-left:0px;padding-left:15px;">
<div class="talk_new ml15 mb10" nhname='about_talk' id="about_newtalk<%=topic.id%>" data-at-id="<%= topic.id %>" data-at-type="<%= topic.class.name %>" style="display: none;border-top: 1px dashed #d9d9d9;padding-top:5px;margin-left:0px;padding-left:15px;">
<ul>
<%= render :partial => 'edit',locals: {:topic => topic} %>
</ul>
@ -120,7 +120,7 @@
<div class="talkWrapBox">
<% reply = Message.new(:subject => "RE: #{topic.subject}")%>
<% if !topic.locked? && authorize_for('messages', 'reply') %>
<div class="talkWrapMsg" nhname="about_talk_reply" style="display: none;">
<div class="talkWrapMsg" nhname="about_talk_reply" data-at-id="<%= topic.id %>" data-at-type="<%= topic.class.name %>" style="display: none;">
<em class="talkWrapArrow"></em>
<div class="cl"></div>
<div class="talkConIpt ml15 mb10" style="margin-left:30px;" id="reply<%= topic.id %>">

View File

@ -28,7 +28,7 @@
window.attachEvent("onload", buildsubmenus)
</script>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false) %>
<%= import_ke(enable_at: true, prettify: false) %>
<% end %>
@ -102,6 +102,10 @@ function nh_init_board(params){
if(/trident/.test(userAgent)){
$("div.talk_new .ke-container").css({'margin-left':'0px'});
}
if(typeof enableAt === 'function'){
enableAt(this,params.about_talk.attr('data-at-id'), params.about_talk.attr('data-at-type'));
}
// var toolbar = $("div[class='ke-toolbar']",params.about_talk);
// $(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
// params.toolbar_container.append(toolbar);

View File

@ -1 +1 @@
$("#show_more_course_topic").replaceWith("<%= escape_javascript( render :partial => 'boards/course_show',:locals => {:topics => @topics, :page => @page} )%>");
$("#show_more_course_topic").replaceWith("<%= escape_javascript( render :partial => 'boards/course_show_detail',:locals => {:topics => @topics, :page => @page} )%>");

View File

@ -3,4 +3,4 @@ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(r
<% 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%");
init_activity_KindEditor_data('<%= @user_activity_id%>',"","87%", "UserActivity");

View File

@ -1,5 +1,5 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
<% end %>
<style type="text/css">
@ -19,7 +19,7 @@
}
span.ke-toolbar-icon-url {
background-image: url(/images/public_icon.png)
background-image: url("/images/public_icon.png")
}
div.ke-toolbar .ke-outline {
@ -72,7 +72,7 @@
}
$(function () {
init_activity_KindEditor_data(<%= activity.id%>, null, "87%");
init_activity_KindEditor_data(<%= activity.id%>, null, "87%", "<%= activity.class.to_s %>");
showNormalImage('activity_description_<%= activity.id %>');
if($("#intro_content_<%= activity.id %>").height() > 360) {
$("#intro_content_show_<%= activity.id %>").show();

View File

@ -12,7 +12,10 @@
div.recall_con .reply_btn{margin-left:525px;margin-top:5px;}
/*.ke-container{height: 80px !important;}*/
</style>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_KindEditor" %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
<%= javascript_include_tag "init_KindEditor" %>
<% end %>
<script >
init_KindEditor_data('',80);
</script>

View File

@ -1,6 +1,6 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
<%= javascript_include_tag 'blog' %>
<% end %>
@ -40,7 +40,7 @@
}
}
$(function() {
init_activity_KindEditor_data(<%= @article.id%>,null,"87%");
init_activity_KindEditor_data(<%= @article.id%>,null,"87%", "<%=@article.class.to_s%>");
showNormalImage('message_description_<%= @article.id %>');
});
</script>

View File

@ -75,6 +75,9 @@
<li class="hworkList130 c_grey student_work_<%= exercise.id%>">
<% if exercise.created_at%>
<%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>&nbsp;
<% if @exercise.end_time <= exercise.created_at %>
<span class="c_red">[未答]</span>
<% end %>
<% end %>
</li>

View File

@ -9,7 +9,7 @@
<%= form_tag(org_subfield_files_path(org_subfield, :in_org => params[:in_org]), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %>
<% if params[:in_org] %>
<div class="c_dark">
<input name="org_subfield_attachment_type[]" type="checkbox" value="2" class="c_dblue">软件</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="org_subfield_attachment_type[]" type="checkbox" value="2" checked class="c_dblue">软件</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="org_subfield_attachment_type[]" type="checkbox" value="3" class="c_dblue">媒体</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="org_subfield_attachment_type[]" type="checkbox" value="4" class="c_dblue">代码</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="org_subfield_attachment_type[]" type="checkbox" value="5" class="c_dblue">其他</input></a>

View File

@ -1,5 +1,5 @@
<div class="markPopup" id="popbox02">
<%= form_for('new_form',:url => {:controller => 'homework_common',:action => 'set_evaluation_attr',:homework => @homework.id},:method => "post",:remote => true) do |f|%>
<%= form_for('new_form',:url => {:controller => 'homework_common',:action => 'set_evaluation_attr',:homework => @homework.id,:user_activity_id=>user_activity_id,:is_in_course=>is_in_course,:course_activity=>course_activity},:method => "post",:remote => true) do |f|%>
<span class="uploadText">匿评设置</span>
<div class="cl"></div>

View File

@ -1 +1,8 @@
clickCanel();
clickCanel();
<% if @user_activity_id != -1 %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@courae_activity}) %>");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
<% else %>
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework,:is_in_course => @is_in_course}) %>");
init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>");
<% end %>

View File

@ -2,10 +2,12 @@
alert('启动成功');
<% if @user_activity_id == -1 %>
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>");
init_activity_KindEditor_data(<%= @homework.id%>,"","87%");
$("#evaluation_start_time_<%=@homework.id %>").html("匿评开启时间:<%=format_time(Time.now) %>");
init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>");
<% else %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
$("#evaluation_start_time_<%=@user_activity_id %>").html("匿评开启时间:<%=format_time(Time.now) %>");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
<% end %>
/*$("#<%#= @homework.id %>_start_anonymous_comment").replaceWith('<%#= escape_javascript(link_to "关闭匿评", alert_anonymous_comment_homework_common_path(@homework), remote: true, id:"#{@homework.id}_stop_anonymous_comment",:class => "postOptionLink")%>');*/
<% elsif @statue == 2 %>

View File

@ -1,4 +1,4 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_common/set_evalutation_att') %>');
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_common/set_evalutation_att',:locals => {:user_activity_id => @user_activity_id,:is_in_course => @is_in_course,:course_activity =>@course_activity,:remote=>true}) %>');
var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: 0, showOn: 'button', buttonImageOnly: true, buttonImage: '/images/public_icon.png', showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true};
showModal('ajax-modal', '350px');
$('#ajax-modal').siblings().remove();

View File

@ -1,10 +1,12 @@
alert('关闭成功');
<% if @user_activity_id == -1 %>
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>");
init_activity_KindEditor_data(<%= @homework.id%>,"","87%");
$("#evaluation_end_time_<%=@homework.id %>").html("匿评关闭时间:<%=format_time(Time.now) %>");
init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>");
<% else %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
$("#evaluation_end_time_<%=@user_activity_id %>").html("匿评关闭时间:<%=format_time(Time.now) %>");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity');
<% end %>
/*
$("#<%#= @homework.id %>_stop_anonymous_comment").replaceWith('');*/

View File

@ -3,7 +3,20 @@
<%= link_to image_tag(url_to_avatar(@issue.author), :width => 46, :height => 46), user_path(@issue.author), :class => "ping_dispic" %>
</div>
<div class="talk_txt fl">
<p class="pro_page_tit" style="word-break:break-all;"> <span class="issues fl fl" title="缺陷"></span> <span style="padding-left: 5px;"><%= @issue.subject %></span>
<p class="pro_page_tit" style="word-break:break-all;">
<% case @issue.tracker_id %>
<% when 1%>
<span class="issues fl" title="缺陷"></span>
<% when 2%>
<span class="function fl" title="功能"></span>
<% when 3%>
<span class="support fl" title="支持"></span>
<% when 4%>
<span class="duty fl" title="任务"></span>
<% when 5%>
<span class="weekly fl" title="周报"></span>
<% end %>
</span> <span style="padding-left: 5px;"><%= @issue.subject %></span>
<span class='<%= "#{get_issue_priority(@issue.priority_id)[0]} " %>'><%= get_issue_priority(@issue.priority_id)[1] %></span></p>
<br>
<div class="cl"></div>

View File

@ -1,9 +1,8 @@
<div id="issue_edit" style="display: none">
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
<% end %>
<%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true,:remote=>true} do |f| %>
<%= error_messages_for 'issue', 'time_entry' %>
<%= render :partial => 'conflict' if @conflict %>
@ -21,9 +20,23 @@
</div>
<input name="issue_quote_new" type="hidden" value="<%= %>" />
<!--<fieldset><legend>回复</legend>-->
<%#= f.kindeditor :notes, :style => "width:99%;",:height=>'100px', :cssData =>"blockquote { padding:0px}", :rows => "5", :no_label => true, :editor_id=>'issue_journal_kind_reply', at_id: @issue.id, at_type: @issue.class.to_s %>
<!--</fieldset>-->
<!--<%# if @issue.safe_attribute? 'private_notes' %>-->
<!--<label for="issue_private_notes"><%#= f.check_box :private_notes, :no_label => true %> <%#= l(:field_private_notes) %></label>-->
<!--<%# end %>-->
<%= call_hook(:view_issues_edit_notes_bottom, {:issue => @issue, :notes => @notes, :form => f}) %>
<!--</fieldset>-->
<!--<fieldset><legend><%#= l(:label_attachment_plural) %></legend>-->
<!--<p style="padding-top: 5px;"><%#= render :partial => 'attachments/new_form', :locals => {:container => @issue} %>
<!--</fieldset>-->
<div class="cl"></div>
<%= f.hidden_field :lock_version %>
<%= hidden_field_tag 'last_journal_id', params[:last_journal_id] || @issue.last_journal_id %>
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id] %>
<% end %>
</div>
</div>

View File

@ -49,7 +49,7 @@
<%= f.label_for_field :description, :required => @issue.required_attribute?('description'), :no_label => true, :class => "label" %>
<%#= link_to_function image_tag('edit.png'), '$(this).hide(); $("#issue_description_and_toolbar").show()' unless @issue.new_record? %>
<%#= content_tag 'span', :id => "issue_description_and_toolbar" do %>
<%= f.kindeditor :description,:editor_id => "issue_desc_editor", :width=>'85%', :resizeType => 0, :no_label => true %>
<%= f.kindeditor :description,:editor_id => "issue_desc_editor", :width=>'87%', :resizeType => 0, :no_label => true,at_id: @project.id, at_type: @project.class.to_s %>
<%# end %>
<%#= wikitoolbar_for 'issue_description' %>
<% end %>
@ -103,4 +103,4 @@
<%= call_hook(:view_issues_form_details_bottom, {:issue => @issue, :form => f}) %>
<% end %>
<a href="javascript:void(0);" onclick="issue_desc_editor.sync();$('#issue-form').submit();" class="blue_btn fl ml80"> 确定</a>
<a href="javascript:void(0);" onclick="issueDetailShow();" class="grey_btn fl mr50" > 取消 </a>
<a href="javascript:void(0);" onclick="issueDetailShow();" class="grey_btn fl mr50" > 取消 </a>

View File

@ -17,7 +17,7 @@
<% else %>
<%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(reply.created_on) %>
<%#= format_time(reply.created_on) %>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
<% if reply.details.any? %>

View File

@ -18,7 +18,7 @@
}
$(function () {
init_activity_KindEditor_data(<%= issue.id%>, null, "87%");
init_activity_KindEditor_data(<%= issue.id%>, null, "87%", "<%= issue.class.name %>");
showNormalImage('activity_description_<%= issue.id %>');
if ($("#intro_content_<%= issue.id %>").height() > 360) {
$("#intro_content_show_<%= issue.id %>").show();

View File

@ -4,6 +4,6 @@
sd_create_editor_from_data(<%= @issue.id%>, null, "100%");
<%else%>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id}) %>");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity');
// sd_create_editor_from_data(<%#= @issue.id%>, null, "100%");
<%end %>
<%end %>

View File

@ -1,3 +1,3 @@
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id}) %>");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");

View File

@ -1,5 +1,5 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
<% end %>
<script type="text/javascript">
$(function(){
@ -20,10 +20,10 @@
<div>
<%= render :partial => 'issues/form', :locals => {:f => f} %>
</div>
<!--<%= javascript_tag "$('#issue_subject').focus();" %>-->
<a href="#" class="blue_btn fl ml80" onclick="issue_desc_editor.sync();$('#issue-form').submit();">
<%= l(:button_create) %>
</a>
<!--<%#= javascript_tag "$('#issue_subject').focus();" %>-->
<!--<a href="#" class="blue_btn fl ml80" onclick="issue_desc_editor.sync();$('#issue-form').submit();">-->
<!--<%#= l(:button_create) %>-->
<!--</a>-->
<%#= preview_link preview_new_issue_path(:project_id => @project), 'issue-form', 'preview', {:class => "blue_btn fl ml10"} %>
<% end %>
<div id="preview" class="wiki"></div>

View File

@ -1,9 +1,9 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false) %>
<%= import_ke(enable_at: true) %>
<%= javascript_include_tag 'create_kindeditor'%>
<% end %>
<script>
sd_create_editor_from_data(<%= @issue.id%>, null, "100%");
sd_create_editor_from_data(<%= @issue.id%>, null, "100%", "<%= @issue.class.name %>");
</script>
<script type="text/javascript">
$(function(){

View File

@ -12,12 +12,25 @@ issue_desc_editor = KindEditor.create('#issue_description',
{"width":"85%",
"resizeType":0,
"no_label":true,
"at_id":<%= @issue.project_id%>,
"at_type":"Project",
"autoHeightMode":true,
"afterCreate":"eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);} if(typeof enableAt ==='function'){enableAt(self);} this.loadPlugin(\"autoheight\")})",
"emotionsBasePath":"http://localhost:3000","height":300,
"afterCreate":"eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);};if(typeof enableAt ==='function'){enableAt(self, \"<%=@issue.project_id %>\", 'Project');}; this.loadPlugin('autoheight')})",
"emotionsBasePath":'<%= Setting.host_name%>',
"height":300,
"allowFileManager":true,
"uploadJson":"/kindeditor/upload",
"fileManagerJson":"/kindeditor/filemanager"});
//issue_desc_editor = KindEditor.create('#issue_description',
// {"width":"85%",
// "resizeType":0,
// "no_label":true,
// "autoHeightMode":true,
// "afterCreate":"eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);} if(typeof enableAt ==='function'){enableAt(self);} this.loadPlugin(\"autoheight\")})",
// "emotionsBasePath":"http://localhost:3000","height":300,
// "allowFileManager":true,
// "uploadJson":"/kindeditor/upload",
// "fileManagerJson":"/kindeditor/filemanager"});
<%else%>
alert('<%= @issue.errors.full_messages[0].to_s%>')
<%end %>

View File

@ -34,7 +34,7 @@
}
}
$(function() {
init_activity_KindEditor_data(<%= @memo.id%>,null,"87%");
init_activity_KindEditor_data(<%= @memo.id%>,null,"87%", "<%=@memo.class.to_s%>");
});
function del_confirm(){

View File

@ -27,7 +27,7 @@
}
}
$(function() {
init_activity_KindEditor_data(<%= @topic.id%>,null,"85%");
init_activity_KindEditor_data(<%= @topic.id%>,null,"85%", "<%=@topic.class.to_s%>");
showNormalImage('message_description_<%= @topic.id %>');
});
</script>

View File

@ -11,7 +11,7 @@ if($("#reply_message_<%= @message.id%>").length > 0) {
$(function(){
$('#reply_subject').val("<%= raw escape_javascript(@subject) %>");
$('#quote_quote').val("<%= raw escape_javascript(@temp.content.html_safe) %>");
init_activity_KindEditor_data(<%= @message.id%>,null,"85%");
init_activity_KindEditor_data(<%= @message.id%>,null,"85%", "<%=@message.class.to_s%>");
});
}else if($("#reply_to_message_<%= @message.id%>").length >0) {
$("#reply_to_message_<%= @message.id%>").replaceWith("<p id='reply_message_<%= @message.id%>'></p>");

View File

@ -3,4 +3,4 @@
<%elsif @course%>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>");
<%end%>
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");

View File

@ -642,45 +642,45 @@
$("#hint").hide();
}
});
// $("input[name='province']").on('focus', function (e) {
// if($(e.target).val() == ''){ //
// return;
// }
// if( $("input[name='occupation']").val() != ''){ //如果已经有id了。肯定存在不用去找了。
// return;
// }
//
// $.ajax({
// url: '<%#= url_for(:controller => 'school',:action => 'on_search') %>' + '?name=' + e.target.value,
// type: 'post',
// success: function (data) {
// if(data.length != undefined && data.length != 0) {
// var i = 0;
// $("#search_school_result_list").html('');
// for (; i < data.length; i++) {
// link = '<a onclick="window.changeValue(\'' + data[i].school.name.replace(/\s/g," ") + '\',\'' + data[i].school.id + '\')" href="javascript:void(0)">' + data[i].school.name + '</a><br/>';
// $("#search_school_result_list").append(link);
// }
// $("#search_school_result_list").css('left', $(e.target).offset().left);
// $("#search_school_result_list").css('top', $(e.target).offset().top + 28);
// $("#search_school_result_list").css("position", "absolute");
// $("#search_school_result_list").show();
// if ($(e.target).val().trim() != '') {
// str = e.target.value.length > 8 ? e.target.value.substr(0, 6) + "..." : e.target.value;
// $("#hint").html('找到了' + data.length + '个包含"' + str + '"的高校');
// $("#hint").show();
// } else {
// $("#hint").hide();
// }
// }else {
// $("#search_school_result_list").html('');
// str = e.target.value.length > 4 ? e.target.value.substr(0, 4)+"..." : e.target.value;
// $("#hint").html('没有找到包含"'+str+'"的高校,<a style="color:#64bdd9" onclick="add_school(\''+ e.target.value+'\');" href="javascript:void(0);">创建高校</a>');
// $("#hint").show();
// }
// }
// });
// });
$("input[name='province']").on('focus', function (e) {
if( $("input[name='occupation']").val() != ''){ //如果已经有id了。肯定存在不用去找了。
return;
}
$.ajax({
url: '<%= url_for(:controller => 'school',:action => 'on_search') %>' + '?name=' + e.target.value+'&page='+page,
type: 'post',
success: function (data) {
schoolsResult = data.schools;
count = data.count;
maxPage = Math.ceil(count/100) //最大页码值
if(schoolsResult.length != undefined && schoolsResult.length != 0) {
var i = 0;
$("#search_school_result_list").html('');
for (; i < schoolsResult.length; i++) {
link = '<a onclick="window.changeValue(\'' + schoolsResult[i].school.name.replace(/\s/g," ") + '\',\'' + schoolsResult[i].school.id + '\')" href="javascript:void(0)">' + schoolsResult[i].school.name + '</a><br/>';
$("#search_school_result_list").append(link);
}
$("#search_school_result_list").css('left', $(e.target).offset().left);
$("#search_school_result_list").css('top', $(e.target).offset().top + 28);
$("#search_school_result_list").css("position", "absolute");
$("#search_school_result_list").show();
if($(e.target).val().trim() != '') {
str = e.target.value.length > 8 ? e.target.value.substr(0, 6)+"..." : e.target.value;
$("#hint").html('找到了' + count + '个包含"' + str + '"的高校');
$("#hint").show();
}else{
$("#hint").hide();
}
}else{
$("#search_school_result_list").html('');
str = e.target.value.length > 4 ? e.target.value.substr(0, 4)+"..." : e.target.value;
$("#hint").html('没有找到包含"'+str+'"的高校,<a style="color:#64bdd9" onclick="add_school(\''+ e.target.value+'\');" href="javascript:void(0);">创建高校</a>');
$("#hint").show();
}
}
});
});
// $("#province").leanModal({top: 100, closeButton: ".modal_close"});

View File

@ -1,2 +1,2 @@
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");

View File

@ -1,3 +1,2 @@
$("#organization_document_<%= @act.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document,:flag => params[:flag], :act => @act}) %>");
init_activity_KindEditor_data(<%= @act.id %>,"","87%");
init_activity_KindEditor_data(<%= @act.id %>,"","87%", "<%=@act.class.to_s%>");

View File

@ -15,7 +15,7 @@
}
}
</script>
<div class="homepageRightBanner mb5">
<div class="homepageRightBanner mb5" style="margin-bottom:5px;">
<div class="NewsBannerName">编辑文章</div>
</div>
<div class="cl"></div>

View File

@ -19,7 +19,7 @@
<% @documents.each do |document| %>
<script>
$(function() {
init_activity_KindEditor_data(<%= OrgActivity.where("org_act_type='OrgDocumentComment'and org_act_id=?", document.id).first.id %>, null, "87%");
init_activity_KindEditor_data(<%= OrgActivity.where("org_act_type='OrgDocumentComment'and org_act_id=?", document.id).first.id %>, null, "87%", "OrgActivity");
});
</script>
<%= 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} %>

View File

@ -3,7 +3,7 @@ if($("#reply_message_<%= @org_comment.id%>").length > 0) {
$(function(){
$('#reply_subject').val("<%= raw escape_javascript(@subject) %>");
$('#quote_quote').val("<%= raw escape_javascript(@temp.content.html_safe) %>");
init_activity_KindEditor_data(<%= @org_comment.id%>,null,"85%");
init_activity_KindEditor_data(<%= @org_comment.id%>,null,"85%", "<%=@org_comment.class.to_s%>");
});
}else if($("#reply_to_message_<%= @org_comment.id %>").length >0) {
$("#reply_to_message_<%= @org_comment.id%>").replaceWith("<p id='reply_message_<%= @org_comment.id %>'></p>");

View File

@ -1,7 +1,7 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor",'blog' %>
<script>
$(function() {
init_activity_KindEditor_data(<%= @document.id%>,null,"85%");
init_activity_KindEditor_data(<%= @document.id%>,null,"85%", "<%=@document.class.to_s%>");
showNormalImage('message_description_<%= @document.id %>');
});
</script>

View File

@ -87,10 +87,10 @@
url: "/organizations/"+orgId + "/join_courses?" + $("#join_courses_form").serialize(),
type: "post",
success: function (data) {
$.ajax({
url: "/organizations/" + orgId + "/search_courses?name=" + $("input[name='courses']").val().trim(),
type: "get"
});
// $.ajax({
// url: "/organizations/" + orgId + "/search_courses?name=" + $("input[name='courses']").val().trim(),
// type: "get"
// });
}
});
}

View File

@ -83,10 +83,10 @@
url: "/organizations/"+orgId + "/join_projects?" + $("#join_projects_form").serialize(),
type: "post",
success: function (data) {
$.ajax({
url: "/organizations/" + orgId + "/search_projects?name=" + $("input[name='projects']").val().trim(),
type: "get"
});
// $.ajax({
// url: "/organizations/" + orgId + "/search_projects?name=" + $("input[name='projects']").val().trim(),
// type: "get"
// });
}
});
}

View File

@ -2,7 +2,7 @@
<% org_activities.each do |act| %>
<script>
$(function() {
init_activity_KindEditor_data(<%= act.id%>, null, "87%");
init_activity_KindEditor_data(<%= act.id%>, null, "87%", "<%=act.class.to_s%>");
});
</script>
<% if act.container_type == 'Organization' %>

View File

@ -1,5 +1,5 @@
<%= stylesheet_link_tag 'courses' %>
<div class="resources mt10">
<div class="resources">
<div class="project_r_h" style="width: 720px;">
<h2 class="project_h2"> 组织成员</h2>
</div>

View File

@ -4,7 +4,7 @@ $('#ajax-modal').html('<%= escape_javascript(render :partial => 'join_course_men
showModal('ajax-modal', '320px');
$('#ajax-modal').siblings().hide();
$('#ajax-modal').before(
"<a href='javascript:' onclick='hideModal();location.reload();' class='resourceClose' style='margin-left: 300px;'></a>");
"<a href='javascript:' onclick='hideModal();' class='resourceClose' style='margin-left: 300px;'></a>");
//$('#ajax-modal').css('position','absolute')
$('#ajax-modal').css("top","").css("left","");
$('#ajax-modal').parent().addClass("resourceSharePopup");

View File

@ -1,6 +1,7 @@
$("#homepageLeftMenuCourses").html("");
$("#homepageLeftMenuCourses").append("<ul>");
$("#homepageLeftMenuCourses").append("<%= escape_javascript(render :partial => 'layouts/org_courses',
//$("#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").show();
//$("#homepageLeftMenuCourses").append("</ul>");
//$("#homepageLeftMenuCourses").show();
location.reload();

View File

@ -4,7 +4,7 @@ $('#ajax-modal').html('<%= escape_javascript(render :partial => 'join_project_me
showModal('ajax-modal', '320px');
$('#ajax-modal').siblings().hide();
$('#ajax-modal').before(
"<a href='javascript:' onclick='hideModal();location.reload();' class='resourceClose' style='margin-left: 300px;'></a>");
"<a href='javascript:' onclick='hideModal();' class='resourceClose' style='margin-left: 300px;'></a>");
//$('#ajax-modal').css('position','absolute');
$('#ajax-modal').css("top","").css("left","");
$('#ajax-modal').parent().addClass("resourceSharePopup");

View File

@ -1,6 +1,7 @@
$("#homepageLeftMenuProjects").html("");
$("#homepageLeftMenuProjects").append("<ul>");
$("#homepageLeftMenuProjects").append("<%= escape_javascript(render :partial => 'layouts/org_projects',
//$("#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").show();
//$("#homepageLeftMenuProjects").append("</ul>");
//$("#homepageLeftMenuProjects").show();
location.reload();

View File

@ -61,7 +61,7 @@
<% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 and params[:org_subfield_id].nil? %>
<script>
$(function() {
init_activity_KindEditor_data(<%= OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?",@organization.home_id).first.id %>, null, "87%");
init_activity_KindEditor_data(<%= OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?",@organization.home_id).first.id %>, null, "87%", 'OrgActivity');
});
</script>
<% act = OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?", @organization.home_id).first %>

View File

@ -20,7 +20,7 @@
<div class="homepagePostDate">
发布时间:<%= format_time(activity.created_on) %>
</div>
<p class="mt5 break_word"><%= textAreailizable act, :description %><br/></p>
<p class="mt5 break_word"><%= textAreailizable activity, :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 %>

View File

@ -1,4 +1,4 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor", '/assets/kindeditor/pasteimg', "init_activity_KindEditor" %>
<%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
<style type="text/css">
/*回复框*/
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
@ -32,7 +32,7 @@
}
$(function () {
init_activity_KindEditor_data(<%= activity.id%>, null, "87%");
init_activity_KindEditor_data(<%= activity.id%>, null, "87%", "<%= activity.class.to_s %>");
showNormalImage('activity_description_<%= activity.id %>');
if ($("#intro_content_<%= activity.id %>").height() > 360) {
$("#intro_content_show_<%= activity.id %>").show();

View File

@ -22,12 +22,12 @@
<% else %>
<%= render :partial => 'navigation' %>
<div class="fl c_grey02 mt5 mr5">克隆网址:</div>
<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>
<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>
<%# 针对公开项目:用户必须创建了项目,否则用户无法同步 %>
<% if User.current.id != @project.user_id %>
<div class="fr mt5"><%= link_to "<span class='vl_fork'></span>".html_safe+"Fork", {:controller => 'repositories', :action => 'forked'}, :class=>"vl_btn"%>
<div class="fr mt5"><%= link_to "<span class='vl_fork'></span>".html_safe+"Fork", {:controller => 'repositories', :action => 'forked'}, :class=>"vl_btn", :confirm=>"平台将为您创建一个新的同名项目和版本库,请问是否继续?" %>
<span href="javascript:void(0);" class="vl_btn_2 fb"><%= @project.forked_count.to_i %></span>
</div>
<% end %>

View File

@ -1,3 +1,4 @@
<% if @homework.homework_detail_group %>
<div id="popbox02">
<div>
<div class="relateText fl">请从<%= @homework.homework_detail_group.base_on_project == 1 ? '项目成员':'课程成员' %>中添加小组成员</div>
@ -105,4 +106,5 @@
<% end %>
<% end %>
});
</script>
</script>
<% end %>

View File

@ -34,7 +34,11 @@
<% if @homework.homework_type == 3 %>
<span id="min_num_member" style="display: none"><%=@homework.homework_detail_group.min_num %></span>
<span id="max_num_member" style="display: none"><%=@homework.homework_detail_group.max_num %></span>
<%=hidden_field_tag 'group_member_ids', params[:group_member_ids], :value=>User.current.id %>
<% str = User.current.id.to_s%>
<% @work.student_work_projects.where("is_leader = ?", 0).each do |pro| %>
<% str += ','+pro.user_id.to_s %>
<% end %>
<%=hidden_field_tag 'group_member_ids', params[:group_member_ids], :value=>str %>
<% end %>
<div>
<input type="text" name="student_work[name]" id="student_work_name" placeholder="请简洁的概括作品的功能或特性" class="InputBox W700" maxlength="200" onkeyup="regexStudentWorkName();" value="<%= @work.name%>">

View File

@ -1,7 +1,7 @@
<% if @user_activity_id == -1 %>
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>");
init_activity_KindEditor_data(<%= @homework.id%>,"","87%");
init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>");
<% else %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
<% end %>

View File

@ -1,8 +1,8 @@
clickCanel();
<% if @user_activity_id %>
<% if @user_activity_id != -1 %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@courae_activity}) %>");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
<% else %>
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework,:is_in_course => @is_in_course}) %>");
init_activity_KindEditor_data(<%= @homework.id%>,"","87%");
<% end %>
init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>");
<% end %>

View File

@ -97,11 +97,21 @@
<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 class="mt5">
<div class="mt10">
<div class="homepagePostDeadline">
迟交扣分:<%= activity.late_penalty%>分
</div>
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_start_time_<%=user_activity_id %>">
匿评开启时间:<%= activity.homework_detail_manual.evaluation_start%>&nbsp;00:00
</div>
<div class="homepagePostDeadline ml15">
</div>
<div class="cl"></div>
<div>
<div class="homepagePostDeadline">
缺评扣分:<%= activity.homework_detail_manual.absence_penalty%>分/作品
</div>
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_end_time_<%=user_activity_id %>">
匿评关闭时间:<%= activity.homework_detail_manual.evaluation_end%>&nbsp;23:59
</div>
</div>
@ -162,7 +172,7 @@
</li>
<% if activity.anonymous_comment == 0 %>
<li>
<%= link_to("匿评设置", start_evaluation_set_homework_common_path(activity),:class => "postOptionLink", :remote => true) if activity.homework_detail_manual.comment_status == 1%>
<%= link_to("匿评设置", start_evaluation_set_homework_common_path(activity,:user_activity_id => user_activity_id, :is_in_course => -1,:course_activity=>course_activity),:class => "postOptionLink", :remote => true) if activity.homework_detail_manual.comment_status == 1%>
</li>
<li>
<%= homework_anonymous_comment activity,-1,user_activity_id,course_activity %>

View File

@ -26,7 +26,7 @@
</div>
<div class="cl"></div>
</div>
<% count=course.journals_for_messages.where('m_parent_id IS NULL').count %>
<% count = fetch_user_leaveWord_reply(activity).count %>
<div class="homepagePostReply">
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
@ -47,7 +47,7 @@
<% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>">
<ul>
<% course.journals_for_messages.where('m_parent_id IS NULL').reorder("created_on desc").each do |comment| %>
<% fetch_user_leaveWord_reply(activity).each do |comment| unless fetch_user_leaveWord_reply(activity).nil? %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
@ -68,43 +68,12 @@
<%= format_time(comment.created_on) %>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.notes.html_safe %></div>
<% fetch_user_leaveWord_reply(comment).each do |reply| unless fetch_user_leaveWord_reply(comment).nil? %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_to_content_<%= reply.id %>');
});
</script>
<div class="recall">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33", :class =>"mt8"), user_path(reply.user_id), :alt => "用户头像" %>
</div>
<div class="homepagePostReplyjournal">
<div class="homepagePostReplyPublisher">
<% if reply.try(:user).try(:realname) == ' ' %>
<%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
<% else %>
<%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= l(:label_reply_to)%>
<% if comment.try(:user).try(:realname) == ' ' %>
<%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14 ml10" %>
<% else %>
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14 ml10" %>
<% end %>
<%= format_time reply.created_on %>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" style="max-width: 580px;" id="reply_to_content_<%= reply.id %>">
<%= reply.notes.html_safe %></div>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
<% end %>
<% end %>
<%= comment.notes.html_safe %>
</div>
</div>
<div class="cl"></div>
</li>
<% end %>
<% end %>
</ul>
</div>
@ -114,7 +83,7 @@
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10">
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
<%= form_for('new_form',:url => {:controller => 'words', :action => 'create_reply', :id => activity.id},:method => "post", :remote => true) do |f|%>
<%= form_for('new_form',:url => {:controller => 'words', :action => 'create_reply', :id => activity.id}, :method => "post", :remote => true) do |f|%>
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => activity.id %>
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => activity.user.id %>
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => activity.id %>
@ -132,4 +101,5 @@
<div class="cl"></div>
</div>
</div>
</div>
</div>

View File

@ -13,7 +13,19 @@
<%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%>
</div>
<div class="homepagePostTitle break_word">
<%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey" %>
<% case activity.tracker_id %>
<% when 1%>
<span class="issues fl" title="缺陷"></span>
<% when 2%>
<span class="function fl" title="功能"></span>
<% when 3%>
<span class="support fl" title="支持"></span>
<% when 4%>
<span class="duty fl" title="任务"></span>
<% when 5%>
<span class="weekly fl" title="周报"></span>
<% end %>
<%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey ml5" %>
<span class='<%= get_issue_priority(activity.priority_id)[0] %>'>
<%= get_issue_priority(activity.priority_id)[1] %>
</span>

View File

@ -1,12 +1,12 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
<% end %>
<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 )}
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;}
@ -39,7 +39,7 @@
}
$(function() {
init_activity_KindEditor_data(<%= user_activity.id%>, null, "87%");
init_activity_KindEditor_data(<%= user_activity.id%>, null, "87%", "<%=user_activity.class.to_s%>");
showNormalImage('activity_description_<%= user_activity.id %>');
if($("#intro_content_<%= user_activity.id %>").height() > 360) {
$("#intro_content_show_<%= user_activity.id %>").show();

View File

@ -0,0 +1,21 @@
<% if AtMessage === ma && ma.at_valid? %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.author), :width => "30", :height => "30"),user_path(ma.author) %></a></li>
<li class="homepageNewsPubType fl">
<span class="newsBlue homepageNewsPublisher"><%= ma.author.login %></span><span class="homepageNewsType fl">提到了你:</span>
</li>
<li class="homepageNewsContent fl">
<%= link_to ma.subject.html_safe, ma.url,
:class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}",
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %></li>
<div style="display: none" class="message_title_red system_message_style">
<p><strong>标题:</strong><%= ma.subject %></p>
<% unless ma.description.nil? %>
<div class="fl"><strong>内容:</strong></div>
<div class="ml36"><%= ma.description.html_safe %></div>
<% end %>
</div>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>

View File

@ -10,7 +10,7 @@
</div>
<div class="mb10 mt10">
<label>
<input type="checkbox" class="mr5" name="base_on_project" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.base_on_project : 0 %>" id="base_on_project"/>
<input type="checkbox" class="mr5" name="base_on_project" checked value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.base_on_project : 1 %>" id="base_on_project"/>
<span class="f14 fontGrey3 mr10">基于项目实施</span>
</label>
<p class="c_red">提醒勾选后各小组必须在Trustie平台创建项目教师可随时观察平台对各小组最新进展的实时统计。</p>

View File

@ -102,11 +102,21 @@
<div id="intro_content_show_<%= homework_common.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= homework_common.id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<div class="mt5">
<div class="mt10">
<div class="homepagePostDeadline">
迟交扣分:<%= homework_common.late_penalty%>分
</div>
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_start_time_<%=homework_common.id %>">
匿评开启时间:<%= homework_common.homework_detail_manual.evaluation_start%>&nbsp;00:00
</div>
<div class="homepagePostDeadline ml15">
</div>
<div class="cl"></div>
<div>
<div class="homepagePostDeadline">
缺评扣分:<%= homework_common.homework_detail_manual.absence_penalty%>分/作品
</div>
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_end_time_<%=homework_common.id %>">
匿评关闭时间:<%= homework_common.homework_detail_manual.evaluation_end%>&nbsp;23:59
</div>
</div>
@ -167,7 +177,7 @@
</li>
<% if homework_common.anonymous_comment == 0 &&(comment_status == 0 || comment_status == 1)%>
<li>
<%= link_to("匿评设置", start_evaluation_set_homework_common_path(homework_common),:class => "postOptionLink", :remote => true)%>
<%= link_to("匿评设置", start_evaluation_set_homework_common_path(homework_common, :is_in_course => is_in_course,:course_activity=>-1),:class => "postOptionLink", :remote => true)%>
</li>
<% end %>
<% if homework_common.anonymous_comment == 0%>

View File

@ -1,5 +1,5 @@
<% content_for :header_tags do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
<%= javascript_include_tag 'homework','baiduTemplate' %>
<script type="text/javascript">
@ -26,14 +26,18 @@
<% end %>
<div class="calendar_div fl mr10">
<input type="text" name="homework_common[end_time]" id="homework_end_time" placeholder="截止日期" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= homework.end_time%>" >
<%= calendar_for('homework_end_time')%>
<% if homework.homework_detail_manual.comment_status.to_i < 3 %>
<%= calendar_for('homework_end_time')%>
<% end %>
</div>
<% if edit_mode %>
<label class="fl c_grey f14" style="margin-top: 4px;">发布日期(可选)</label>
<% end %>
<div class="calendar_div fl">
<input type="text" name="homework_common[publish_time]" id="homework_publish_time" placeholder="发布日期(可选)" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= homework.publish_time%>" >
<%= calendar_for('homework_publish_time')%>
<% if homework.homework_detail_manual.comment_status.to_i == 0 %>
<%= calendar_for('homework_publish_time')%>
<% end %>
</div>
</div>
<div class="cl"></div>
@ -42,10 +46,10 @@
<div id="homework_editor" style="display: <%= edit_mode ? 'block':'none'%>">
<div class="mt10">
<% if edit_mode %>
<%= f.kindeditor :description, :editor_id => 'homework_description_editor', :height => "150px", :owner_id => homework.id, :owner_type => OwnerTypeHelper::HOMEWORKCOMMON %>
<%= f.kindeditor :description, :editor_id => 'homework_description_editor', :height => "150px", :owner_id => homework.id, :owner_type => OwnerTypeHelper::HOMEWORKCOMMON, at_id: homework.id, at_type: homework.class.to_s %>
<% else %>
<%= hidden_field_tag :asset_id, params[:asset_id], :required => false, :style => 'display:none' %>
<%= f.kindeditor :description, :editor_id => 'homework_description_editor', :height => "150px" %>
<%= f.kindeditor :description, :editor_id => 'homework_description_editor', :height => "150px",at_id: homework.id, at_type: homework.class.to_s %>
<% end %>
</div>
<div class="cl"></div>

View File

@ -1,12 +1,12 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
<% end %>
<style type="text/css">
/*回复框*/
.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}
.homepagePostReplyInputContainer .ke-toolbar-icon {line-height: 26px; font-size: 14px; padding-left: 26px;}
.homepagePostReplyInputContainer .ke-toolbar-icon-url {background-image: url(/images/public_icon.png)}
.homepagePostReplyInputContainer .ke-toolbar-icon-url {background-image: url("/images/public_icon.png")}
.homepagePostReplyInputContainer .ke-outline {padding: 0px 0px; line-height: 26px; font-size: 14px;}
.homepagePostReplyInputContainer .ke-icon-emoticons {background-position: 0px -671px; width: 50px; height: 26px;}
.homepagePostReplyInputContainer .ke-icon-emoticons:hover {background-position: -79px -671px; width: 50px; height: 26px;}
@ -17,7 +17,7 @@
<% homework_commons.each do |homework_common|%>
<script type="text/javascript">
$(function() {
init_activity_KindEditor_data(<%= homework_common.id%>, null, "87%");
init_activity_KindEditor_data(<%= homework_common.id%>, null, "87%", "<%=homework_common.class.to_s%>");
showNormalImage('homework_description_<%= homework_common.id%>');
if($("#intro_content_<%= homework_common.id%>").height() > 360) {
$("#intro_content_show_<%= homework_common.id%>").show();

View File

@ -17,6 +17,8 @@
<%# 系统消息 %>
<%= render :partial => 'users/user_message_system', :locals => {:ma => ma} %>
<%= render :partial => 'users/user_at_message', :locals => {:ma => ma} %>
<%# 课程消息 %>
<%= render :partial => 'users/user_message_course', :locals => {:ma => ma} %>

View File

@ -1,6 +1,6 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<%= javascript_include_tag "user" %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<%= javascript_include_tag "init_KindEditor","user" %>
<% end %>
<style type="text/css">

View File

@ -148,6 +148,10 @@
$("#resources_list").mousedown(function(e) {
//如果是右键的话
if (3 == e.which) {
if( $("#res_name").length != 0 || $("#ajax-indicator").is(":hidden") == false){ //其他ajax在执行的时候阻止操作
e.preventDefault();
return ;
}
document.oncontextmenu = function() {return false;}
pageX = e.clientX;
pageY = e.clientY;
@ -195,6 +199,9 @@
//隐藏右键菜单
//e.preventDefault();
$("#contextMenu").hide();
if( $("#ajax-indicator").is(":hidden") == false && $("#res_name").length != 0 ){ //其他ajax在执行的时候或者res_name仍然存在阻止操作
return ;
}
document.oncontextmenu = function() {return true;}
//如果当前行为空,那么要将当前行的拿到
var ele;
@ -363,7 +370,8 @@
res_link = line.children().eq(1).html();
line.children().eq(1).html(
'<input name="res_name" id="res_name" ' +
'style="height: 2em;line-height: 2em;overflow: hidden;" onblur="restore();" onkeypress="if(event.keyCode==13){event.preventDefault();this.blur();}" ' +
'style="height: 2em;line-height: 2em;overflow: hidden;" onblur="restore();" ' +
' onkeypress="if(event.keyCode==13){event.preventDefault();this.blur();}" ' +
'value="'+res_name+
'"/> <input type="hidden" id ="res_id" name="res_id" value="'+id+'"/>');
$("#res_name").focus();
@ -401,7 +409,7 @@
type:'get',
success:function (data)
{
if (data != 'fail') {//修改成功,那么将链接恢复,并且将链接的显示内容改变。链接可以不变
if (data != 'fail' && name != undefined && name != 'undefined') {//修改成功,那么将链接恢复,并且将链接的显示内容改变。链接可以不变
last_line.children().eq(1).html(res_link);
last_line.children().eq(1).children().attr('title', name);
last_line.children().eq(1).children().attr('href', data);

View File

@ -1,4 +1,4 @@
<%= form_tag(words_create_reply_path, :remote => true) do %>
<%= form_tag(words_create_reply_path, :remote => true,:id=>"form_#{journal.id}") do %>
<%= text_area_tag 'user_notes', "", :class => 'w520 h50 mb5',
:style => "resize: none;overflow: hidden;",:rows => 4,
:placeholder => l(:label_feedback_respond_content)#,
@ -13,6 +13,20 @@
<div class="fl" style="padding-top:5px;" nhname="toolbar_container"></div>
<%= submit_tag l(:button_feedback_respond), :name => nil ,
:class => "reply_btn"%>
:class => "reply_btn" ,:onclick=>"form_sub_#{ journal.id}($(this),event)"%>
<input nhname="cancel_btn" type="button" style="display:none;"/>
<% end %>
<% end %>
<script>
var flag_<%= journal.id %> = false;
function form_sub_<%= journal.id%>(dom,event){
if(flag_<%= journal.id %> == true){
//dom.attr('disabled','disabled');
return;
}else{
//dom.removeAttr('disabled');
}
flag_<%= journal.id %> = true;
$("#form_<%= journal.id%>").submit();
event.preventDefault();
}
</script>

View File

@ -5,7 +5,7 @@
<% else %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_journalsformessage', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
<% end %>
init_activity_KindEditor_data('<%= @user_activity_id%>', "", "87%");
init_activity_KindEditor_data('<%= @user_activity_id%>', "", "87%", "UserActivity");
<% else %>
<% if !@jfm.nil? && @jfm.jour_type == 'Principal' %>
$("#<%= @jfm.m_parent_id%>").children("div[nhname='reply_list']").prepend("<%= escape_javascript( render(:partial => 'users/user_jour_reply',:locals => {:reply=>@jfm} )) %>");

View File

@ -1,7 +1,7 @@
<% if @user_activity_id %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework_common,:user_activity_id =>@user_activity_id,:course_activity => @course_activity}) %>");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
<% elsif @homework_common_id && @is_in_course %>
$("#homework_common_<%= @homework_common_id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework_common,:is_in_course => @is_in_course}) %>");
init_activity_KindEditor_data(<%= @homework_common_id%>,"","87%");
init_activity_KindEditor_data(<%= @homework_common_id%>,"","87%", "HomeworkCommon");
<% end %>

View File

@ -0,0 +1,235 @@
# = Redmine configuration file
#
# Each environment has it's own configuration options. If you are only
# running in production, only the production block needs to be configured.
# Environment specific configuration options override the default ones.
#
# Note that this file needs to be a valid YAML file.
# DO NOT USE TABS! Use 2 spaces instead of tabs for identation.
#
# == Outgoing email settings (email_delivery setting)
#
# === Common configurations
#
# ==== Sendmail command
#
# production:
# email_delivery:
# delivery_method: :sendmail
#
# ==== Simple SMTP server at localhost
#
# production:
# email_delivery:
# delivery_method: :smtp
# smtp_settings:
# address: smtp.163.com
# port: 25
#
# ==== SMTP server at example.com using LOGIN authentication and checking HELO for foo.com
#
# production:
# email_delivery:
# delivery_method: :smtp
# smtp_settings:
# address: smtp.gmail.com
# port: 587
# authentication: :login
# domain: 'foo.com'
# user_name: senluowanxiangt@gmail.com
# password: 1913TXBja
#
# ==== SMTP server at example.com using PLAIN authentication
#
# production:
# email_delivery:
# delivery_method: :smtp
# smtp_settings:
# address: smtp.gmail.com
# port: 587
# authentication: :plain
# domain: 'example.com'
# user_name: senluowanxiangt@gmail.com
# password: 1913TXBja
#
# ==== SMTP server at using TLS (GMail)
#
# This might require some additional configuration. See the guides at:
# http://www.redmine.org/projects/redmine/wiki/EmailConfiguration
#
# production:
# email_delivery:
# delivery_method: :smtp
# smtp_settings:
# enable_starttls_auto: true
# address: smtp.gmail.com
# port: 587
# domain: "smtp.gmail.com" # 'your.domain.com' for GoogleApps
# authentication: :plain
# user_name: senluowanxiangt@gmail.com
# password: 1913TXBja
#
#
# === More configuration options
#
# See the "Configuration options" at the following website for a list of the
# full options allowed:
#
# http://wiki.rubyonrails.org/rails/pages/HowToSendEmailsWithActionMailer
default:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: mail.trustie.net
port: 25
domain: mail.trustie.net
authentication: :login
user_name: "mail@trustie.net"
password: "loong2010"
# Absolute path to the directory where attachments are stored.
# The default is the 'files' directory in your Redmine instance.
# Your Redmine instance needs to have write permission on this
# directory.
# Examples:
# attachments_storage_path: /var/redmine/files
# attachments_storage_path: D:/redmine/files
attachments_storage_path:
# Configuration of the autologin cookie.
# autologin_cookie_name: the name of the cookie (default: autologin)
# autologin_cookie_path: the cookie path (default: /)
# autologin_cookie_secure: true sets the cookie secure flag (default: false)
autologin_cookie_name: "autologin_trustie"
autologin_cookie_path:
autologin_cookie_secure:
# Configuration of SCM executable command.
#
# Absolute path (e.g. /usr/local/bin/hg) or command name (e.g. hg.exe, bzr.exe)
# On Windows + CRuby, *.cmd, *.bat (e.g. hg.cmd, bzr.bat) does not work.
#
# On Windows + JRuby 1.6.2, path which contains spaces does not work.
# For example, "C:\Program Files\TortoiseHg\hg.exe".
# If you want to this feature, you need to install to the path which does not contains spaces.
# For example, "C:\TortoiseHg\hg.exe".
#
# Examples:
# scm_subversion_command: svn # (default: svn)
# scm_mercurial_command: C:\Program Files\TortoiseHg\hg.exe # (default: hg)
# scm_git_command: /usr/local/bin/git # (default: git)
# scm_cvs_command: cvs # (default: cvs)
# scm_bazaar_command: bzr.exe # (default: bzr)
# scm_darcs_command: darcs-1.0.9-i386-linux # (default: darcs)
#
scm_subversion_command:
scm_mercurial_command:
scm_git_command:
scm_cvs_command:
scm_bazaar_command:
scm_darcs_command:
# Absolute path to the SCM commands errors (stderr) log file.
# The default is to log in the 'log' directory of your Redmine instance.
# Example:
# scm_stderr_log_file: /var/log/redmine_scm_stderr.log
scm_stderr_log_file:
# Key used to encrypt sensitive data in the database (SCM and LDAP passwords).
# If you don't want to enable data encryption, just leave it blank.
# WARNING: losing/changing this key will make encrypted data unreadable.
#
# If you want to encrypt existing passwords in your database:
# * set the cipher key here in your configuration file
# * encrypt data using 'rake db:encrypt RAILS_ENV=production'
#
# If you have encrypted data and want to change this key, you have to:
# * decrypt data using 'rake db:decrypt RAILS_ENV=production' first
# * change the cipher key here in your configuration file
# * encrypt data using 'rake db:encrypt RAILS_ENV=production'
database_cipher_key:
# Set this to false to disable plugins' assets mirroring on startup.
# You can use `rake redmine:plugins:assets` to manually mirror assets
# to public/plugin_assets when you install/upgrade a Redmine plugin.
#
#mirror_plugins_assets_on_startup: false
# Your secret key for verifying cookie session data integrity. If you
# change this key, all old sessions will become invalid! Make sure the
# secret is at least 30 characters and all random, no regular words or
# you'll be exposed to dictionary attacks.
#
# If you have a load-balancing Redmine cluster, you have to use the
# same secret token on each machine.
#secret_token: 'change it to a long random string'
# Absolute path (e.g. /usr/bin/convert, c:/im/convert.exe) to
# the ImageMagick's `convert` binary. Used to generate attachment thumbnails.
imagemagick_convert_command: '/home/pdl/redmine-2.3.2-0/common/bin/convert'
# Configuration of RMagcik font.
#
# Redmine uses RMagcik in order to export gantt png.
# You don't need this setting if you don't install RMagcik.
#
# In CJK (Chinese, Japanese and Korean),
# in order to show CJK characters correctly,
# you need to set this configuration.
#
# Because there is no standard font across platforms in CJK,
# you need to set a font installed in your server.
#
# This setting is not necessary in non CJK.
#
# Examples for Japanese:
# Windows:
# rmagick_font_path: C:\windows\fonts\msgothic.ttc
# Linux:
# rmagick_font_path: /usr/share/fonts/ipa-mincho/ipam.ttf
#
rmagick_font_path:
# Maximum number of simultaneous AJAX uploads
#max_concurrent_ajax_uploads: 2
#pic_types: "bmp,jpeg,jpg,png,gif"
repository_root_path: '/tmp/htdocs'
judge_server: 'http://judge.trustie.net/'
# Git's url
gitlab_address: 'http://gitfast.trustie.net'
# specific configuration options for production environment
# that overrides the default ones
production:
# CJK support
rmagick_font_path: /usr/share/fonts/ipa-mincho/ipam.ttf
judge_server: 'http://192.168.80.21:8080/'
repository_root_path: '/home/pdl/redmine-2.3.2-0/apache2/htdocs'
cookie_domain: ".trustie.net"
email_delivery:
delivery_method: :smtp
smtp_settings:
address: mail.trustie.net
port: 25
domain: mail.trustie.net
authentication: :login
user_name: "mail@trustie.net"
password: "loong2010"
# specific configuration options for development environment
# that overrides the default ones
development:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: mail.trustie.net
port: 25
domain: mail.trustie.net
authentication: :login
user_name: "mail@trustie.net"
password: "loong2010"

View File

@ -0,0 +1,9 @@
Gitlab.configure do |config|
# config.endpoint = 'http://192.168.41.130:3000/trustie/api/v3' # API endpoint URL, default: ENV['GITLAB_API_ENDPOINT']
# config.private_token = 'cK15gUDwvt8EEkzwQ_63' # user's private token, default: ENV['GITLAB_API_PRIVATE_TOKEN']
config.endpoint = 'http://gitfast.trustie.net/api/v3' # API endpoint URL, default: ENV['GITLAB_API_ENDPOINT']
config.private_token = 'fPc_gBmEiSANve8TCfxW' # user's private token, default: ENV['GITLAB_API_PRIVATE_TOKEN']
# Optional
# config.user_agent = 'Custom User Agent' # user agent, default: 'Gitlab Ruby Gem [version]'
# config.sudo = 'user' # username for sudo mode, default: nil
end

View File

@ -1063,13 +1063,14 @@ RedmineApp::Application.routes.draw do
match 'system_log/clear'
##ended by lizanle
resources :git_callback do
collection do
post 'post_update'
end
end
resources :at
Dir.glob File.expand_path("plugins/*", Rails.root) do |plugin_dir|
file = File.join(plugin_dir, "config/routes.rb")
if File.exists?(file)

View File

@ -279,3 +279,5 @@ plugin_redmine_ckeditor:
toolbar_can_collapse: '0'
toolbar_location: top
toolbar: Source,ShowBlocks,--,Undo,Redo,-,Find,Replace,--,Bold,Italic,Underline,Strike,-,Subscript,Superscript,-,NumberedList,BulletedList,-,Outdent,Indent,Blockquote,-,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock,-,Link,Unlink,-,richImage,Table,HorizontalRule,/,Styles,Format,Font,FontSize,-,TextColor,BGColor
at_enabled:
default: 1

View File

@ -0,0 +1,15 @@
class CreateAtMessages < ActiveRecord::Migration
def change
create_table :at_messages do |t|
t.references :user
t.integer :at_message_id
t.string :at_message_type
t.boolean :viewed, :default => false
t.string :container_type
t.integer :container_id
t.timestamps
end
add_index :at_messages, :user_id
end
end

Some files were not shown because too many files have changed in this diff Show More