From 4bc68081ee1983474d3bfd0903b0acf349844c20 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 17 Dec 2015 15:15:00 +0800 Subject: [PATCH] =?UTF-8?q?editor=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/_issue_replies.html.erb | 27 +++- app/views/issues/add_journal.js.erb | 7 +- app/views/issues/show.html.erb | 22 +-- app/views/issues/update.js.erb | 1 + app/views/layouts/base_projects.html.erb | 1 + public/javascripts/create_kindeditor.js | 176 +++++++++++++++++++++++ 6 files changed, 215 insertions(+), 19 deletions(-) create mode 100644 public/javascripts/create_kindeditor.js diff --git a/app/views/issues/_issue_replies.html.erb b/app/views/issues/_issue_replies.html.erb index 4e68df4ef..b5142101f 100644 --- a/app/views/issues/_issue_replies.html.erb +++ b/app/views/issues/_issue_replies.html.erb @@ -31,4 +31,29 @@
<% end %> - \ No newline at end of file + +
+ +
+ <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(@issue.author_id), :alt => "用户头像" %> +
+ +
+
+ <%= form_for('new_form',:url => add_journal_issue_path(@issue.id),:method => "post", :remote => true) do |f|%> + <%#= kindeditor_tag :notes,"",:height=>"33",:minHeight=>"33",:editor_id=>"issues_reply_editor"%> + + +
+
+ +
+ + +
+ <% 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 5a3fa90ca..ec7401fd3 100644 --- a/app/views/issues/add_journal.js.erb +++ b/app/views/issues/add_journal.js.erb @@ -1,8 +1,9 @@ -<% if @issue_id%> +<% if @issue_id%> //issue详情中回复 $("#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('') + sd_create_editor_from_data(<%= @issue.id%>, null, "100%"); <%else%> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id}) %>"); - init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%"); + init_activity_KindEditor_data(<%#= @user_activity_id%>,"","87%"); + // sd_create_editor_from_data(<%= @issue.id%>, null, "100%"); <%end %> \ No newline at end of file diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index a1450fc03..156e5cb67 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -1,6 +1,10 @@ <%= content_for(:header_tags) do %> <%= import_ke(enable_at: true) %> + <%= javascript_include_tag 'create_kindeditor'%> <% end %> +
+
123
<%= render :partial => 'layouts/new_feedback' %>