From 47a9be132ac4b9ff28e4638110e029244bcd6aed Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Wed, 16 Dec 2015 09:31:11 +0800
Subject: [PATCH] =?UTF-8?q?=E8=AF=A6=E6=83=85=E5=92=8C=E7=BC=96=E8=BE=91?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/attachments/_form.html.erb | 23 ++++-------------------
app/views/issues/_detail.html.erb | 4 +++-
app/views/issues/_edit.html.erb | 2 ++
app/views/issues/show.html.erb | 6 +-----
app/views/issues/update.js.erb | 20 +++++++++++++++++---
5 files changed, 27 insertions(+), 28 deletions(-)
diff --git a/app/views/attachments/_form.html.erb b/app/views/attachments/_form.html.erb
index ab8b80dcb..aac365a15 100644
--- a/app/views/attachments/_form.html.erb
+++ b/app/views/attachments/_form.html.erb
@@ -7,8 +7,10 @@
<% if defined?(container) && container && container.saved_attachments %>
<% container.attachments.each_with_index do |attachment, i| %>
- <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly => 'readonly') %><%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %><%= l(:field_is_public) %>:
- <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, attachment.is_public == 1 ? true : false, :class => 'is_public') %>
+ <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'upload_filename readonly', :readonly => 'readonly') %>
+ <%#= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %>
+
+ <%#= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, attachment.is_public == 1 ? true : false, :class => 'is_public') %>
<%= if attachment.id.nil?
#待补充代码
else
@@ -21,24 +23,7 @@
<% end %>
- <% container.saved_attachments.each_with_index do |attachment, i| %>
-
- <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly => 'readonly') %>
- <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %>
- <%= l(:field_is_public) %>:
- <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, attachment.is_public == 1 ? true : false, :class => 'is_public') %>
- <%= if attachment.id.nil?
- #待补充代码
- else
- link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
- end
- %>
- <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
- <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
-
-
- <% end %>
<% end %>
<% project = project %>
diff --git a/app/views/issues/_detail.html.erb b/app/views/issues/_detail.html.erb
index b085ce32f..b175bd417 100644
--- a/app/views/issues/_detail.html.erb
+++ b/app/views/issues/_detail.html.erb
@@ -1,3 +1,4 @@
+
<%= link_to image_tag(url_to_avatar(@issue.author), :width => 46, :height => 46), user_path(@issue.author), :class => "ping_dispic" %>
@@ -33,4 +34,5 @@
<%= render :partial => 'issues/attributes_show' %>
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/app/views/issues/_edit.html.erb b/app/views/issues/_edit.html.erb
index 87430e5d6..b1127a3d3 100644
--- a/app/views/issues/_edit.html.erb
+++ b/app/views/issues/_edit.html.erb
@@ -1,3 +1,4 @@
+
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<% end %>
@@ -26,3 +27,4 @@
<%= hidden_field_tag 'last_journal_id', params[:last_journal_id] || @issue.last_journal_id %>
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id] %>
<% end %>
+
\ No newline at end of file
diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb
index dc8e2b84a..4c56a0f05 100644
--- a/app/views/issues/show.html.erb
+++ b/app/views/issues/show.html.erb
@@ -15,12 +15,8 @@
-
<%= render :partial => 'issues/detail'%>
-
-
- <%= render :partial => 'issues/edit'%>
-
+ <%= render :partial => 'issues/edit'%>
diff --git a/app/views/issues/update.js.erb b/app/views/issues/update.js.erb
index 7dba2aa5d..d5f213455 100644
--- a/app/views/issues/update.js.erb
+++ b/app/views/issues/update.js.erb
@@ -1,6 +1,20 @@
-$("#issue_detail").html('<%= escape_javascript(render :partial => 'issues/detail') %>')
-$("#issue_edit").html('<%= escape_javascript(render :partial => 'issues/edit') %>')
+$("#issue_detail").replaceWith('<%= escape_javascript(render :partial => 'issues/detail') %>')
+$("#issue_edit").replaceWith('<%= escape_javascript(render :partial => 'issues/edit') %>')
$("#issue_detail").show();
$("#issue_edit").hide();
$("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>");
-$(".homepagePostReplyBannerCount").html('回复(<%= @issue.journals.count %>)')
\ No newline at end of file
+$(".homepagePostReplyBannerCount").html('回复(<%= @issue.journals.count %>)')
+//edit里的编辑器貌似显示不出来,所以手动js生成。
+issue_desc_editor = KindEditor.create('#issue_description',
+ {"width":"87%",
+ "resizeType":0,
+ "no_label":true,
+ "autoHeightMode":true,
+ "afterCreate":"eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);} if(typeof enableAt ==='function'){enableAt(self);} this.loadPlugin(\"autoheight\"),$(this.toolbar.div).hide();})",
+ "afterFocus":"eval(function(){$(this.toolbar.div).show();})",
+ "afterBlur":"eval(function(){$(this.toolbar.div).hide();})",
+ "emotionsBasePath":"http://localhost:3000","height":300,
+ "allowFileManager":true,
+ "uploadJson":"/kindeditor/upload",
+ "fileManagerJson":"/kindeditor/filemanager"});
+