From 3476731b83a418fa31153866e64245a6ecb16554 Mon Sep 17 00:00:00 2001
From: guange <8863824@gmail.com>
Date: Wed, 9 Dec 2015 09:59:13 +0800
Subject: [PATCH 01/80] =?UTF-8?q?=E5=B0=86at=20js=20data=E6=95=B4=E5=90=88?=
=?UTF-8?q?=E5=88=B0=E6=96=87=E4=BB=B6=E4=B8=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/at_controller.rb | 25 +++++++++++++++++++++++
app/controllers/issues_controller.rb | 29 ++++++++++-----------------
app/helpers/application_helper.rb | 10 +--------
app/views/at/show.js.erb | 8 ++++++++
app/views/issues/show.html.erb | 2 +-
config/routes.rb | 3 ++-
public/assets/kindeditor/at/config.js | 5 ++---
7 files changed, 50 insertions(+), 32 deletions(-)
create mode 100644 app/controllers/at_controller.rb
create mode 100644 app/views/at/show.js.erb
diff --git a/app/controllers/at_controller.rb b/app/controllers/at_controller.rb
new file mode 100644
index 000000000..92506d4e8
--- /dev/null
+++ b/app/controllers/at_controller.rb
@@ -0,0 +1,25 @@
+#coding=utf-8
+
+class AtController < ApplicationController
+ respond_to :js
+
+ def show
+ type = params[:type]
+ case type
+ when "Issue"
+ @users = find_issue(params)
+ else
+ end
+ end
+
+ private
+ def find_issue(params)
+ #1. issues list persons
+ #2. project persons
+ issue = Issue.find(params[: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
+
+end
\ No newline at end of file
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index 7cdc838e2..6f441c29a 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -142,24 +142,17 @@ class IssuesController < ApplicationController
@project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'#by young
@available_watchers = (@issue.project.users.sort + @issue.watcher_users).uniq
- #id name email
- #1. issues list persons
- #2. project persons
- @at_persons = @journals.map(&:user) + @issue.project.users
- @at_persons = @at_persons.uniq{|u| u.id}.delete_if{|u| u.id == User.current.id}
- @at_persons = nil
-
- respond_to do |format|``
- format.html {
- retrieve_previous_and_next_issue_ids
- render :template => 'issues/show', :layout => @project_base_tag#by young
- }
- format.api
- format.atom { render :template => 'journals/index', :layout => false, :content_type => 'application/atom+xml' }
- format.pdf {
- pdf = issue_to_pdf(@issue, :journals => @journals)
- send_data(pdf, :type => 'application/pdf', :filename => filename_for_content_disposition("#{@project.identifier}-#{@issue.id}.pdf") )
- }
+ respond_to do |format|
+ format.html {
+ retrieve_previous_and_next_issue_ids
+ render :template => 'issues/show', :layout => @project_base_tag#by young
+ }
+ format.api
+ format.atom { render :template => 'journals/index', :layout => false, :content_type => 'application/atom+xml' }
+ format.pdf {
+ pdf = issue_to_pdf(@issue, :journals => @journals)
+ send_data(pdf, :type => 'application/pdf', :filename => filename_for_content_disposition("#{@project.identifier}-#{@issue.id}.pdf") )
+ }
end
end
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index ba8fe4f53..227de930f 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -2624,15 +2624,7 @@ int main(int argc, char** argv){
opt = {enable_at: true, prettify: false, init_activity: false}.merge default_opt
ss = ''
if opt[:enable_at]
- ss = '"
+ ss += %Q||
end
ss += javascript_include_tag("/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg')
diff --git a/app/views/at/show.js.erb b/app/views/at/show.js.erb
new file mode 100644
index 000000000..df253f237
--- /dev/null
+++ b/app/views/at/show.js.erb
@@ -0,0 +1,8 @@
+(function(){
+ window.atPersonLists = [];
+ <% @users && @users.each_with_index do |person,index| %>
+ var o = {id: <%=index%>, name: '<%=person.show_name%>', login: '<%=person.login%>', searchKey: '<%=person.get_at_show_name%>'};
+ atPersonLists.push(o);
+ <% end %>
+
+})();
diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb
index 80d3aaac1..67d1186c4 100644
--- a/app/views/issues/show.html.erb
+++ b/app/views/issues/show.html.erb
@@ -1,5 +1,5 @@
<%= content_for(:header_tags) do %>
-<%= import_ke(enable_at: true) %>
+<%= import_ke(enable_at: {id: @issue.id, type: 'Issue'}) %>
<% end %>
diff --git a/config/routes.rb b/config/routes.rb
index 59eb29d70..656f55720 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1035,13 +1035,14 @@ RedmineApp::Application.routes.draw do
match 'system_log/clear'
##ended by lizanle
-
resources :git_callback do
collection do
post 'post_update'
end
end
+ resources :at
+
Dir.glob File.expand_path("plugins/*", Rails.root) do |plugin_dir|
file = File.join(plugin_dir, "config/routes.rb")
if File.exists?(file)
diff --git a/public/assets/kindeditor/at/config.js b/public/assets/kindeditor/at/config.js
index b9769c42e..0a1bbf11a 100644
--- a/public/assets/kindeditor/at/config.js
+++ b/public/assets/kindeditor/at/config.js
@@ -1,4 +1,4 @@
-function enableAt(_editor) {
+var enableAt = function(_editor) {
var editor = _editor;
if(editor.edit == undefined || editor.edit.iframe == undefined){
return;
@@ -11,7 +11,7 @@ function enableAt(_editor) {
console.log("enable at");
$.fn.atwho.debug = true;
- if(!atPersonLists){
+ if("undefined" === (typeof atPersonLists) || !atPersonLists){
return;
}
var names = atPersonLists;
@@ -32,7 +32,6 @@ function enableAt(_editor) {
}
$inputor = $(ifrBody).atwho(at_config);
- window.aaa= $inputor;
$inputor.caret('pos', 47);
$inputor.focus().atwho('run');
};
From 91b245ad2cb694726996c31811276b5129a0be7e Mon Sep 17 00:00:00 2001
From: guange <8863824@gmail.com>
Date: Sat, 12 Dec 2015 18:06:59 +0800
Subject: [PATCH 02/80] =?UTF-8?q?lastname=E4=B8=BA=E7=A9=BA=E6=97=B6?=
=?UTF-8?q?=E4=B9=9F=E5=8F=AF=E4=BB=A5=E5=8A=A0,=E5=8F=AF=E4=BB=A5?=
=?UTF-8?q?=E7=9C=81=E6=8E=89=E6=9F=A5=E8=AF=A2extensions=E7=9A=84?=
=?UTF-8?q?=E8=AF=AD=E5=8F=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/user.rb | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/app/models/user.rb b/app/models/user.rb
index 65c0bf858..0d3d465e2 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -399,16 +399,7 @@ class User < Principal
end
def show_name
- name = ""
- unless self.user_extensions.nil?
- if self.user_extensions.identity == 2
- name = firstname
- else
- name = lastname+firstname
- end
- else
- name = lastname+firstname
- end
+ name = lastname + firstname
name.empty? || name.nil? ? login : name
end
## end
From 9b86ec30445a0ad2682ee91361ecbbf2a0019543 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Mon, 14 Dec 2015 10:07:55 +0800
Subject: [PATCH 03/80] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/welcome/_search_all_results.html.erb | 4 ++--
app/views/welcome/_search_memo_results.html.erb | 2 +-
app/views/welcome/_search_project_results.html.erb | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/views/welcome/_search_all_results.html.erb b/app/views/welcome/_search_all_results.html.erb
index 34ef9a8eb..7256534e5 100644
--- a/app/views/welcome/_search_all_results.html.erb
+++ b/app/views/welcome/_search_all_results.html.erb
@@ -67,7 +67,7 @@
<%= item.try(:highlight).try(:description) ? item.highlight.description[0].html_safe : item.description%>
-
管理人员:<%= item.user_id ? User.find(item.user_id).login : '无' %> 创建时间:<%= date_format_local( Project.find(item.id).created_on) %>
+
管理人员:<%= item.user_id ? User.find(item.user_id).login : '无' %> 更新时间:<%= date_format_local( Project.find(item.id).updated_on) %>
@@ -83,7 +83,7 @@
<%= item.try(:highlight).try(:content) ? item.highlight.content[0].html_safe : item.content.html_safe%>
-
发帖人:<%= item.author_id ? User.find(item.author_id).login : '无' %> 创建时间:<%= format_date( item.created_at) %>
+
发帖人:<%= item.author_id ? User.find(item.author_id).login : '无' %> 更新时间:<%= format_date( item.updated_at) %>
diff --git a/app/views/welcome/_search_memo_results.html.erb b/app/views/welcome/_search_memo_results.html.erb
index c5fe9cc72..98f9ae7f0 100644
--- a/app/views/welcome/_search_memo_results.html.erb
+++ b/app/views/welcome/_search_memo_results.html.erb
@@ -12,7 +12,7 @@
<%= memo.try(:highlight).try(:content) ? memo.highlight.content[0].html_safe : memo.content.html_safe%>
-
发帖人:<%= memo.author_id ? User.find(memo.author_id).login : '无' %> 创建时间:<%= format_date( memo.created_at) %>
+
发帖人:<%= memo.author_id ? User.find(memo.author_id).login : '无' %> 更新时间:<%= format_date( memo.updated_at) %>
diff --git a/app/views/welcome/_search_project_results.html.erb b/app/views/welcome/_search_project_results.html.erb
index b3ed44654..5775a939d 100644
--- a/app/views/welcome/_search_project_results.html.erb
+++ b/app/views/welcome/_search_project_results.html.erb
@@ -12,7 +12,7 @@
<%= project.try(:highlight).try(:description) ? project.highlight.description[0].html_safe : project.description%>
-
管理人员:<%= project.user_id ? User.find(project.user_id).login : '无' %> 创建时间:<%= date_format_local( Project.find(project.id).created_on) %>
+
管理人员:<%= project.user_id ? User.find(project.user_id).login : '无' %> 更新时间:<%= date_format_local( Project.find(project.id).updated_on) %>
From f6867068f532de4259e863c7783e313852ff07a9 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Mon, 14 Dec 2015 10:27:30 +0800
Subject: [PATCH 04/80] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=20=E5=B8=96=E5=AD=90?=
=?UTF-8?q?=20=20=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4=20=E8=B5=84=E6=BA=90?=
=?UTF-8?q?=20=E4=B8=8B=E8=BD=BD=E6=AC=A1=E6=95=B0=20=E7=94=A8=E6=88=B7=20?=
=?UTF-8?q?=E6=9C=80=E5=90=8E=E7=99=BB=E9=99=86=E6=97=B6=E9=97=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/welcome/_search_all_results.html.erb | 9 +++++++--
app/views/welcome/_search_attachment_results.html.erb | 4 +++-
app/views/welcome/_search_user_results.html.erb | 4 +++-
3 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/app/views/welcome/_search_all_results.html.erb b/app/views/welcome/_search_all_results.html.erb
index 7256534e5..537da336a 100644
--- a/app/views/welcome/_search_all_results.html.erb
+++ b/app/views/welcome/_search_all_results.html.erb
@@ -17,7 +17,10 @@
<%= User.find(item.id).user_extensions && User.find(item.id).user_extensions.brief_introduction.present? ? User.find(item.id).user_extensions.brief_introduction : '这位童鞋很懒,什么也没有留下~'%>
-
加入时间:<%= format_date( User.find(item.id).created_on)%> <%= User.find(item.id).user_extensions.occupation.present? ? '单位:'+User.find(item.id).user_extensions.occupation : ''%>
+
+ 加入时间:<%= format_date( User.find(item.id).created_on)%>
+ 最后登陆时间:<%= format_date( User.find(item.id).last_login_on)%>
+ <%= User.find(item.id).user_extensions.occupation.present? ? '单位:'+User.find(item.id).user_extensions.occupation : ''%>
@@ -51,7 +54,9 @@
发布者:<%= User.find(item.author_id).login%>(<%= User.find(item.author_id).realname%>)
- 发布时间:<%= format_date(item.created_on)%>
+
发布时间:<%= format_date(item.created_on)%>
+
下载次数:<%= item.downloads%>次
+
diff --git a/app/views/welcome/_search_attachment_results.html.erb b/app/views/welcome/_search_attachment_results.html.erb
index 36c4fcbab..21ba68336 100644
--- a/app/views/welcome/_search_attachment_results.html.erb
+++ b/app/views/welcome/_search_attachment_results.html.erb
@@ -12,7 +12,9 @@
发布者:<%= User.find(attachment.author_id).login%>(<%= User.find(attachment.author_id).realname%>)
- 发布时间:<%= format_date(attachment.created_on)%>
+
发布时间:<%= format_date(attachment.created_on)%>
+
下载次数:<%= attachment.downloads%>次
+
diff --git a/app/views/welcome/_search_user_results.html.erb b/app/views/welcome/_search_user_results.html.erb
index 459d3a27b..d1c8c2393 100644
--- a/app/views/welcome/_search_user_results.html.erb
+++ b/app/views/welcome/_search_user_results.html.erb
@@ -12,7 +12,9 @@
<%= User.find(user.id).user_extensions && User.find(user.id).user_extensions.brief_introduction.present? ? User.find(user.id).user_extensions.brief_introduction : '这位童鞋很懒,什么也没有留下~'%>
-
加入时间:<%= format_date( User.find(user.id).created_on)%> <%= User.find(user.id).user_extensions.occupation.present? ? '单位:'+User.find(user.id).user_extensions.occupation : ''%>
+
加入时间:<%= format_date( User.find(user.id).created_on)%>
+ 最后登陆时间:<%= format_date( User.find(user.id).last_login_on)%>
+ <%= User.find(user.id).user_extensions.occupation.present? ? '单位:'+User.find(user.id).user_extensions.occupation : ''%>
From c004b059913b3999ade0434c7a3d25dc7842daf3 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Mon, 14 Dec 2015 10:52:19 +0800
Subject: [PATCH 05/80] =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=BA=93=E6=90=9C?=
=?UTF-8?q?=E7=B4=A2=20sql=E6=B3=A8=E5=85=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/users_controller.rb | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 834009d71..c20282a45 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1857,46 +1857,46 @@ class UsersController < ApplicationController
# 根据资源关键字进行搜索
def resource_search
- search = params[:search].to_s.strip.downcase
+ search = "%#{params[:search].strip.downcase}%"
if(params[:type].nil? || params[:type].blank? || params[:type] == "1" || params[:type] == 'all') #全部
if User.current.id.to_i == params[:id].to_i
user_course_ids = User.current.courses.map { |c| c.id} #我的资源库的话,那么应该是我上传的所有资源 加上 我加入的课程的所有资源 取交集并查询
@attachments = Attachment.where("((author_id = #{params[:id]} and container_type in('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon')) "+
- " or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))) and (filename like '%#{search}%') ").order("created_on desc")
+ " or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')}))) and (filename like :p) ",:p=>search).order("created_on desc")
else
user_course_ids = User.find(params[:id]).courses.visible.map { |c| c.id} #如果课程私有资源,那么要看这个资源的课程是不是在 这个user的所有我可见的课程中
@attachments = Attachment.where("((author_id = #{params[:id]} and is_public = 1 and container_type in" +
" ('Project','Principal','Course','Issue','Document','Message','News','StudentWorkScore','HomewCommon'))"+
" or (container_type = 'Course' and is_public = 1 and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) )" +
- " and (filename like '%#{search}%') ").order("created_on desc")
+ " and (filename like :p) ",:p=>search).order("created_on desc")
end
elsif params[:type] == "2" #课程资源
if User.current.id.to_i == params[:id].to_i
user_course_ids = User.current.courses.map { |c| c.id}
- @attachments = Attachment.where("(author_id = #{params[:id]} and container_type = 'Course') or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) and (filename like '%#{search}%') ").order("created_on desc")
+ @attachments = Attachment.where("(author_id = #{params[:id]} and container_type = 'Course') or (container_type = 'Course' and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) and (filename like :p) ",:p=>search).order("created_on desc")
else
user_course_ids = User.find(params[:id]).courses.visible.map { |c| c.id} #如果课程私有资源,那么要看这个资源的课程是不是在 这个user的所有我可见的课程中
@attachments = Attachment.where("((author_id = #{params[:id]} and is_public = 1 and container_type = 'Course') "+
"or (container_type = 'Course' and is_public = 1 and container_id in (#{user_course_ids.empty? ? '0': user_course_ids.join(',')})) )"+
- " and (filename like '%#{search}%') ").order("created_on desc")
+ " and (filename like :p) ",:p=>search).order("created_on desc")
end
elsif params[:type] == "3" #项目资源
if User.current.id.to_i == params[:id].to_i
- @attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Project' and (filename like '%#{search}%')").order("created_on desc")
+ @attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Project' and (filename like :p)",:p=>search).order("created_on desc")
else
- @attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type = 'Project' and (filename like '%#{search}%') ").order("created_on desc")
+ @attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type = 'Project' and (filename like :p) ",:p=>search).order("created_on desc")
end
elsif params[:type] == "4" #附件
if User.current.id.to_i == params[:id].to_i
- @attachments = Attachment.where("author_id = #{params[:id]} and container_type in('Project','Issue','Document','Message','News','StudentWorkScore','HomewCommon') and (filename like '%#{search}%')").order("created_on desc")
+ @attachments = Attachment.where("author_id = #{params[:id]} and container_type in('Project','Issue','Document','Message','News','StudentWorkScore','HomewCommon') and (filename like :p)",:p=>search).order("created_on desc")
else
- @attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon') and (filename like '%#{search}%')").order("created_on desc")
+ @attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type in('Issue','Document','Message','News','StudentWorkScore','HomewCommon') and (filename like :p)",:p=>search).order("created_on desc")
end
elsif params[:type] == "5" #用户资源
if User.current.id.to_i == params[:id].to_i
- @attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Principal' and (filename like '%#{search}%')").order("created_on desc")
+ @attachments = Attachment.where("author_id = #{params[:id]} and container_type = 'Principal' and (filename like :p)",:p=>search).order("created_on desc")
else
- @attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type = 'Principal' and (filename like '%#{search}%')").order("created_on desc")
+ @attachments = Attachment.where("author_id = #{params[:id]} and is_public = 1 and container_type = 'Principal' and (filename like :p)",:p=>search).order("created_on desc")
end
end
@type = params[:type]
From 5ca8d4cd66cd77c5fa6d99c30f0c3a2ba6acace8 Mon Sep 17 00:00:00 2001
From: huang
Date: Mon, 14 Dec 2015 10:54:37 +0800
Subject: [PATCH 06/80] =?UTF-8?q?=E4=BF=AE=E6=94=B9http=E9=93=BE=E6=8E=A5?=
=?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=8D=A2=E5=9F=9F=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/_base_footer_public.html.erb | 4 ++--
app/views/layouts/_footer.html.erb | 2 +-
app/views/layouts/_logined_header.html.erb | 2 +-
app/views/layouts/_unlogin_header.html.erb | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/app/views/layouts/_base_footer_public.html.erb b/app/views/layouts/_base_footer_public.html.erb
index dba26f1f6..eb2e83ba2 100644
--- a/app/views/layouts/_base_footer_public.html.erb
+++ b/app/views/layouts/_base_footer_public.html.erb
@@ -2,9 +2,9 @@
diff --git a/app/views/layouts/_unlogin_header.html.erb b/app/views/layouts/_unlogin_header.html.erb
index 162f59ed4..b16a78921 100644
--- a/app/views/layouts/_unlogin_header.html.erb
+++ b/app/views/layouts/_unlogin_header.html.erb
@@ -5,7 +5,7 @@
From 85e2eab8c3fdba04bc9436834b39b06f2844509c Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Mon, 14 Dec 2015 10:57:17 +0800
Subject: [PATCH 07/80] =?UTF-8?q?=E5=8F=91=E9=80=81=E8=B5=84=E6=BA=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/users_controller.rb | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index c20282a45..d20fbc05c 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1423,7 +1423,8 @@ class UsersController < ApplicationController
def search_user_course
@user = User.current
if !params[:search].nil?
- @course = @user.courses.where(" #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like '%#{params[:search.to_s]}%'")
+ search = "%#{params[:search].to_s.strip.downcase}%"
+ @course = @user.courses.where(" #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search)
.select { |course| @user.allowed_to?(:as_teacher,course)}
else
@course = @user.courses
@@ -1442,7 +1443,8 @@ class UsersController < ApplicationController
def search_user_project
@user = User.current
if !params[:search].nil?
- @projects = @user.projects.where(" #{Project.table_name}.id = #{params[:search].to_i } or #{Project.table_name}.name like '%#{params[:search.to_s]}%'")
+ search = "%#{params[:search].to_s.strip.downcase}%"
+ @projects = @user.projects.where(" #{Project.table_name}.id = #{params[:search].to_i } or #{Project.table_name}.name like :p",:p=>search)
else
@projects = @user.projects
end
From 14912078ee3067a922e7a61886f763a3ed14c195 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Mon, 14 Dec 2015 11:03:04 +0800
Subject: [PATCH 08/80] =?UTF-8?q?=E5=8D=9A=E5=AE=A2=E8=B5=84=E6=BA=90?=
=?UTF-8?q?=E5=85=81=E8=AE=B8=E4=B8=8B=E8=BD=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/application_helper.rb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index cbc646eac..ad4da60a7 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1934,6 +1934,8 @@ module ApplicationHelper
candown = true
elsif attachment.container.class.to_s=="StudentWork"
candown = true
+ elsif attachment.container.class.to_s=="BlogComment" #博客资源允许下载
+ candown = true
elsif attachment.container.class.to_s == "User"
candown = (attachment.is_public == 1 || attachment.is_public == true || attachment.author_id == User.current.id)
elsif attachment.container_type == "Bid" && attachment.container && attachment.container.courses
From 9aebafee09990cdd25fb4bafa0d9977e3b6c381b Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Mon, 14 Dec 2015 11:11:09 +0800
Subject: [PATCH 09/80] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/welcome/_search_all_results.html.erb | 6 +++++-
app/views/welcome/_search_course_results.html.erb | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/app/views/welcome/_search_all_results.html.erb b/app/views/welcome/_search_all_results.html.erb
index 537da336a..4ed9fba33 100644
--- a/app/views/welcome/_search_all_results.html.erb
+++ b/app/views/welcome/_search_all_results.html.erb
@@ -37,7 +37,11 @@
<%= item.try(:highlight).try(:description) ? item.highlight.description[0].html_safe : item.description %>
- 教师:<%= User.find(item.tea_id).realname %> 授课时间:<%= item.time.to_s + item.term%> <%= User.find(item.tea_id).user_extensions.occupation.present? ? '单位:'+User.find(item.tea_id).user_extensions.occupation : ''%>
+
+ 教师:<%= User.find(item.tea_id).realname %>
+ 授课时间:<%= item.time.to_s + item.term%>
+ 更新时间:<%= format_date(item.updated_at)%>
+ <%= User.find(item.tea_id).user_extensions.occupation.present? ? '单位:'+User.find(item.tea_id).user_extensions.occupation : ''%>
diff --git a/app/views/welcome/_search_course_results.html.erb b/app/views/welcome/_search_course_results.html.erb
index 89567063d..e51452ada 100644
--- a/app/views/welcome/_search_course_results.html.erb
+++ b/app/views/welcome/_search_course_results.html.erb
@@ -12,7 +12,11 @@
<%= course.try(:highlight).try(:description) ? course.highlight.description[0].html_safe : (course.description.present? ? course.description : '暂时没有该课程描述') %>
- 教师:<%= User.find(course.tea_id).realname %> 授课时间:<%= course.time.to_s + course.term%> <%= User.find(course.tea_id).user_extensions.occupation.present? ? '单位:'+User.find(course.tea_id).user_extensions.occupation : ''%>
+
+ 教师:<%= User.find(course.tea_id).realname %>
+ 授课时间:<%= course.time.to_s + course.term%>
+ 更新时间:<%= format_date(course.updated_at)%>
+ <%= User.find(course.tea_id).user_extensions.occupation.present? ? '单位:'+User.find(course.tea_id).user_extensions.occupation : ''%>
From f3013ca3e71dc61effbedb4a733ad41c2fbe7919 Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Mon, 14 Dec 2015 11:22:36 +0800
Subject: [PATCH 10/80] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E6=90=9C?=
=?UTF-8?q?=E7=B4=A2=E7=9A=84=E6=8F=90=E7=A4=BA=E6=8F=8F=E8=BF=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/_logined_header.html.erb | 2 +-
app/views/layouts/_unlogin_header.html.erb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb
index d100e79a5..a0cbe4eed 100644
--- a/app/views/layouts/_logined_header.html.erb
+++ b/app/views/layouts/_logined_header.html.erb
@@ -54,7 +54,7 @@
<% name = name%>
<%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>
- " id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索公开的课程、项目、用户以及资源"/>
+ " id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索公开的课程、项目、用户、资源以及帖子"/>
diff --git a/app/views/layouts/_unlogin_header.html.erb b/app/views/layouts/_unlogin_header.html.erb
index 162f59ed4..7a2196d01 100644
--- a/app/views/layouts/_unlogin_header.html.erb
+++ b/app/views/layouts/_unlogin_header.html.erb
@@ -52,7 +52,7 @@
<% name = name%>
<%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>
- " id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索公开的课程、项目、用户以及资源" onkeypress="search_in_header_I(event,$(this));"/>
+ " id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词搜索公开的课程、项目、用户、资源以及帖子" onkeypress="search_in_header_I(event,$(this));"/>
From f61f639af2fe13598a74d1e35507470b15d735e1 Mon Sep 17 00:00:00 2001
From: guange <8863824@gmail.com>
Date: Mon, 14 Dec 2015 17:13:57 +0800
Subject: [PATCH 11/80] =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E4=B8=BAremote=20js?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/at_controller.rb | 134 ++++++++++++++++--
app/helpers/application_helper.rb | 19 ++-
app/views/at/show.js.erb | 8 --
app/views/at/show.json.erb | 6 +
app/views/bids/_new_homework_form.html.erb | 4 +-
app/views/blog_comments/_edit.html.erb | 6 +-
app/views/blog_comments/_reply_form.html.erb | 6 +-
app/views/blog_comments/quote.js.erb | 2 +-
app/views/blog_comments/reply.js.erb | 4 +-
app/views/blog_comments/show.html.erb | 2 +-
app/views/blogs/_article_list.html.erb | 2 +-
app/views/boards/_course_new.html.erb | 6 +-
app/views/boards/_course_show.html.erb | 2 +-
app/views/comments/create.js.erb | 2 +-
app/views/courses/_course_activity.html.erb | 6 +-
app/views/courses/_courses_jours.html.erb | 5 +-
app/views/courses/syllabus.html.erb | 4 +-
.../start_anonymous_comment.js.erb | 4 +-
.../stop_anonymous_comment.js.erb | 4 +-
app/views/issues/_edit.html.erb | 5 +-
app/views/issues/_form.html.erb | 2 +-
app/views/issues/add_journal.js.erb | 2 +-
app/views/issues/add_journal_in_org.js.erb | 2 +-
app/views/issues/new.html.erb | 2 +-
app/views/issues/show.html.erb | 2 +-
app/views/memos/show.html.erb | 2 +-
app/views/messages/_course_show.html.erb | 2 +-
app/views/messages/quote.js.erb | 2 +-
app/views/messages/reply.js.erb | 2 +-
.../_reply_form.html.erb | 2 +-
.../org_document_comments/add_reply.js.erb | 2 +-
.../org_document_comments/index.html.erb | 2 +-
app/views/org_document_comments/quote.js.erb | 2 +-
app/views/org_document_comments/show.html.erb | 2 +-
.../organizations/_org_activities.html.erb | 2 +-
app/views/organizations/show.html.erb | 2 +-
.../forbidden_anonymous_comment.js.erb | 4 +-
app/views/student_work/set_score_rule.js.erb | 4 +-
app/views/users/_user_activities.html.erb | 6 +-
app/views/users/_user_homework_form.html.erb | 6 +-
app/views/users/_user_homework_list.html.erb | 6 +-
app/views/words/create_reply.js.erb | 2 +-
app/views/words/leave_homework_message.js.erb | 4 +-
.../lib/rails_kindeditor/helper.rb | 13 +-
public/assets/kindeditor/at/config.js | 17 ++-
.../javascripts/init_activity_KindEditor.js | 9 +-
46 files changed, 242 insertions(+), 92 deletions(-)
delete mode 100644 app/views/at/show.js.erb
create mode 100644 app/views/at/show.json.erb
diff --git a/app/controllers/at_controller.rb b/app/controllers/at_controller.rb
index 92506d4e8..3759abf53 100644
--- a/app/controllers/at_controller.rb
+++ b/app/controllers/at_controller.rb
@@ -1,25 +1,143 @@
#coding=utf-8
class AtController < ApplicationController
- respond_to :js
+ respond_to :json
def show
- type = params[:type]
+ @logger = Logger.new(Rails.root.join('log', 'at.log').to_s)
+ users = find_at_users(params[:type], params[:id])
+ @users = users.uniq { |u| u.id }.delete_if { |u| u.id == User.current.id }
+ end
+
+ private
+ def find_at_users(type, id)
+ @logger.info("#{type}, #{id}")
case type
when "Issue"
- @users = find_issue(params)
+ 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)
else
+ nil
end
end
- private
- def find_issue(params)
+ def find_issue(id)
#1. issues list persons
#2. project persons
- issue = Issue.find(params[:id])
- journals = issue.journals
+ 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}
+ 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)
+
+ 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
\ No newline at end of file
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 227de930f..98249dbc8 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1716,6 +1716,13 @@ module ApplicationHelper
#
def javascript_include_tag(*sources)
options = sources.last.is_a?(Hash) ? sources.pop : {}
+
+ @sources ||= []
+ sources = sources.delete_if do|source|
+ @sources.include?(source)
+ end
+ @sources += sources
+
if plugin = options.delete(:plugin)
sources = sources.map do |source|
if plugin
@@ -1725,7 +1732,12 @@ module ApplicationHelper
end
end
end
- super sources, options
+
+ if sources && !sources.empty?
+ super(sources, options)
+ else
+ ''
+ end
end
def content_for(name, content = nil, &block)
@@ -2621,11 +2633,8 @@ int main(int argc, char** argv){
end
def import_ke(default_opt={})
- opt = {enable_at: true, prettify: false, init_activity: false}.merge default_opt
+ opt = {enable_at: false, prettify: false, init_activity: false}.merge default_opt
ss = ''
- if opt[:enable_at]
- ss += %Q||
- end
ss += javascript_include_tag("/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg')
if opt[:enable_at]
diff --git a/app/views/at/show.js.erb b/app/views/at/show.js.erb
deleted file mode 100644
index df253f237..000000000
--- a/app/views/at/show.js.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-(function(){
- window.atPersonLists = [];
- <% @users && @users.each_with_index do |person,index| %>
- var o = {id: <%=index%>, name: '<%=person.show_name%>', login: '<%=person.login%>', searchKey: '<%=person.get_at_show_name%>'};
- atPersonLists.push(o);
- <% end %>
-
-})();
diff --git a/app/views/at/show.json.erb b/app/views/at/show.json.erb
new file mode 100644
index 000000000..7af729ff7
--- /dev/null
+++ b/app/views/at/show.json.erb
@@ -0,0 +1,6 @@
+[
+ <% @users && @users.each_with_index do |person,index| %>
+ {"id": <%=index%>, "name": "<%=person.show_name%>", "login": "<%=person.login%>", "searchKey": "<%=person.get_at_show_name%>"}
+ <%= index != @users.size-1 ? ',' : '' %>
+ <% end %>
+]
diff --git a/app/views/bids/_new_homework_form.html.erb b/app/views/bids/_new_homework_form.html.erb
index 5958fccff..815ff27e4 100644
--- a/app/views/bids/_new_homework_form.html.erb
+++ b/app/views/bids/_new_homework_form.html.erb
@@ -15,10 +15,10 @@
<%= l(:field_quote)%> :
<% if edit_mode %>
- <%= f.kindeditor :description,:width=>'91%',:editor_id => 'bid_description_editor',:owner_id => bid.id,:owner_type =>OwnerTypeHelper::BID,:resizeType => 0 %>
+ <%= f.kindeditor :description,:width=>'91%',:editor_id => 'bid_description_editor',:owner_id => bid.id,:owner_type =>OwnerTypeHelper::BID,:resizeType => 0,act_id: @course.id, act_type: @course.class.to_s %>
<% else %>
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
- <%= f.kindeditor :description,:width=>'91%',:editor_id => 'bid_description_editor',:resizeType => 0 %>
+ <%= f.kindeditor :description,:width=>'91%',:editor_id => 'bid_description_editor',:resizeType => 0, act_id: @course.id, act_type: @course.class.to_s %>
<% end %>
diff --git a/app/views/blog_comments/_edit.html.erb b/app/views/blog_comments/_edit.html.erb
index c7065ece4..048402635 100644
--- a/app/views/blog_comments/_edit.html.erb
+++ b/app/views/blog_comments/_edit.html.erb
@@ -1,5 +1,5 @@
<%= content_for(:header_tags) do %>
- <%= import_ke(enable_at: false, prettify: false) %>
+ <%= import_ke(enable_at: true, prettify: false) %>
<%= javascript_include_tag 'blog' %>
<% end %>
@@ -34,7 +34,9 @@
:class => 'talk_text fl',
:input_html => { :id => 'message_content',
:class => 'talk_text fl',
- :maxlength => 5000 }%>
+ :maxlength => 5000 },
+ act_id: article.id, act_type: article.class.to_s
+ %>
diff --git a/app/views/blog_comments/_reply_form.html.erb b/app/views/blog_comments/_reply_form.html.erb
index 32f4333c2..67642069c 100644
--- a/app/views/blog_comments/_reply_form.html.erb
+++ b/app/views/blog_comments/_reply_form.html.erb
@@ -1,5 +1,5 @@
<%= content_for(:header_tags) do %>
- <%= import_ke(enable_at: false, prettify: false) %>
+ <%= import_ke(enable_at: true, prettify: false) %>
<% end %>
* <%= l(:field_subject) %> :
@@ -27,7 +27,9 @@
:minHeight=>100,
:input_html => { :id => 'message_content',
:class => 'talk_text fl',
- :maxlength => 5000 }%>
+ :maxlength => 5000 },
+ at_id: article.id, at_type: article.class.to_s
+ %>
diff --git a/app/views/blog_comments/quote.js.erb b/app/views/blog_comments/quote.js.erb
index 088b2cf67..cd53707d5 100644
--- a/app/views/blog_comments/quote.js.erb
+++ b/app/views/blog_comments/quote.js.erb
@@ -3,7 +3,7 @@ if($("#reply_message_<%= @blogComment.id%>").length > 0) {
$(function(){
$('#reply_subject').val("<%= raw escape_javascript(@subject) %>");
$('#quote_quote').val("<%= raw escape_javascript(@temp.content.html_safe) %>");
- init_activity_KindEditor_data(<%= @blogComment.id%>,null,"85%");
+ init_activity_KindEditor_data(<%= @blogComment.id%>,null,"85%", "<%=@blogComment.class.to_s%>");
});
}else if($("#reply_to_message_<%= @blogComment.id%>").length >0) {
$("#reply_to_message_<%= @blogComment.id%>").replaceWith("");
diff --git a/app/views/blog_comments/reply.js.erb b/app/views/blog_comments/reply.js.erb
index 1cb64b2b5..06adca74d 100644
--- a/app/views/blog_comments/reply.js.erb
+++ b/app/views/blog_comments/reply.js.erb
@@ -1,7 +1,7 @@
<% if @in_user_center%>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
- init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
+ init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity');
<% else%>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'blogs/article', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
-init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
+init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity');
<% end %>
\ No newline at end of file
diff --git a/app/views/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb
index e46a7249f..aa984c621 100644
--- a/app/views/blog_comments/show.html.erb
+++ b/app/views/blog_comments/show.html.erb
@@ -27,7 +27,7 @@
}
}
$(function() {
- init_activity_KindEditor_data(<%= @article.id%>,null,"85%");
+ init_activity_KindEditor_data(<%= @article.id%>,null,"85%", '<%=@article.class.to_s%>');
showNormalImage('message_description_<%= @article.id %>');
});
diff --git a/app/views/blogs/_article_list.html.erb b/app/views/blogs/_article_list.html.erb
index a91dd8151..f6383c95b 100644
--- a/app/views/blogs/_article_list.html.erb
+++ b/app/views/blogs/_article_list.html.erb
@@ -74,7 +74,7 @@
}
$(function () {
- init_activity_KindEditor_data(<%= topic.id%>, null, "87%");
+ init_activity_KindEditor_data(<%= topic.id%>, null, "87%", "<%=topic.class.to_s%>");
showNormalImage('activity_description_<%= topic.id %>');
/*var description_images=$("div#activity_description_<%#= topic.id %>").find("img");
if (description_images.length>0) {
diff --git a/app/views/boards/_course_new.html.erb b/app/views/boards/_course_new.html.erb
index e4cf57ae3..31cdf41eb 100644
--- a/app/views/boards/_course_new.html.erb
+++ b/app/views/boards/_course_new.html.erb
@@ -1,5 +1,5 @@
<%= content_for(:header_tags) do %>
- <%= import_ke(enable_at: false, prettify: false) %>
+ <%= import_ke(enable_at: true, prettify: false) %>
<% end %>
<%= error_messages_for 'message' %>
@@ -34,7 +34,9 @@
:class => 'talk_text fl',
:input_html => { :id => 'message_content',
:class => 'talk_text fl',
- :maxlength => 5000 }%>
+ :maxlength => 5000 },
+ at_id: topic.id, at_type: topic.class.to_s
+ %>
diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb
index 306a0c7ce..074da9af1 100644
--- a/app/views/boards/_course_show.html.erb
+++ b/app/views/boards/_course_show.html.erb
@@ -74,7 +74,7 @@
}
$(function () {
- init_activity_KindEditor_data(<%= topic.id%>, null, "87%");
+ init_activity_KindEditor_data(<%= topic.id%>, null, "87%", "<%=topic.class.to_s%>");
showNormalImage('activity_description_<%= topic.id %>');
/*var description_images=$("div#activity_description_<%#= topic.id %>").find("img");
if (description_images.length>0) {
diff --git a/app/views/comments/create.js.erb b/app/views/comments/create.js.erb
index ea904a63f..c3942ee38 100644
--- a/app/views/comments/create.js.erb
+++ b/app/views/comments/create.js.erb
@@ -1,3 +1,3 @@
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
-init_activity_KindEditor_data('<%= @user_activity_id%>',"","87%");
+init_activity_KindEditor_data('<%= @user_activity_id%>',"","87%", "UserActivity");
diff --git a/app/views/courses/_course_activity.html.erb b/app/views/courses/_course_activity.html.erb
index b4c560fa4..d31b28bc0 100644
--- a/app/views/courses/_course_activity.html.erb
+++ b/app/views/courses/_course_activity.html.erb
@@ -1,5 +1,5 @@
<%= content_for(:header_tags) do %>
- <%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
+ <%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
<% end %>
<%= 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 %>
-
diff --git a/app/views/courses/syllabus.html.erb b/app/views/courses/syllabus.html.erb
index f4b8ce8a4..9d20b5adb 100644
--- a/app/views/courses/syllabus.html.erb
+++ b/app/views/courses/syllabus.html.erb
@@ -1,6 +1,6 @@
<%= content_for(:header_tags) do %>
- <%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
+ <%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
<%= javascript_include_tag 'blog' %>
<% end %>
@@ -40,7 +40,7 @@
}
}
$(function() {
- init_activity_KindEditor_data(<%= @article.id%>,null,"87%");
+ init_activity_KindEditor_data(<%= @article.id%>,null,"87%", "<%=@article.class.to_s%>");
showNormalImage('message_description_<%= @article.id %>');
});
diff --git a/app/views/homework_common/start_anonymous_comment.js.erb b/app/views/homework_common/start_anonymous_comment.js.erb
index ea63ea12c..ffeda2cb5 100644
--- a/app/views/homework_common/start_anonymous_comment.js.erb
+++ b/app/views/homework_common/start_anonymous_comment.js.erb
@@ -2,10 +2,10 @@
alert('启动成功');
<% if @user_activity_id == -1 %>
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>");
- init_activity_KindEditor_data(<%= @homework.id%>,"","87%");
+ init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>");
<% else %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>");
- init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
+ init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
<% end %>
/*$("#<%#= @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 %>
diff --git a/app/views/homework_common/stop_anonymous_comment.js.erb b/app/views/homework_common/stop_anonymous_comment.js.erb
index 214a157dc..308e8a39f 100644
--- a/app/views/homework_common/stop_anonymous_comment.js.erb
+++ b/app/views/homework_common/stop_anonymous_comment.js.erb
@@ -1,10 +1,10 @@
alert('关闭成功');
<% if @user_activity_id == -1 %>
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>");
-init_activity_KindEditor_data(<%= @homework.id%>,"","87%");
+init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>");
<% else %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>");
-init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
+init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity');
<% end %>
/*
$("#<%#= @homework.id %>_stop_anonymous_comment").replaceWith('');*/
diff --git a/app/views/issues/_edit.html.erb b/app/views/issues/_edit.html.erb
index b8f362429..05793ea7c 100644
--- a/app/views/issues/_edit.html.erb
+++ b/app/views/issues/_edit.html.erb
@@ -1,8 +1,7 @@
<%= content_for(:header_tags) do %>
- <%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
+ <%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
<% end %>
-
<%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true} do |f| %>
<%= error_messages_for 'issue', 'time_entry' %>
<%= render :partial => 'conflict' if @conflict %>
@@ -24,7 +23,7 @@
回复
- <%= f.kindeditor :notes, :style => "width:99%;",:height=>'100px', :cssData =>"blockquote { padding:0px}", :rows => "5", :no_label => true, :editor_id=>'issue_journal_kind_reply' %>
+ <%= 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 %>
diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb
index 0d5c876f1..c1d2a841b 100644
--- a/app/views/issues/_form.html.erb
+++ b/app/views/issues/_form.html.erb
@@ -49,7 +49,7 @@
<%= f.label_for_field :description, :required => @issue.required_attribute?('description'), :no_label => true, :class => "label" %>
<%#= link_to_function image_tag('edit.png'), '$(this).hide(); $("#issue_description_and_toolbar").show()' unless @issue.new_record? %>
<%#= content_tag 'span', :id => "issue_description_and_toolbar" do %>
- <%= f.kindeditor :description,:editor_id => "issue_desc_editor", :width=>'87%', :resizeType => 0, :no_label => true %>
+ <%= f.kindeditor :description,:editor_id => "issue_desc_editor", :width=>'87%', :resizeType => 0, :no_label => true,at_id: @project.id, at_type: @project.class.to_s %>
<%# end %>
<%#= wikitoolbar_for 'issue_description' %>
<% end %>
diff --git a/app/views/issues/add_journal.js.erb b/app/views/issues/add_journal.js.erb
index 0b1c02b88..8ff5a71f1 100644
--- a/app/views/issues/add_journal.js.erb
+++ b/app/views/issues/add_journal.js.erb
@@ -1,3 +1,3 @@
$("#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%");
\ No newline at end of file
+init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
\ No newline at end of file
diff --git a/app/views/issues/add_journal_in_org.js.erb b/app/views/issues/add_journal_in_org.js.erb
index ad7a85540..34e874f13 100644
--- a/app/views/issues/add_journal_in_org.js.erb
+++ b/app/views/issues/add_journal_in_org.js.erb
@@ -1,3 +1,3 @@
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id}) %>");
-init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
\ No newline at end of file
+init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
\ No newline at end of file
diff --git a/app/views/issues/new.html.erb b/app/views/issues/new.html.erb
index 9c6ad647c..c4daedaa4 100644
--- a/app/views/issues/new.html.erb
+++ b/app/views/issues/new.html.erb
@@ -1,5 +1,5 @@
<%= content_for(:header_tags) do %>
- <%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
+ <%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
<% end %>
diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb
index 67d1186c4..80d3aaac1 100644
--- a/app/views/issues/show.html.erb
+++ b/app/views/issues/show.html.erb
@@ -1,5 +1,5 @@
<%= content_for(:header_tags) do %>
-<%= import_ke(enable_at: {id: @issue.id, type: 'Issue'}) %>
+<%= import_ke(enable_at: true) %>
<% end %>
diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb
index 44f3e5a64..b7cc1a0c2 100644
--- a/app/views/memos/show.html.erb
+++ b/app/views/memos/show.html.erb
@@ -34,7 +34,7 @@
}
}
$(function() {
- init_activity_KindEditor_data(<%= @memo.id%>,null,"87%");
+ init_activity_KindEditor_data(<%= @memo.id%>,null,"87%", "<%=@memo.class.to_s%>");
});
function del_confirm(){
diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb
index 0f39b73d2..e06c04775 100644
--- a/app/views/messages/_course_show.html.erb
+++ b/app/views/messages/_course_show.html.erb
@@ -27,7 +27,7 @@
}
}
$(function() {
- init_activity_KindEditor_data(<%= @topic.id%>,null,"85%");
+ init_activity_KindEditor_data(<%= @topic.id%>,null,"85%", "<%=@topic.class.to_s%>");
showNormalImage('message_description_<%= @topic.id %>');
});
diff --git a/app/views/messages/quote.js.erb b/app/views/messages/quote.js.erb
index eee820c61..b0e8ecb85 100644
--- a/app/views/messages/quote.js.erb
+++ b/app/views/messages/quote.js.erb
@@ -11,7 +11,7 @@ if($("#reply_message_<%= @message.id%>").length > 0) {
$(function(){
$('#reply_subject').val("<%= raw escape_javascript(@subject) %>");
$('#quote_quote').val("<%= raw escape_javascript(@temp.content.html_safe) %>");
- init_activity_KindEditor_data(<%= @message.id%>,null,"85%");
+ init_activity_KindEditor_data(<%= @message.id%>,null,"85%", "<%=@message.class.to_s%>");
});
}else if($("#reply_to_message_<%= @message.id%>").length >0) {
$("#reply_to_message_<%= @message.id%>").replaceWith("
");
diff --git a/app/views/messages/reply.js.erb b/app/views/messages/reply.js.erb
index ac80de3b4..518479344 100644
--- a/app/views/messages/reply.js.erb
+++ b/app/views/messages/reply.js.erb
@@ -3,4 +3,4 @@
<%elsif @course%>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>");
<%end%>
-init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
\ No newline at end of file
+init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
\ No newline at end of file
diff --git a/app/views/org_document_comments/_reply_form.html.erb b/app/views/org_document_comments/_reply_form.html.erb
index 7871b910d..8808ff8b7 100644
--- a/app/views/org_document_comments/_reply_form.html.erb
+++ b/app/views/org_document_comments/_reply_form.html.erb
@@ -1,2 +1,2 @@
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
-init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
+init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
diff --git a/app/views/org_document_comments/add_reply.js.erb b/app/views/org_document_comments/add_reply.js.erb
index 40ed2eeb2..84f8c1f83 100644
--- a/app/views/org_document_comments/add_reply.js.erb
+++ b/app/views/org_document_comments/add_reply.js.erb
@@ -1,3 +1,3 @@
$("#organization_document_<%= @act.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document, :act => @act}) %>");
-init_activity_KindEditor_data(<%= @act.id %>,"","87%");
\ No newline at end of file
+init_activity_KindEditor_data(<%= @act.id %>,"","87%", "<%=@act.class.to_s%>");
\ No newline at end of file
diff --git a/app/views/org_document_comments/index.html.erb b/app/views/org_document_comments/index.html.erb
index 331e61bfd..ddbb6bf9c 100644
--- a/app/views/org_document_comments/index.html.erb
+++ b/app/views/org_document_comments/index.html.erb
@@ -19,7 +19,7 @@
<% @documents.each do |document| %>
<%= render :partial => 'organizations/show_org_document', :locals => {:document => document, :act => OrgActivity.where("org_act_type='OrgDocumentComment'and org_act_id=?", document.id).first} %>
diff --git a/app/views/org_document_comments/quote.js.erb b/app/views/org_document_comments/quote.js.erb
index a71b23f0e..7ea5daf7b 100644
--- a/app/views/org_document_comments/quote.js.erb
+++ b/app/views/org_document_comments/quote.js.erb
@@ -3,7 +3,7 @@ if($("#reply_message_<%= @org_comment.id%>").length > 0) {
$(function(){
$('#reply_subject').val("<%= raw escape_javascript(@subject) %>");
$('#quote_quote').val("<%= raw escape_javascript(@temp.content.html_safe) %>");
- init_activity_KindEditor_data(<%= @org_comment.id%>,null,"85%");
+ init_activity_KindEditor_data(<%= @org_comment.id%>,null,"85%", "<%=@org_comment.class.to_s%>");
});
}else if($("#reply_to_message_<%= @org_comment.id %>").length >0) {
$("#reply_to_message_<%= @org_comment.id%>").replaceWith("");
diff --git a/app/views/org_document_comments/show.html.erb b/app/views/org_document_comments/show.html.erb
index 1b1eca418..3a50e5faa 100644
--- a/app/views/org_document_comments/show.html.erb
+++ b/app/views/org_document_comments/show.html.erb
@@ -5,7 +5,7 @@
diff --git a/app/views/organizations/_org_activities.html.erb b/app/views/organizations/_org_activities.html.erb
index 33ac13e76..8f9acbc7b 100644
--- a/app/views/organizations/_org_activities.html.erb
+++ b/app/views/organizations/_org_activities.html.erb
@@ -2,7 +2,7 @@
<% org_activities.each do |act| %>
<% if act.container_type == 'Organization' %>
diff --git a/app/views/organizations/show.html.erb b/app/views/organizations/show.html.erb
index 7200761a3..9d62dd1f9 100644
--- a/app/views/organizations/show.html.erb
+++ b/app/views/organizations/show.html.erb
@@ -59,7 +59,7 @@
<% if !@organization.home_id.nil? and OrgDocumentComment.where("id = ?", @organization.home_id).count > 0 %>
<% act = OrgActivity.where("org_act_type = 'OrgDocumentComment' and org_act_id =?", @organization.home_id).first %>
diff --git a/app/views/student_work/forbidden_anonymous_comment.js.erb b/app/views/student_work/forbidden_anonymous_comment.js.erb
index a72c29509..47dfb4b51 100644
--- a/app/views/student_work/forbidden_anonymous_comment.js.erb
+++ b/app/views/student_work/forbidden_anonymous_comment.js.erb
@@ -1,7 +1,7 @@
<% if @user_activity_id == -1 %>
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>");
-init_activity_KindEditor_data(<%= @homework.id%>,"","87%");
+init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>");
<% else %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>");
-init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
+init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
<% end %>
\ No newline at end of file
diff --git a/app/views/student_work/set_score_rule.js.erb b/app/views/student_work/set_score_rule.js.erb
index ff3a0e7ed..180f04faa 100644
--- a/app/views/student_work/set_score_rule.js.erb
+++ b/app/views/student_work/set_score_rule.js.erb
@@ -1,8 +1,8 @@
clickCanel();
<% 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}) %>");
- init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
+ init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
<% else %>
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework,:is_in_course => @is_in_course}) %>");
- init_activity_KindEditor_data(<%= @homework.id%>,"","87%");
+ init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>");
<% end %>
\ No newline at end of file
diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb
index 4f1d3a5d8..557b9e9ee 100644
--- a/app/views/users/_user_activities.html.erb
+++ b/app/views/users/_user_activities.html.erb
@@ -1,12 +1,12 @@
<%= content_for(:header_tags) do %>
- <%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
+ <%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
<% end %>
-<%= content_for(:header_tags) do %>
- <%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
-<% end %>
-
-
+<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_KindEditor" %>
@@ -24,11 +20,11 @@
<%= l(:label_leave_message) %>
<% if !User.current.logged?%>
-
- <%= l(:label_user_login_tips) %>
- <%= link_to l(:label_user_login_new), signin_path %>
-
-
+
+ <%= l(:label_user_login_tips) %>
+ <%= link_to l(:label_user_login_new), signin_path %>
+
+
<% else %>
<%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_course_message'}, :html=>{:id => "course_feedback_new"},:method => "post") do |f|%>
@@ -59,37 +55,37 @@
$("#submit_feedback_course").one('click',function() {
$("#course_feedback_new").submit();
});
- KindEditor.ready(function(K){
- $("a[nhname='reply_btn']").live('click',function(){
- var params = {};
- params.kindutil = K;
- params.container = $(this).parent('div').parent('div');
- params.div_form = $(">.respond-form",params.container);
- params.form = $("form",params.div_form);
- params.textarea = $("textarea[name='user_notes']",params.div_form);
- params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
- params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
- params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form);
- params.height = 55;
- if(params.textarea.data('init') == undefined){
- params.editor = init_editor(params);
- init_form(params);
- params.cancel_btn.click(function(){
- nh_reset_form(params);
- });
- }
- params.cancel_btn.click();
- toggleAndSettingWordsVal(params.div_form, params.textarea);
- setTimeout(function(){
- if(!params.div_form.is(':hidden')){
- params.textarea.show();
- params.textarea.focus();
- params.textarea.hide();
- }
- },300);
- params.textarea.data('init',1);
- });
+ KindEditor.ready(function(K){
+ $("a[nhname='reply_btn']").live('click',function(){
+ var params = {};
+ params.kindutil = K;
+ params.container = $(this).parent('div').parent('div');
+ params.div_form = $(">.respond-form",params.container);
+ params.form = $("form",params.div_form);
+ params.textarea = $("textarea[name='user_notes']",params.div_form);
+ params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
+ params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
+ params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form);
+ params.height = 55;
+ if(params.textarea.data('init') == undefined){
+ params.editor = init_editor(params);
+ init_form(params);
+ params.cancel_btn.click(function(){
+ nh_reset_form(params);
+ });
+ }
+ params.cancel_btn.click();
+ toggleAndSettingWordsVal(params.div_form, params.textarea);
+ setTimeout(function(){
+ if(!params.div_form.is(':hidden')){
+ params.textarea.show();
+ params.textarea.focus();
+ params.textarea.hide();
+ }
+ },300);
+ params.textarea.data('init',1);
+ });
+ });
});
- });
From dc4532145487e903367e0bbddf0ea1eedea89c7b Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Tue, 15 Dec 2015 17:34:40 +0800
Subject: [PATCH 20/80] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=96=87=E7=AB=A0?=
=?UTF-8?q?=E4=BA=8C=E7=BA=A7=E5=9B=9E=E5=A4=8D=E4=BB=A3=E7=A0=81=E8=A2=AB?=
=?UTF-8?q?=E8=A6=86=E7=9B=96=EF=BC=8C=E6=81=A2=E5=A4=8D=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/org_document_comments/show.html.erb | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/app/views/org_document_comments/show.html.erb b/app/views/org_document_comments/show.html.erb
index dfe27cde3..7a64e4514 100644
--- a/app/views/org_document_comments/show.html.erb
+++ b/app/views/org_document_comments/show.html.erb
@@ -1,8 +1,4 @@
-<%= content_for(:header_tags) do %>
- <%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
-<%= javascript_include_tag 'blog' %>
-<% end %>
-
+<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor",'blog' %>
+ <% replies_all_i=replies_all_i + 1 %>
+
+
+ <%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "用户头像" %>
+
+
+
+ <% if reply.try(:user).try(:realname) == ' ' %>
+ <%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
+ <% else %>
+ <%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
+ <% end %>
+ <%= format_time(reply.created_on) %>
+
+
+ <% if reply.details.any? %>
+ <% details_to_strings(reply.details).each do |string| %>
+
<%= string %>
+ <% end %>
+ <% end %>
+
<%= reply.notes.html_safe %>
+
+
+
+
+ <% end %>
+
\ No newline at end of file
diff --git a/app/views/issues/add_journal.js.erb b/app/views/issues/add_journal.js.erb
index 0b1c02b88..5a3fa90ca 100644
--- a/app/views/issues/add_journal.js.erb
+++ b/app/views/issues/add_journal.js.erb
@@ -1,3 +1,8 @@
-$("#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%");
\ No newline at end of file
+<% if @issue_id%>
+ $("#reply_div_<%= @issue_id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => Issue.find( @issue_id),:replies_all_i=>0}) %>");
+ $(".homepagePostReplyBannerCount").html('回复(<%= Issue.find( @issue_id).journals.count %>)')
+ issues_reply_editor.html('')
+<%else%>
+ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id}) %>");
+ init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
+<%end %>
\ No newline at end of file
diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb
index 80d3aaac1..dc8e2b84a 100644
--- a/app/views/issues/show.html.erb
+++ b/app/views/issues/show.html.erb
@@ -1,106 +1,55 @@
<%= content_for(:header_tags) do %>
-<%= import_ke(enable_at: true) %>
+ <%= import_ke(enable_at: true) %>
<% end %>
-
-
-
<%= l(:label_issue_edit) %>
+
+