diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index b05050887..2c1f78de8 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -430,9 +430,32 @@ class IssuesController < ApplicationController
end
end
- #对某个journ回复
+ #对某个journ回复,显示回复框
def reply
+ @issue = Issue.find(params[:id])
+ @jour = Journal.find(params[:journal_id])
+ @tempContent = "
#{ll(Setting.default_language, :text_user_wrote, @jour.user.realname.blank? ? @jour.user.login: @jour.user.realname)}
#{@jour.notes.html_safe}
".html_safe
+ respond_to do |format|
+ format.js
+ end
+ end
+ #给issue添加journ。回复内容包含 对某个被回复的journ的内容
+ def add_reply
+ if User.current.logged?
+ jour = Journal.new
+ jour.user_id = User.current.id
+ jour.notes = params[:quote]+params[:notes]
+ @issue = Issue.find params[:id]
+ jour.journalized = @issue
+ jour.save
+ user_activity = UserActivity.where("act_type='Issue' and act_id =#{@issue.id}").first
+ user_activity.updated_at = jour.created_on
+ user_activity.save
+ respond_to do |format|
+ format.js
+ end
+ end
end
#
diff --git a/app/views/issues/_issue_replies.html.erb b/app/views/issues/_issue_replies.html.erb
index a1b4a3415..5e6e624b6 100644
--- a/app/views/issues/_issue_replies.html.erb
+++ b/app/views/issues/_issue_replies.html.erb
@@ -28,6 +28,7 @@
<%= reply.notes.html_safe %>
+ <%= format_time(reply.created_on) %>
+
@@ -76,4 +78,5 @@
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/app/views/issues/_issue_reply_ke_form.html.erb b/app/views/issues/_issue_reply_ke_form.html.erb
new file mode 100644
index 000000000..e84d5905c
--- /dev/null
+++ b/app/views/issues/_issue_reply_ke_form.html.erb
@@ -0,0 +1,27 @@
+
+
+
+ <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@issue.author_id), :alt => "用户头像" %>
+
+
+
+
\ No newline at end of file
diff --git a/app/views/issues/add_reply.js.erb b/app/views/issues/add_reply.js.erb
new file mode 100644
index 000000000..0ee9d30e7
--- /dev/null
+++ b/app/views/issues/add_reply.js.erb
@@ -0,0 +1,3 @@
+$("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>");
+$(".homepagePostReplyBannerCount").html('回复(<%= Issue.find( @issue).journals.count %>)')
+sd_create_editor_from_data(<%= @issue.id%>, null, "100%");
\ No newline at end of file
diff --git a/app/views/issues/reply.js.erb b/app/views/issues/reply.js.erb
new file mode 100644
index 000000000..316c078f2
--- /dev/null
+++ b/app/views/issues/reply.js.erb
@@ -0,0 +1,9 @@
+if($("#reply_message_<%= @jour.id%>").length > 0) {
+ $("#reply_message_<%= @jour.id%>").replaceWith("<%= escape_javascript(render :partial => 'issues/issue_reply_ke_form') %>");
+ $(function(){
+ $('input[name=quote]').val("<%= raw escape_javascript(@tempContent.html_safe) %>");
+ sd_create_editor_from_data(<%= @issue.id%>, null, "100%");
+ });
+}else if($("#reply_to_message_<%= @issue.id%>").length >0) {
+ $("#reply_to_message_<%= @issue.id%>").replaceWith("");
+}
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index 09b719b07..cf4262c2d 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -706,7 +706,8 @@ RedmineApp::Application.routes.draw do
post 'add_journal'
post 'add_journal_in_org'
get 'delete_journal'
- post 'reply'
+ get 'reply'
+ post 'add_reply'
end
resources :time_entries, :controller => 'timelog' do
collection do
diff --git a/public/javascripts/create_kindeditor.js b/public/javascripts/create_kindeditor.js
index aaadcfde4..3f555ac88 100644
--- a/public/javascripts/create_kindeditor.js
+++ b/public/javascripts/create_kindeditor.js
@@ -18,9 +18,6 @@ function sd_create_editor(params){
var edit = this.edit;
var body = edit.doc.body;
edit.iframe.height(paramsHeight);
- console.log(" body.scrollHeight "+ body.scrollHeight)
- console.log(" body.offsetHeight "+ body.offsetHeight)
- console.log("(params.kindutil.IE ? body.scrollHeight : body.offsetHeight)"+(params.kindutil.IE ? body.scrollHeight : body.offsetHeight))
this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : (params.kindutil.GECKO ? body.offsetHeight+26:body.offsetHeight)) , paramsHeight));
},
afterBlur:function(){
@@ -34,7 +31,7 @@ function sd_create_editor(params){
if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(this.edit.html())){
params.submit_btn.hide();
params.toolbar_container.hide();
- this.resize("94%", null);
+ this.resize("100%", null);
}else if(this.edit.html().trim() != ""){
params.submit_btn.show();
params.toolbar_container.show();
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css
index 0ed4df627..40869aca7 100644
--- a/public/stylesheets/new_user.css
+++ b/public/stylesheets/new_user.css
@@ -1328,7 +1328,7 @@ a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; c
.ul_normal_color li {list-style-position:inside; padding-left:1px; list-style-image:url('../images/news_dot.png')}
span.author { font-size: 0.9em; color: #888; }
.ReplyToMessageInputContainer {width: 582px;float: left;}
-
+.ReplyToMessageContainer {border-bottom:1px solid #e3e3e3; width:632px; margin:0px auto; margin-top:15px; min-height:60px;}
/*全站搜索*/
.blocks {padding:15px; background-color:#ffffff; border:1px solid #dddddd;}
#searchBanner {border-bottom:1px solid #d0d0d0;}
diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css
index c845b4440..1663df30f 100644
--- a/public/stylesheets/project.css
+++ b/public/stylesheets/project.css
@@ -1082,4 +1082,6 @@ img.date-trigger {
a.link_file_a{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; }
a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;}
-.imageFuzzy {filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity:0.5;opacity: 0.5;}
\ No newline at end of file
+.imageFuzzy {filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity:0.5;opacity: 0.5;}
+.ReplyToMessageInputContainer {width: 582px;float: left;}
+.ReplyToMessageContainer {border-bottom:1px solid #e3e3e3; width:632px; margin:0px auto; margin-top:15px; min-height:60px;}
\ No newline at end of file