Conflicts:
	app/views/boards/_course_show.html.erb
dev_zanle
cxt 10 years ago
commit 2eaa05306f

@ -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

@ -79,6 +79,13 @@ class BoardsController < ApplicationController
end end
end 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 elsif @course
query_course_messages = @board.messages query_course_messages = @board.messages
query_course_messages.each do |query_course_message| query_course_messages.each do |query_course_message|

@ -19,6 +19,14 @@ class HomeworkCommonController < ApplicationController
@is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) @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_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher))
@is_new = params[:is_new] @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| respond_to do |format|
format.js format.js
format.html format.html

@ -24,7 +24,7 @@ class IssuesController < ApplicationController
before_filter :find_issues, :only => [:bulk_edit, :bulk_update, :destroy] before_filter :find_issues, :only => [:bulk_edit, :bulk_update, :destroy]
before_filter :find_project, :only => [:new, :create, :update_form] before_filter :find_project, :only => [:new, :create, :update_form]
#before_filter :authorize, :except => [:index, :show] #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 :find_optional_project, :only => [:index]
before_filter :check_for_default_issue_status, :only => [:new, :create] 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 = 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? 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 = @issue.journals
query_journals.each do |query_journal| 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 @project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'#by young
@available_watchers = (@issue.project.users.sort + @issue.watcher_users).uniq @available_watchers = (@issue.project.users.sort + @issue.watcher_users).uniq
#id name email respond_to do |format|
#1. issues list persons format.html {
#2. project persons retrieve_previous_and_next_issue_ids
@at_persons = @journals.map(&:user) + @issue.project.users render :template => 'issues/show', :layout => @project_base_tag#by young
@at_persons = @at_persons.uniq{|u| u.id}.delete_if{|u| u.id == User.current.id} }
@at_persons = nil format.api
format.atom { render :template => 'journals/index', :layout => false, :content_type => 'application/atom+xml' }
respond_to do |format|`` format.pdf {
format.html { pdf = issue_to_pdf(@issue, :journals => @journals)
retrieve_previous_and_next_issue_ids send_data(pdf, :type => 'application/pdf', :filename => filename_for_content_disposition("#{@project.identifier}-#{@issue.id}.pdf") )
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
end end

@ -348,10 +348,6 @@ update
# end # end
# end # end
@changesets = g.commits(@project.gpid, :ref_name => @rev) @changesets = g.commits(@project.gpid, :ref_name => @rev)
# @changesets = @repository.latest_changesets(@path, @rev) # @changesets = @repository.latest_changesets(@path, @rev)
# @changesets_count = @repository.latest_changesets(@path, @rev).count # @changesets_count = @repository.latest_changesets(@path, @rev).count
@ -378,19 +374,6 @@ update
alias_method :browse, :show alias_method :browse, :show
#add by hx
def count_commits(project_id , left , right)
count = 0
(left..right).each do |page|
if $g.commits(project_id,:page => page).count == 0
break
else
count = count + $g.commits(project_id,:page => page).count
end
end
return count
end
def changes def changes
@entry = @repository.entry(@path, @rev) @entry = @repository.entry(@path, @rev)
(show_error_not_found; return) unless @entry (show_error_not_found; return) unless @entry
@ -400,26 +383,10 @@ update
@commits = g.commits(@project.gpid, page:(params[:page].to_i - 1).to_s) @commits = g.commits(@project.gpid, page:(params[:page].to_i - 1).to_s)
#add by hx #add by hx
if g.commits(@project.gpid , :page=>200).count > 0 rep_count = commit_count(@project)
count = 4020
elsif g.commits(@project.gpid , :page=>25).count==0
count = count_commits(@project.gpid , 0 , 25)
elsif g.commits(@project.gpid , :page=>50).count ==0
count = count_commits(@project.gpid , 25 , 50)+ 25 * 20
elsif g.commits(@project.gpid , :page=>75).count ==0
count = count_commits(@project.gpid , 50 , 75)+ 50 * 20
elsif g.commits(@project.gpid , :page=>100).count== 0
count = count_commits(@project.gpid , 75 , 100) + 75 * 20
elsif g.commits(@project.gpid , :page=>125).count==0
count = count_commits(@project.gpid , 100 , 125) + 100 * 20
elsif g.commits(@project.gpid , :page=>150).count==0
count = count_commits(@project.gpid , 125 , 150) + 125 * 20
else
count = count_commits(@project.gpid , 150 ,200) + 150 * 20
end
#页面传递必须要str类型,但是Paginator的初始化必须要num类型,需要类型转化 #页面传递必须要str类型,但是Paginator的初始化必须要num类型,需要类型转化
@commits_count = count @commits_count = rep_count
@commits_pages = Redmine::Pagination::Paginator.new @commits_count,limit,params[:page] @commits_pages = Redmine::Pagination::Paginator.new @commits_count,limit,params[:page]
@commit = g.commit(@project.gpid,@rev) @commit = g.commit(@project.gpid,@rev)

@ -668,6 +668,42 @@ module ApplicationHelper
return rep.blank? ? true :false return rep.blank? ? true :false
end end
# 获取Gitlab版本库提交总数
def commit_count(project)
g = Gitlab.client
#add by hx
if g.commits(project.gpid , :page=>200).count > 0
count = 4020
elsif g.commits(project.gpid , :page=>25).count==0
count = count_commits(project.gpid , 0 , 25)
elsif g.commits(project.gpid , :page=>50).count ==0
count = count_commits(project.gpid , 25 , 50)+ 25 * 20
elsif g.commits(project.gpid , :page=>75).count ==0
count = count_commits(project.gpid , 50 , 75)+ 50 * 20
elsif g.commits(project.gpid , :page=>100).count== 0
count = count_commits(project.gpid , 75 , 100) + 75 * 20
elsif g.commits(project.gpid , :page=>125).count==0
count = count_commits(project.gpid , 100 , 125) + 100 * 20
elsif g.commits(project.gpid , :page=>150).count==0
count = count_commits(project.gpid , 125 , 150) + 125 * 20
else
count = count_commits(project.gpid , 150 ,200) + 150 * 20
end
end
#add by hx
def count_commits(project_id , left , right)
count = 0
(left..right).each do |page|
if $g.commits(project_id,:page => page).count == 0
break
else
count = count + $g.commits(project_id,:page => page).count
end
end
return count
end
# 获取单一gitlab项目 # 获取单一gitlab项目
def gitlab_repository(project) def gitlab_repository(project)
rep = Repository.where("project_id =? and type =?", project.id,"Repository::Gitlab" ).first rep = Repository.where("project_id =? and type =?", project.id,"Repository::Gitlab" ).first
@ -1716,6 +1752,13 @@ module ApplicationHelper
# #
def javascript_include_tag(*sources) def javascript_include_tag(*sources)
options = sources.last.is_a?(Hash) ? sources.pop : {} 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) if plugin = options.delete(:plugin)
sources = sources.map do |source| sources = sources.map do |source|
if plugin if plugin
@ -1725,7 +1768,12 @@ module ApplicationHelper
end end
end end
end end
super sources, options
if sources && !sources.empty?
super(sources, options)
else
''
end
end end
def content_for(name, content = nil, &block) def content_for(name, content = nil, &block)
@ -2676,19 +2724,8 @@ int main(int argc, char** argv){
end end
def import_ke(default_opt={}) 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 = '' ss = ''
if opt[:enable_at]
ss = '<script type="text/javascript">'
ss += 'window.atPersonLists = [];'
@at_persons && @at_persons.each_with_index do |person,index|
ss += "var o = {id: #{index}, name: '#{person.show_name}', login: '#{person.login}', searchKey: '#{person.get_at_show_name}'};"
ss += "atPersonLists.push(o);"
end
ss += "</script>"
end
ss += javascript_include_tag("/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg') ss += javascript_include_tag("/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg')
if opt[:enable_at] if opt[:enable_at]

@ -22,6 +22,7 @@ module ProjectScoreHelper
#代码提交数量 #代码提交数量
def changesets_num project def changesets_num project
# commit_count(project)
project.changesets.count project.changesets.count
end end

@ -89,7 +89,8 @@ module UsersHelper
forge_count = ForgeMessage.where("user_id =? and viewed =?", user, 0).count forge_count = ForgeMessage.where("user_id =? and viewed =?", user, 0).count
user_feedback_count = UserFeedbackMessage.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 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 end
def user_mail_notification_options(user) def user_mail_notification_options(user)

@ -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

@ -52,6 +52,7 @@ class Issue < ActiveRecord::Base
# ForgeMessage虚拟关联(多态) # ForgeMessage虚拟关联(多态)
has_many :forge_messages, :class_name => 'ForgeMessage',:as =>:forge_message ,:dependent => :destroy 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_nested_set :scope => 'root_id', :dependent => :destroy
acts_as_attachable :before_add => :attachment_added, :after_remove => :attachment_removed acts_as_attachable :before_add => :attachment_added, :after_remove => :attachment_removed
@ -82,7 +83,7 @@ class Issue < ActiveRecord::Base
attr_reader :current_journal attr_reader :current_journal
# fq # 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_update :be_user_score
after_destroy :down_user_score after_destroy :down_user_score
# after_create :be_user_score # after_create :be_user_score
@ -156,6 +157,14 @@ class Issue < ActiveRecord::Base
end end
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 #def act_as_forge_message_update
# unless self.author_id == self.assigned_to_id # unless self.author_id == self.assigned_to_id

@ -28,10 +28,12 @@ class Journal < ActiveRecord::Base
has_one :journal_reply has_one :journal_reply
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
# 被ForgeActivity虚拟关联 # 被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虚拟关联 # 被ForgeMessage虚拟关联
has_many :forge_messages, :class_name => 'ForgeMessage',:as =>:forge_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
attr_accessor :indice 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}" }, 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 before_create :split_private_notes
# fq # 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 # end
#after_destroy :down_user_score #after_destroy :down_user_score
#before_save :be_user_score #before_save :be_user_score
@ -160,14 +162,14 @@ class Journal < ActiveRecord::Base
end end
# end # end
# Time 2015-02-27 13:30:19 # # Time 2015-02-27 13:30:19
# Author lizanle # # Author lizanle
# Description 公共表中需要保存一份该记录 # # Description 公共表中需要保存一份该记录
def act_as_forge_activity # def act_as_forge_activity
self.forge_acts << ForgeActivity.new(:user_id => self.user_id, # self.forge_acts << ForgeActivity.new(:user_id => self.user_id,
:project_id => self.issue.project.id) # :project_id => self.issue.project.id)
#
end # end
# 缺陷状态更改,消息提醒 # 缺陷状态更改,消息提醒
def act_as_forge_message def act_as_forge_message
@ -184,6 +186,13 @@ class Journal < ActiveRecord::Base
end end
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 # 更新用户分数 -by zjc
def be_user_score def be_user_score
#新建了缺陷留言且留言不为空,不为空白 #新建了缺陷留言且留言不为空,不为空白

@ -64,8 +64,10 @@ class JournalsForMessage < ActiveRecord::Base
has_many :course_messages, :class_name => 'CourseMessage',:as =>:course_message ,:dependent => :destroy 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 :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? 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_create :reset_counters!
after_destroy :reset_counters! after_destroy :reset_counters!
after_save :be_user_score after_save :be_user_score
@ -240,6 +242,12 @@ class JournalsForMessage < ActiveRecord::Base
end end
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 def act_as_user_feedback_message
# 主留言 # 主留言

@ -395,13 +395,13 @@ class Mailer < ActionMailer::Base
user = User.find_by_mail(recipients) user = User.find_by_mail(recipients)
@user = user @user = user
@token = Token.get_token_from_user(user, 'autologin') @token = Token.get_token_from_user(user, 'autologin')
@issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id, :token => @token.value) @issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue.id)
# edit # edit
@issue_author_url = url_for(user_activities_url(@author,:token => @token.value)) @issue_author_url = url_for(user_activities_url(@author))
@project_url = url_for(:controller => 'projects', :action => 'show', :id => issue.project_id, :token => @token.value) @project_url = url_for(:controller => 'projects', :action => 'show', :id => issue.project_id)
@user_url = url_for(my_account_url(user,:token => @token.value)) @user_url = url_for(my_account_url(user))
subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] (#{issue.status.name}) #{issue.subject}" subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue_id}] (#{issue.status.name}) #{issue.subject}"
@ -471,7 +471,7 @@ class Mailer < ActionMailer::Base
recipients = @project.manager_recipients recipients = @project.manager_recipients
s = l(:text_applied_project, :id => "##{@user.show_name}", :project => @project.name) s = l(:text_applied_project, :id => "##{@user.show_name}", :project => @project.name)
@token = Token.get_token_from_user(@user, 'autologin') @token = Token.get_token_from_user(@user, 'autologin')
@applied_url = url_for(:controller => 'projects', :action => 'settings', :id => @project.id,:tab=>'members', :token => @token.value) @applied_url = url_for(:controller => 'projects', :action => 'settings', :id => @project.id,:tab=>'members')
mail :to => recipients, mail :to => recipients,
:subject => s :subject => s
end end

@ -38,7 +38,7 @@ class Message < ActiveRecord::Base
# 课程/项目 消息 # 课程/项目 消息
has_many :course_messages, :class_name =>'CourseMessage', :as => :course_message, :dependent => :destroy has_many :course_messages, :class_name =>'CourseMessage', :as => :course_message, :dependent => :destroy
has_many :forge_messages, :class_name => 'ForgeMessage', :as => :forge_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 has_many :ActivityNotifies,:as => :activity, :dependent => :destroy
@ -74,7 +74,7 @@ class Message < ActiveRecord::Base
after_update :update_messages_board after_update :update_messages_board
after_destroy :reset_counters!,:down_user_score,:delete_kindeditor_assets 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 #before_save :be_user_score
scope :visible, lambda {|*args| scope :visible, lambda {|*args|
@ -96,6 +96,10 @@ class Message < ActiveRecord::Base
end end
} }
def topic?
parent_id.nil?
end
def visible?(user=User.current) def visible?(user=User.current)
if project if project
!user.nil? && user.allowed_to?(:view_messages, project) !user.nil? && user.allowed_to?(:view_messages, project)
@ -238,6 +242,13 @@ class Message < ActiveRecord::Base
end 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 #更新用户分数 -by zjc
def be_user_score def be_user_score
#新建message且无parent的为发帖 #新建message且无parent的为发帖

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

@ -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 %>
]

@ -15,10 +15,10 @@
<label class="fl" >&nbsp;&nbsp;<%= l(:field_quote)%>&nbsp;&nbsp;</label> <label class="fl" >&nbsp;&nbsp;<%= l(:field_quote)%>&nbsp;&nbsp;</label>
<!--<textarea name="bid[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="hwork_text fl"></textarea>--> <!--<textarea name="bid[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="hwork_text fl"></textarea>-->
<% if edit_mode %> <% 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 %> <% else %>
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
<%= 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 %> <% end %>
</li> </li>
<div class="cl"></div> <div class="cl"></div>

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

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

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

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

@ -27,7 +27,7 @@
} }
} }
$(function() { $(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 %>'); showNormalImage('message_description_<%= @article.id %>');
}); });
</script> </script>

@ -74,7 +74,7 @@
} }
$(function () { $(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 %>'); showNormalImage('activity_description_<%= topic.id %>');
/*var description_images=$("div#activity_description_<%#= topic.id %>").find("img"); /*var description_images=$("div#activity_description_<%#= topic.id %>").find("img");
if (description_images.length>0) { if (description_images.length>0) {

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

@ -31,5 +31,4 @@
<%= render :partial => 'course_new', :locals => {:f => f, :topic => @message, :edit_mode => false, :course => @board.course} %> <%= render :partial => 'course_new', :locals => {:f => f, :topic => @message, :edit_mode => false, :course => @board.course} %>
<% end %> <% end %>
<% end %> <% end %>
<%= render :partial=> 'course_show_detail',:locals =>{:topics => @topics, :page => 0} %> <%= render :partial=> 'course_show_detail',:locals =>{:topics => @topics, :page => 0} %></div>
</div>

@ -20,7 +20,7 @@
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
<div class=" talklist_box" > <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> <ul>
<%= render :partial => 'project_new_topic' %> <%= render :partial => 'project_new_topic' %>
</ul> </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> <a href="javascript:void(0)" nhname="showbtn_reply" class="c_dblue fr f14" style="margin-right:10px;"><%= l(:button_reply) %></a>
<% end %> <% end %>
<div class="cl"></div> <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> <ul>
<%= render :partial => 'edit',locals: {:topic => topic} %> <%= render :partial => 'edit',locals: {:topic => topic} %>
</ul> </ul>
@ -120,7 +120,7 @@
<div class="talkWrapBox"> <div class="talkWrapBox">
<% reply = Message.new(:subject => "RE: #{topic.subject}")%> <% reply = Message.new(:subject => "RE: #{topic.subject}")%>
<% if !topic.locked? && authorize_for('messages', 'reply') %> <% 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> <em class="talkWrapArrow"></em>
<div class="cl"></div> <div class="cl"></div>
<div class="talkConIpt ml15 mb10" style="margin-left:30px;" id="reply<%= topic.id %>"> <div class="talkConIpt ml15 mb10" style="margin-left:30px;" id="reply<%= topic.id %>">

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

@ -3,4 +3,4 @@ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(r
<% else %> <% else %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'projects/project_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>"); $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'projects/project_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
<% end %> <% end %>
init_activity_KindEditor_data('<%= @user_activity_id%>',"","87%"); init_activity_KindEditor_data('<%= @user_activity_id%>',"","87%", "UserActivity");

@ -1,5 +1,5 @@
<%= content_for(:header_tags) do %> <%= 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 %> <% end %>
<style type="text/css"> <style type="text/css">
@ -19,7 +19,7 @@
} }
span.ke-toolbar-icon-url { span.ke-toolbar-icon-url {
background-image: url(/images/public_icon.png) background-image: url("/images/public_icon.png")
} }
div.ke-toolbar .ke-outline { div.ke-toolbar .ke-outline {
@ -72,7 +72,7 @@
} }
$(function () { $(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 %>'); showNormalImage('activity_description_<%= activity.id %>');
if($("#intro_content_<%= activity.id %>").height() > 360) { if($("#intro_content_<%= activity.id %>").height() > 360) {
$("#intro_content_show_<%= activity.id %>").show(); $("#intro_content_show_<%= activity.id %>").show();

@ -12,7 +12,10 @@
div.recall_con .reply_btn{margin-left:525px;margin-top:5px;} div.recall_con .reply_btn{margin-left:525px;margin-top:5px;}
/*.ke-container{height: 80px !important;}*/ /*.ke-container{height: 80px !important;}*/
</style> </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 > <script >
init_KindEditor_data('',80); init_KindEditor_data('',80);
</script> </script>

@ -1,6 +1,6 @@
<%= content_for(:header_tags) do %> <%= 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' %> <%= javascript_include_tag 'blog' %>
<% end %> <% end %>
@ -40,7 +40,7 @@
} }
} }
$(function() { $(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 %>'); showNormalImage('message_description_<%= @article.id %>');
}); });
</script> </script>

@ -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 %> <%= 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] %> <% if params[:in_org] %>
<div class="c_dark"> <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="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="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> <input name="org_subfield_attachment_type[]" type="checkbox" value="5" class="c_dblue">其他</input></a>

@ -2,10 +2,10 @@
alert('启动成功'); alert('启动成功');
<% if @user_activity_id == -1 %> <% 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})%>"); $("#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 %> <% 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}) %>"); $("#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 %> <% 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")%>');*/ /*$("#<%#= @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 %> <% elsif @statue == 2 %>

@ -1,10 +1,10 @@
alert('关闭成功'); alert('关闭成功');
<% if @user_activity_id == -1 %> <% 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})%>"); $("#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 %> <% 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}) %>"); $("#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 %> <% end %>
/* /*
$("#<%#= @homework.id %>_stop_anonymous_comment").replaceWith('');*/ $("#<%#= @homework.id %>_stop_anonymous_comment").replaceWith('');*/

@ -3,7 +3,20 @@
<%= link_to image_tag(url_to_avatar(@issue.author), :width => 46, :height => 46), user_path(@issue.author), :class => "ping_dispic" %> <%= link_to image_tag(url_to_avatar(@issue.author), :width => 46, :height => 46), user_path(@issue.author), :class => "ping_dispic" %>
</div> </div>
<div class="talk_txt fl"> <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> <span class='<%= "#{get_issue_priority(@issue.priority_id)[0]} " %>'><%= get_issue_priority(@issue.priority_id)[1] %></span></p>
<br> <br>
<div class="cl"></div> <div class="cl"></div>

@ -1,9 +1,8 @@
<div id="issue_edit" style="display: none"> <div id="issue_edit" style="display: none">
<%= content_for(:header_tags) do %> <%= 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 %> <% end %>
<%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true,:remote=>true} do |f| %> <%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true,:remote=>true} do |f| %>
<%= error_messages_for 'issue', 'time_entry' %> <%= error_messages_for 'issue', 'time_entry' %>
<%= render :partial => 'conflict' if @conflict %> <%= render :partial => 'conflict' if @conflict %>
@ -21,6 +20,20 @@
</div> </div>
<input name="issue_quote_new" type="hidden" value="<%= %>" /> <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> <div class="cl"></div>
<%= f.hidden_field :lock_version %> <%= f.hidden_field :lock_version %>
<%= hidden_field_tag 'last_journal_id', params[:last_journal_id] || @issue.last_journal_id %> <%= hidden_field_tag 'last_journal_id', params[:last_journal_id] || @issue.last_journal_id %>

@ -49,7 +49,7 @@
<%= f.label_for_field :description, :required => @issue.required_attribute?('description'), :no_label => true, :class => "label" %> <%= 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? %> <%#= 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 %> <%#= 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 %> <%# end %>
<%#= wikitoolbar_for 'issue_description' %> <%#= wikitoolbar_for 'issue_description' %>
<% end %> <% end %>

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

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

@ -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}) %>"); $("#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");

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

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

@ -27,7 +27,7 @@
} }
} }
$(function() { $(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 %>'); showNormalImage('message_description_<%= @topic.id %>');
}); });
</script> </script>

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

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

@ -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}) %>"); $("#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");

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

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

@ -19,7 +19,7 @@
<% @documents.each do |document| %> <% @documents.each do |document| %>
<script> <script>
$(function() { $(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> </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} %> <%= 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} %>

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

@ -1,7 +1,7 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor",'blog' %> <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor",'blog' %>
<script> <script>
$(function() { $(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 %>'); showNormalImage('message_description_<%= @document.id %>');
}); });
</script> </script>

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

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

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

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

@ -4,7 +4,7 @@ $('#ajax-modal').html('<%= escape_javascript(render :partial => 'join_course_men
showModal('ajax-modal', '320px'); showModal('ajax-modal', '320px');
$('#ajax-modal').siblings().hide(); $('#ajax-modal').siblings().hide();
$('#ajax-modal').before( $('#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('position','absolute')
$('#ajax-modal').css("top","").css("left",""); $('#ajax-modal').css("top","").css("left","");
$('#ajax-modal').parent().addClass("resourceSharePopup"); $('#ajax-modal').parent().addClass("resourceSharePopup");

@ -1,6 +1,7 @@
$("#homepageLeftMenuCourses").html(""); //$("#homepageLeftMenuCourses").html("");
$("#homepageLeftMenuCourses").append("<ul>"); //$("#homepageLeftMenuCourses").append("<ul>");
$("#homepageLeftMenuCourses").append("<%= escape_javascript(render :partial => 'layouts/org_courses', //$("#homepageLeftMenuCourses").append("<%#= escape_javascript(render :partial => 'layouts/org_courses',
:locals=>{:courses=>@organization.courses.reorder('created_at').uniq.limit(5),:org_id=>@organization.id,:page=> 1}) %>"); :locals=>{:courses=>@organization.courses.reorder('created_at').uniq.limit(5),:org_id=>@organization.id,:page=> 1}) %>");
$("#homepageLeftMenuCourses").append("</ul>"); //$("#homepageLeftMenuCourses").append("</ul>");
$("#homepageLeftMenuCourses").show(); //$("#homepageLeftMenuCourses").show();
location.reload();

@ -4,7 +4,7 @@ $('#ajax-modal').html('<%= escape_javascript(render :partial => 'join_project_me
showModal('ajax-modal', '320px'); showModal('ajax-modal', '320px');
$('#ajax-modal').siblings().hide(); $('#ajax-modal').siblings().hide();
$('#ajax-modal').before( $('#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('position','absolute');
$('#ajax-modal').css("top","").css("left",""); $('#ajax-modal').css("top","").css("left","");
$('#ajax-modal').parent().addClass("resourceSharePopup"); $('#ajax-modal').parent().addClass("resourceSharePopup");

@ -1,6 +1,7 @@
$("#homepageLeftMenuProjects").html(""); //$("#homepageLeftMenuProjects").html("");
$("#homepageLeftMenuProjects").append("<ul>"); //$("#homepageLeftMenuProjects").append("<ul>");
$("#homepageLeftMenuProjects").append("<%= escape_javascript(render :partial => 'layouts/org_projects', //$("#homepageLeftMenuProjects").append("<%#= escape_javascript(render :partial => 'layouts/org_projects',
:locals=>{:projects=>@organization.projects.reorder('created_at').uniq.limit(5),:org_id=>@organization.id,:page=> 1}) %>"); :locals=>{:projects=>@organization.projects.reorder('created_at').uniq.limit(5),:org_id=>@organization.id,:page=> 1}) %>");
$("#homepageLeftMenuProjects").append("</ul>"); //$("#homepageLeftMenuProjects").append("</ul>");
$("#homepageLeftMenuProjects").show(); //$("#homepageLeftMenuProjects").show();
location.reload();

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

@ -20,7 +20,7 @@
<div class="homepagePostDate"> <div class="homepagePostDate">
发布时间:<%= format_time(activity.created_on) %> 发布时间:<%= format_time(activity.created_on) %>
</div> </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 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 %>"> <div id="intro_content_<%= user_activity_id %>">
<%#= activity.description.html_safe %> <%#= activity.description.html_safe %>

@ -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"> <style type="text/css">
/*回复框*/ /*回复框*/
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;} div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
@ -32,7 +32,7 @@
} }
$(function () { $(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 %>'); showNormalImage('activity_description_<%= activity.id %>');
if ($("#intro_content_<%= activity.id %>").height() > 360) { if ($("#intro_content_<%= activity.id %>").height() > 360) {
$("#intro_content_show_<%= activity.id %>").show(); $("#intro_content_show_<%= activity.id %>").show();

@ -5,9 +5,9 @@
<% if @repository.supports_cat? %> <% if @repository.supports_cat? %>
<%= link_to_if action_name != 'entry', l(:button_view), {:action => 'entry', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %> | <%= link_to_if action_name != 'entry', l(:button_view), {:action => 'entry', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %> |
<% end %> <% end %>
<% if @repository.supports_annotate? %> <%# if @repository.supports_annotate? %>
<%= link_to_if action_name != 'annotate', l(:button_annotate), {:action => 'annotate', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %> | <%#= link_to_if action_name != 'annotate', l(:button_annotate), {:action => 'annotate', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %>
<% end %> <%# end %>
<%= link_to(l(:button_download), <%= link_to(l(:button_download),
{:action => 'raw', :id => @project, {:action => 'raw', :id => @project,
:repository_id => @repository.identifier_param, :repository_id => @repository.identifier_param,

@ -20,42 +20,31 @@
<div class="col-md-10 col-sm-12"> <div class="col-md-10 col-sm-12">
<ul class="bordered-list"> <ul class="bordered-list">
<li class="commit js-toggle-container"> <li class="commit js-toggle-container">
<div class="commit-row-title">
<strong class="str-truncated">
<a class="commit-row-message"><%= textilizable(truncate_at_line_break(changeset.message)) %></a>
</strong>
<div class="pull-right" title="修订号">
<%= h truncate(changeset.short_id.to_s, :length => 20) %>
</div>
<div class="notes_count">
</div>
</div>
<div class="commit-row-info"> <div class="commit-row-info">
<% if !user_commit_rep(changeset.author_email).nil? %> <% if !user_commit_rep(changeset.author_email).nil? %>
<a class="commit-author-link has_tooltip"> <span class="commit-author-name"> <a class="commit-author-link has_tooltip"> <span class="commit-author-name">
<%= image_tag(url_to_avatar(user_commit_rep(changeset.author_email)), :width => "20", :height => "20", :class => "fl portraitRadius mt2 ml4 mr5") %> <%= image_tag(url_to_avatar(user_commit_rep(changeset.author_email)), :width => "20", :height => "20", :class => "fl portraitRadius mt2 ml4 mr5") %>
<%= link_to user_commit_rep(changeset.author_email), user_path(user_commit_rep(changeset.author_email)), :length => 30 %></span></a> <%= link_to user_commit_rep(changeset.author_email), user_path(user_commit_rep(changeset.author_email)), :length => 30 %></span></a>提交于
提交于
<div class="committed_ago"> <div class="committed_ago">
<time class="time_ago js-timeago" title="<%= changeset.created_at %>"><%= time_tag(changeset.created_at) %> <time class="time_ago js-timeago" title="<%= changeset.created_at %>"><%= time_tag(changeset.created_at) %>前 </time>&nbsp;
</time>
&nbsp;
</div> </div>
<% else %> <% else %>
<span class="commit-author-name"><%= changeset.author_email %></span> <span class="commit-author-name"><%= changeset.author_email %></span>提交于
提交于
<div class="committed_ago"> <div class="committed_ago">
<time class="time_ago js-timeago" title="<%= changeset.created_at %>"><%= time_tag(changeset.created_at) %> <time class="time_ago js-timeago" title="<%= changeset.created_at %>"><%= time_tag(changeset.created_at) %> 前</time>&nbsp;
</time>
&nbsp;
</div> </div>
<% end %> <% end %>
</div> </div>
<div style="padding-left:30px;" class="commit-row-title">
<strong class="str-truncated">
<a class="commit-row-message"><%= textilizable(truncate_at_line_break(changeset.message)) %></a>
</strong>
<div class="pull-right" title="修订号">
<%= h truncate(changeset.short_id.to_s, :length => 20) %>
</div>
<div class="notes_count">
</div>
</div>
</li> </li>
</ul> </ul>
</div> </div>
@ -65,7 +54,6 @@
<p style="padding-top: 10px;"> <p style="padding-top: 10px;">
<%#= submit_tag(l(:label_view_diff), :name => nil, :class=>"c_blue") if show_diff %> <%#= submit_tag(l(:label_view_diff), :name => nil, :class=>"c_blue") if show_diff %>
</p> </p>
<ul class="wlist"> <ul class="wlist">
<%= pagination_links_full commits_pages, commits_count, :per_page_links => false, :remote => false, :flag => true %> <%= pagination_links_full commits_pages, commits_count, :per_page_links => false, :remote => false, :flag => true %>
</ul> </ul>

@ -22,12 +22,12 @@
<% else %> <% else %>
<%= render :partial => 'navigation' %> <%= render :partial => 'navigation' %>
<div class="fl c_grey02 mt5 mr5">克隆网址:</div> <div class="fl c_grey02 mt5 mr5">克隆网址:</div>
<textarea id="copy_rep_content" class="cloneUrl mt5 fl" type="input" ><%=@repository.type.to_s=="Repository::Gitlab" ? @repos_url.to_s.lstrip : @repository.url %></textarea> <textarea id="copy_rep_content" class="cloneUrl mt5 fl" type="input" ><%= @repository.type.to_s=="Repository::Gitlab" ? @repos_url.to_s.lstrip : @repository.url %></textarea>
<a href="javascript:void(0);" class="clone_btn mt5" onclick="jsCopy()"><span class="vl_copy" title="点击复制版本库地址"></span></a> <a href="javascript:void(0);" class="clone_btn mt5" onclick="jsCopy()"><span class="vl_copy" title="点击复制版本库地址"></span></a>
<div class="fl mt5 ml15"><a href="javascript:void(0);" class="vl_btn fb" onclick="zip()"><span class="vl_zip"></span>ZIP</a> </div> <div class="fl mt5 ml15"><a href="javascript:void(0);" class="vl_btn fb" onclick="zip()"><span class="vl_zip"></span>ZIP</a> </div>
<%# 针对公开项目:用户必须创建了项目,否则用户无法同步 %> <%# 针对公开项目:用户必须创建了项目,否则用户无法同步 %>
<% if User.current.id != @project.user_id %> <% 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=>"确认要fork该项目吗" %>
<span href="javascript:void(0);" class="vl_btn_2 fb"><%= @project.forked_count.to_i %></span> <span href="javascript:void(0);" class="vl_btn_2 fb"><%= @project.forked_count.to_i %></span>
</div> </div>
<% end %> <% end %>
@ -53,7 +53,7 @@
<span class="fr mr5"><font class="fb ml2 mr2 vl_commit"> <span class="fr mr5"><font class="fb ml2 mr2 vl_commit">
<%=link_to"全部提交次数", {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev,:page=>1 ,:commit_count =>"#{@changesets_all_count}"} %></font> <%=link_to"提交明细", {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev,:page=>1 ,:commit_count =>"#{@changesets_all_count}"} %></font>
</span> </span>
</div> </div>

@ -25,8 +25,8 @@
<li > <li >
<span class="tit_fb ">编程代码:</span> <span class="tit_fb ">编程代码:</span>
<div class="showHworkP break_word"><pre class="fontGrey2 font_cus"><%= text_format(work.description) if work.description%> <div class="showHworkP break_word"><pre id="work-src" style="display: none;"><%= work.description if work.description%></pre><div class="fontGrey2 font_cus" id="work-code">
</pre> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</li> </li>

@ -1,7 +1,7 @@
<% if @user_activity_id == -1 %> <% 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})%>"); $("#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 %> <% 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}) %>"); $("#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 %> <% end %>

@ -1,3 +1,8 @@
<% content_for :header_tags do %>
<%= javascript_include_tag "/assets/codemirror/codemirror_python_ruby_c" %>
<%= stylesheet_link_tag "/assets/codemirror/codemirror" %>
<% end %>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
$("#RSide").removeAttr("id"); $("#RSide").removeAttr("id");

@ -1,8 +1,8 @@
clickCanel(); clickCanel();
<% if @user_activity_id %> <% if @user_activity_id %>
$("#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}) %>"); $("#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 %> <% else %>
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework,:is_in_course => @is_in_course}) %>"); $("#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%>");
<% end %> <% end %>

@ -4,6 +4,31 @@ if($("#about_hwork_<%= @work.id%>").children().length > 0){
else{ else{
<% if @homework.homework_type == 2%> <% if @homework.homework_type == 2%>
$("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show',:locals => {:work =>@work,:score =>@score,:student_work_scores => @student_work_scores}) %>"); $("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show',:locals => {:work =>@work,:score =>@score,:student_work_scores => @student_work_scores}) %>");
var program_name = "text/x-csrc";
var language = <%= @homework.language %>;
if (language == 1) {
program_name = 'text/x-csrc';
} else if(language==2){
program_name = 'text/x-c++src';
}else if(language==3){
program_name = 'text/x-cython';
} else if(language==4){
program_name = 'text/x-java';
}
var editor = CodeMirror(document.getElementById("work-code"), {
mode: {name: program_name,
version: 2,
singleLineStringErrors: false},
lineNumbers: true,
indentUnit: 2,
matchBrackets: true,
readOnly: true,
value: document.getElementById("work-src").innerText
}
);
<% else%> <% else%>
$("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work =>@work,:score =>@score,:student_work_scores => @student_work_scores}) %>"); $("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work =>@work,:score =>@score,:student_work_scores => @student_work_scores}) %>");
<% end%> <% end%>

@ -13,7 +13,19 @@
<%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%> <%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%>
</div> </div>
<div class="homepagePostTitle break_word"> <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] %>'> <span class='<%= get_issue_priority(activity.priority_id)[0] %>'>
<%= get_issue_priority(activity.priority_id)[1] %> <%= get_issue_priority(activity.priority_id)[1] %>
</span> </span>

@ -1,12 +1,12 @@
<%= content_for(:header_tags) do %> <%= 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 %> <% end %>
<style type="text/css"> <style type="text/css">
/*回复框*/ /*回复框*/
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;} div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;} span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
span.ke-toolbar-icon-url{background-image:url( /images/public_icon.png )} span.ke-toolbar-icon-url{background-image:url( "/images/public_icon.png" )}
div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;} div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;} span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;} span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
@ -39,7 +39,7 @@
} }
$(function() { $(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 %>'); showNormalImage('activity_description_<%= user_activity.id %>');
if($("#intro_content_<%= user_activity.id %>").height() > 360) { if($("#intro_content_<%= user_activity.id %>").height() > 360) {
$("#intro_content_show_<%= user_activity.id %>").show(); $("#intro_content_show_<%= user_activity.id %>").show();

@ -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 %>

@ -1,5 +1,5 @@
<% content_for :header_tags do %> <% 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' %> <%= javascript_include_tag 'homework','baiduTemplate' %>
<script type="text/javascript"> <script type="text/javascript">
@ -42,10 +42,10 @@
<div id="homework_editor" style="display: <%= edit_mode ? 'block':'none'%>"> <div id="homework_editor" style="display: <%= edit_mode ? 'block':'none'%>">
<div class="mt10"> <div class="mt10">
<% if edit_mode %> <% 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 %> <% else %>
<%= hidden_field_tag :asset_id, params[:asset_id], :required => false, :style => 'display:none' %> <%= hidden_field_tag :asset_id, params[:asset_id], :required => false, :style => 'display:none' %>
<%= 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 %> <% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>

@ -1,12 +1,12 @@
<%= content_for(:header_tags) do %> <%= 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 %> <% end %>
<style type="text/css"> <style type="text/css">
/*回复框*/ /*回复框*/
.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;} .homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}
.homepagePostReplyInputContainer .ke-toolbar-icon {line-height: 26px; font-size: 14px; padding-left: 26px;} .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-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 {background-position: 0px -671px; width: 50px; height: 26px;}
.homepagePostReplyInputContainer .ke-icon-emoticons:hover {background-position: -79px -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|%> <% homework_commons.each do |homework_common|%>
<script type="text/javascript"> <script type="text/javascript">
$(function() { $(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%>'); showNormalImage('homework_description_<%= homework_common.id%>');
if($("#intro_content_<%= homework_common.id%>").height() > 360) { if($("#intro_content_<%= homework_common.id%>").height() > 360) {
$("#intro_content_show_<%= homework_common.id%>").show(); $("#intro_content_show_<%= homework_common.id%>").show();

@ -17,6 +17,8 @@
<%# 系统消息 %> <%# 系统消息 %>
<%= render :partial => 'users/user_message_system', :locals => {:ma => ma} %> <%= 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} %> <%= render :partial => 'users/user_message_course', :locals => {:ma => ma} %>

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

@ -1,7 +1,7 @@
<% if @user_activity_id %> <% 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}) %>"); $("#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 %> <% 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}) %>"); $("#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 %> <% end %>

@ -1,235 +0,0 @@
# = 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"

@ -1,9 +0,0 @@
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

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

@ -0,0 +1,5 @@
class AddSenderToAtMessage < ActiveRecord::Migration
def change
add_column :at_messages, :sender_id, :integer
end
end

@ -0,0 +1,15 @@
class DeleteValidProject < ActiveRecord::Migration
def up
projects = Project.where("project_type =?", 1)
begin
projects.each do |p|
p.delete
end
rescue => e
logger.error "Delete project failed ====>#{e}"
end
end
def down
end
end

@ -0,0 +1,9 @@
# encoding: utf-8
class BatchDeleteProjectJournalActivities < ActiveRecord::Migration
def up
ForgeActivity.where('forge_act_type = \'Journal\'').destroy_all #需要触发回调
end
def down
end
end

@ -11,7 +11,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20151215112107) do ActiveRecord::Schema.define(:version => 20151218022014) do
create_table "activities", :force => true do |t| create_table "activities", :force => true do |t|
t.integer "act_id", :null => false t.integer "act_id", :null => false
@ -66,6 +66,20 @@ ActiveRecord::Schema.define(:version => 20151215112107) do
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
end end
create_table "at_messages", :force => true do |t|
t.integer "user_id"
t.integer "at_message_id"
t.string "at_message_type"
t.boolean "viewed", :default => false
t.string "container_type"
t.integer "container_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "sender_id"
end
add_index "at_messages", ["user_id"], :name => "index_at_messages_on_user_id"
create_table "attachments", :force => true do |t| create_table "attachments", :force => true do |t|
t.integer "container_id" t.integer "container_id"
t.string "container_type", :limit => 30 t.string "container_type", :limit => 30
@ -1626,10 +1640,6 @@ ActiveRecord::Schema.define(:version => 20151215112107) do
t.string "extra" t.string "extra"
end end
create_table "temp", :id => false, :force => true do |t|
t.integer "id", :default => 0, :null => false
end
create_table "time_entries", :force => true do |t| create_table "time_entries", :force => true do |t|
t.integer "project_id", :null => false t.integer "project_id", :null => false
t.integer "user_id", :null => false t.integer "user_id", :null => false

@ -58,6 +58,23 @@ class Gitlab::Client
end end
alias_method :repo_commits, :commits alias_method :repo_commits, :commits
# Gets a list of project commits.
#
# @example
# Gitlab.commits('viking')
# Gitlab.repo_commits('gitlab', :ref_name => 'api')
#
# @param [Integer] project The ID of a project.
# @param [Hash] options A customizable set of options.
# @option options [String] :ref_name The branch or tag name of a project repository.
# @option options [Integer] :page The page number.
# @option options [Integer] :per_page The number of results per page.
# @return [Array<Gitlab::ObjectifiedHash>]
def commits_total_count(project, options={})
get("/projects/#{project}/repository/commits_total_count", :query => options)
end
alias_method :repo_commits, :commits_total_count
# Gets a specific commit identified by the commit hash or name of a branch or tag. # Gets a specific commit identified by the commit hash or name of a branch or tag.
# #
# @example # @example

@ -1,29 +1,36 @@
module RailsKindeditor module RailsKindeditor
module Helper module Helper
EVAL_STR = %Q|eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);} if(typeof enableAt ==='function'){enableAt(self);} this.loadPlugin("autoheight")})|
def eval_str(at_id, at_type)
%Q|eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);};if(typeof enableAt ==='function'){enableAt(self, #{at_id}, '#{at_type}');}; this.loadPlugin('autoheight')})|
end
def kindeditor_tag(name, content = nil, options = {}) def kindeditor_tag(name, content = nil, options = {})
id = sanitize_to_id(name) id = sanitize_to_id(name)
at_id = options[:at_id] || 0
at_type = options[:at_type] || ''
input_html = { :id => id }.merge(options.delete(:input_html) || {}) input_html = { :id => id }.merge(options.delete(:input_html) || {})
input_html = input_html.merge(style: 'display:none') input_html = input_html.merge(style: 'display:none')
output = ActiveSupport::SafeBuffer.new output = ActiveSupport::SafeBuffer.new
output << text_area_tag(name, content, input_html) output << text_area_tag(name, content, input_html)
output << javascript_tag(js_replace(id, options.merge(window_onload: 'true', output << javascript_tag(js_replace(id, options.merge(window_onload: 'true',
:autoHeightMode=>true, :autoHeightMode=>true,
afterCreate: EVAL_STR, afterCreate: eval_str(at_id, at_type),
emotionsBasePath: 'http://' + Setting.host_name emotionsBasePath: 'http://' + Setting.host_name
))) )))
end end
def kindeditor(name, method, options = {}) def kindeditor(name, method, options = {})
# TODO: Refactory options: 1. kindeditor_option 2. html_option # TODO: Refactory options: 1. kindeditor_option 2. html_option
at_id = options[:at_id] || 0
at_type = options[:at_type] || ''
input_html = (options.delete(:input_html) || {}).stringify_keys input_html = (options.delete(:input_html) || {}).stringify_keys
input_html = input_html.merge(style: 'display:none') input_html = input_html.merge(style: 'display:none')
output_buffer = ActiveSupport::SafeBuffer.new output_buffer = ActiveSupport::SafeBuffer.new
output_buffer << build_text_area_tag(name, method, self, options, input_html) output_buffer << build_text_area_tag(name, method, self, options, input_html)
output_buffer << javascript_tag(js_replace(input_html['id'],options.merge(window_onload: 'true', output_buffer << javascript_tag(js_replace(input_html['id'],options.merge(window_onload: 'true',
:autoHeightMode=>true, :autoHeightMode=>true,
afterCreate: EVAL_STR, afterCreate: eval_str(at_id, at_type),
emotionsBasePath: 'http://' + Setting.host_name emotionsBasePath: 'http://' + Setting.host_name
))) )))
end end

@ -1,9 +1,12 @@
function enableAt(_editor) { var enableAt = function(_editor) {
var editor = _editor; var editor = _editor;
if(editor.edit == undefined || editor.edit.iframe == undefined){ if(editor.edit == undefined || editor.edit.iframe == undefined){
return; return;
} }
var id = arguments[1] ? arguments[1] : undefined;
var type = arguments[2] ? arguments[2] : 'Activity';
var ifr = editor.edit.iframe[0]; var ifr = editor.edit.iframe[0];
var doc = ifr.contentDocument || iframe.contentWindow.document; var doc = ifr.contentDocument || iframe.contentWindow.document;
var ifrBody = doc.body; var ifrBody = doc.body;
@ -11,10 +14,16 @@ function enableAt(_editor) {
console.log("enable at"); console.log("enable at");
$.fn.atwho.debug = true; $.fn.atwho.debug = true;
if(!atPersonLists){
return;
var names = [];
if("undefined" !== (typeof atPersonLists)){
names = atPersonLists;
}
if('undefined' != (typeof id)){
names = '/at/' + id + '?type='+type;
} }
var names = atPersonLists;
//var names = ["Jacob","Isabella","Ethan","Emma","Michael","Olivia","Alexander","Sophia","William","Ava","Joshua","Emily","Daniel","Madison","Jayden","Abigail","Noah","Chloe","你好","你你你", "가"]; //var names = ["Jacob","Isabella","Ethan","Emma","Michael","Olivia","Alexander","Sophia","William","Ava","Joshua","Emily","Daniel","Madison","Jayden","Abigail","Noah","Chloe","你好","你你你", "가"];
// //
@ -25,14 +34,13 @@ function enableAt(_editor) {
var at_config = { var at_config = {
at: "@", at: "@",
data: names, data: names,
insertTpl: '<span style="color:#269ac9">@${name}(${login})</span>', insertTpl: '<span class="at" data-user-id="${userid}">@${name}(${login})</span>',
displayTpl: "<li>${name} <small>${login}</small></li>", displayTpl: "<li>${name} <small>${login}</small></li>",
searchKey: 'searchKey', searchKey: 'searchKey',
limit: 200 limit: 200
} };
$inputor = $(ifrBody).atwho(at_config); $inputor = $(ifrBody).atwho(at_config);
window.aaa= $inputor;
$inputor.caret('pos', 47); $inputor.caret('pos', 47);
$inputor.focus().atwho('run'); $inputor.focus().atwho('run');
}; };

@ -16,7 +16,7 @@
} }
.atwho-view .cur { .atwho-view .cur {
background: #3366FF; background: #269ac9;
color: white; color: white;
} }
.atwho-view .cur small { .atwho-view .cur small {
@ -47,3 +47,6 @@
color: #777; color: #777;
font-weight: normal; font-weight: normal;
} }
/* @功能 定义 */
span.at {color:#269ac9;}

@ -282,7 +282,7 @@ K.options = {
font : ['id', 'class', 'color', 'size', 'face', '.background-color'], font : ['id', 'class', 'color', 'size', 'face', '.background-color'],
span : [ span : [
'id', 'class', '.color', '.background-color', '.font-size', '.font-family', '.background', 'id', 'class', '.color', '.background-color', '.font-size', '.font-family', '.background',
'.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.line-height' '.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.line-height', 'data-user-id'
], ],
div : [ div : [
'id', 'class', 'align', '.border', '.margin', '.padding', '.text-align', '.color', 'id', 'class', 'align', '.border', '.margin', '.padding', '.text-align', '.color',

@ -45,3 +45,4 @@
.ke-content blockquote {margin:15px 10px;border:2px solid #eee;padding:5px 5px 5px 35px;background:#f4f5f7 url('../img/blockquote.gif') no-repeat left top;color:#060;font-size:9pt;} .ke-content blockquote {margin:15px 10px;border:2px solid #eee;padding:5px 5px 5px 35px;background:#f4f5f7 url('../img/blockquote.gif') no-repeat left top;color:#060;font-size:9pt;}
span.at {color:#269ac9;}

@ -2,6 +2,7 @@ function init_editor(params){
// var minHeight; //最小高度 // var minHeight; //最小高度
var paramsHeight = params.height; //设定的高度 var paramsHeight = params.height; //设定的高度
var id = arguments[1] ? arguments[1] : undefined; var id = arguments[1] ? arguments[1] : undefined;
var type = arguments[2] ? arguments[2] : undefined;
var paramsWidth = params.width == undefined ? "100%" : params.width; var paramsWidth = params.width == undefined ? "100%" : params.width;
var editor = params.kindutil.create(params.textarea, { var editor = params.kindutil.create(params.textarea, {
@ -64,7 +65,10 @@ function init_editor(params){
edit.html("<span id='hint' style='color: #999999; font-size: 12px'>我要回复</span>"); edit.html("<span id='hint' style='color: #999999; font-size: 12px'>我要回复</span>");
this.resize(null,Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ paramsHeight , paramsHeight));// Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ paramsHeight , paramsHeight) this.resize(null,Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ paramsHeight , paramsHeight));// Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ paramsHeight , paramsHeight)
// params.toolbar_container.hide(); // params.toolbar_container.hide();
console.log("afterCreate");
if(typeof enableAt === 'function'){
enableAt(this,id, type);
}
} }
}).loadPlugin('paste'); }).loadPlugin('paste');
return editor; return editor;
@ -126,6 +130,7 @@ function nh_reset_form(params){
function init_activity_KindEditor_data(id){ function init_activity_KindEditor_data(id){
var height = arguments[1] ? arguments[1] : undefined; var height = arguments[1] ? arguments[1] : undefined;
var width = arguments[2] ? arguments[2] : undefined; var width = arguments[2] ? arguments[2] : undefined;
var type = arguments[3] ? arguments[3] : '';
KindEditor.ready(function (K) { KindEditor.ready(function (K) {
$("div[nhname='new_message_" + id + "']").each(function () { $("div[nhname='new_message_" + id + "']").each(function () {
var params = {}; var params = {};
@ -143,7 +148,7 @@ function init_activity_KindEditor_data(id){
params.height = height; params.height = height;
params.width = width; params.width = width;
if (params.textarea.data('init') == undefined) { if (params.textarea.data('init') == undefined) {
params.editor = init_editor(params,id); params.editor = init_editor(params,id, type);
init_form(params); init_form(params);
params.cancel_btn.click(function () { params.cancel_btn.click(function () {
nh_reset_form(params); nh_reset_form(params);

@ -1231,3 +1231,10 @@ div.disable_link {background-color: #c1c1c1 !important;}
/*新课程资源库*/ /*新课程资源库*/
.reCon{ margin:5px; width:710px;} .reCon{ margin:5px; width:710px;}
.reTop{width:710px; height:40px; background:#eaeaea; padding:5px;} .reTop{width:710px; height:40px; background:#eaeaea; padding:5px;}
/*问题状态图片*/
.issues{ background:url(../images/public_icon.png) -66px 5px no-repeat; width:18px; height:21px;}
.duty{ background:url(../images/public_icon.png) -66px -18px no-repeat; width:18px; height:21px;}
.support{ background:url(../images/public_icon.png) -66px -45px no-repeat; width:18px; height:21px;}
.function{ background:url(../images/public_icon.png) -66px -70px no-repeat; width:18px; height:21px;}
.weekly{ background:url(../images/public_icon.png) -66px -95px no-repeat; width:18px; height:21px;}

@ -1381,5 +1381,14 @@ a:hover.blueCir{ background:#3598db; color:#fff;}
.proHelp {background:url(/images/course/hwork_icon.png) -5px -124px no-repeat; display:inline-block; width:15px; height:15px; display:inline-block;} .proHelp {background:url(/images/course/hwork_icon.png) -5px -124px no-repeat; display:inline-block; width:15px; height:15px; display:inline-block;}
.hworkPrName {width:110px; max-width:110px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:18px; line-height:18px; font-size:12px; color:#888888; text-align:center;} .hworkPrName {width:110px; max-width:110px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:18px; line-height:18px; font-size:12px; color:#888888; text-align:center;}
.mr150 {margin-right:150px;} .mr150 {margin-right:150px;}
/* @功能 定义 */
span.at {color:#269ac9;}
.relatePInfo {position:absolute; background-color:#ffffff; padding:3px 8px; white-space:nowrap; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); z-index:999; color:#585858; cursor:pointer; display:none;} .relatePInfo {position:absolute; background-color:#ffffff; padding:3px 8px; white-space:nowrap; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); z-index:999; color:#585858; cursor:pointer; display:none;}
/*问题状态图片*/
.issues{ background:url(../images/public_icon.png) -66px 5px no-repeat; width:18px; height:21px;}
.duty{ background:url(../images/public_icon.png) -66px -18px no-repeat; width:18px; height:21px;}
.support{ background:url(../images/public_icon.png) -66px -45px no-repeat; width:18px; height:21px;}
.function{ background:url(../images/public_icon.png) -66px -70px no-repeat; width:18px; height:21px;}
.weekly{ background:url(../images/public_icon.png) -66px -95px no-repeat; width:18px; height:21px;}

@ -1085,3 +1085,10 @@ a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; c
.imageFuzzy {filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity:0.5;opacity: 0.5;} .imageFuzzy {filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity:0.5;opacity: 0.5;}
.ReplyToMessageInputContainer {width: 582px;float: left;} .ReplyToMessageInputContainer {width: 582px;float: left;}
.ReplyToMessageContainer {border-bottom:1px solid #e3e3e3; width:632px; margin:0px auto; margin-top:15px; min-height:60px;} .ReplyToMessageContainer {border-bottom:1px solid #e3e3e3; width:632px; margin:0px auto; margin-top:15px; min-height:60px;}
/*问题状态图片*/
.issues{ background:url(../images/public_icon.png) -66px 5px no-repeat; width:18px; height:21px;}
.duty{ background:url(../images/public_icon.png) -66px -18px no-repeat; width:18px; height:21px;}
.support{ background:url(../images/public_icon.png) -66px -45px no-repeat; width:18px; height:21px;}
.function{ background:url(../images/public_icon.png) -66px -70px no-repeat; width:18px; height:21px;}
.weekly{ background:url(../images/public_icon.png) -66px -95px no-repeat; width:18px; height:21px;}

@ -915,3 +915,5 @@ a.resourcesTypeUser {background:url(images/homepage_icon.png) -178px -453px no-r
.list_style ol li{list-style-type: decimal;margin-left: 20px;} .list_style ol li{list-style-type: decimal;margin-left: 20px;}
.list_style ul li{list-style-type: disc;margin-left: 20px;} .list_style ul li{list-style-type: disc;margin-left: 20px;}
/* @功能 定义 */
span.at {color:#269ac9;}

@ -0,0 +1,12 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :at_message do
user nil
at_message_id 1
at_message_type "MyString"
viewed false
container_type "MyString"
container_id 1
end
end

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe AtMessage, :type => :model do
pending "add some examples to (or delete) #{__FILE__}"
end
Loading…
Cancel
Save