diff --git a/app/controllers/sub_document_comments_controller.rb b/app/controllers/sub_document_comments_controller.rb index ce1a54313..e5a004bf8 100644 --- a/app/controllers/sub_document_comments_controller.rb +++ b/app/controllers/sub_document_comments_controller.rb @@ -113,7 +113,7 @@ class SubDocumentCommentsController < ApplicationController @org_subfield = @subdomain.org_subfield @organization = @org_subfield.organization @comment = SubDocumentComment.new(:sub_domain_id => @document.sub_domain_id, :creator_id => User.current.id, :reply_id => params[:id]) - @comment.content = params[:org_comment][:sub_content] + @comment.content = params[:flag] ? params[:sub_content] : params[:org_comment][:sub_content] @document.children << @comment @document.save respond_to do |format| diff --git a/app/views/sub_document_comments/_show_newstyle.html.erb b/app/views/sub_document_comments/_show_newstyle.html.erb index 90d503bd1..000511a3c 100644 --- a/app/views/sub_document_comments/_show_newstyle.html.erb +++ b/app/views/sub_document_comments/_show_newstyle.html.erb @@ -13,37 +13,37 @@ - <% comments_for_doc = @document.children.reorder("created_at desc") %> - <% count = @document.children.count() %> -
-

留言板80条留言

-
- -
- 发表 -
-
-
-

全部评论

-
-
- - 与再有10分钟 -

北斗真棒,北斗加油

- (100) -
-
-
- - 与再有10分钟 -

北斗真棒,北斗加油

- (100) -
-
-
- 加载更多 + <% if User.current.logged? %> + <% comments_for_doc = @document.children.reorder("created_at desc") %> + <% count = @document.children.count() %> +
+

留言板<%= count %>条留言

+ <%= form_for :org_comment, :url => {:action => 'add_reply_in_doc',:controller => 'sub_document_comments', :id => @document.id, :flag => true}, :html => {:multipart => true, :id => 'message_form', :class => "sn-reply-form", } do |f| %> + + <%#= f.kindeditor :sub_content,:width=>'99%',:height => '100px;',:editor_id=>'message_content_editor', :class => "sn-reply-text" %> +
+ <%= link_to l(:button_reply), "javascript:void(0)", :onclick => "$('#message_form').submit();", :class => "submit-btn" %> +
+ <%#= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'message_content_editor.html("");', :class => " grey_btn fr c_white mt10 mr5" %> + <% end %> + +
+

全部评论

+
+ <% comments_for_doc.each_with_index do |reply,i| %> +
+ + <%= link_to User.find(reply.creator_id).realname, user_url_in_org(reply.creator_id), :class => "sn-reply-username fl" %><%= time_from_now(reply.created_at) %> +

<%= reply.content.html_safe unless reply.content.nil? %>

+ +
+
+ <% end %> + +
-
-
+ <% end %>
\ No newline at end of file diff --git a/app/views/sub_document_comments/show.html.erb b/app/views/sub_document_comments/show.html.erb index 8f8ba1363..0c2733086 100644 --- a/app/views/sub_document_comments/show.html.erb +++ b/app/views/sub_document_comments/show.html.erb @@ -81,6 +81,13 @@ <%# end %>
+ <% if count > 3 %> +
+ + 展开更多 + +
+ <% end %>
<% comments_for_doc.each_with_index do |reply,i| %> @@ -132,7 +139,7 @@
- <%= form_for :org_comment, :url => {:action => 'add_reply_in_doc',:controller => 'sub_document_comments', :id => @document.id}, :html => {:multipart => true, :id => 'message_form'} do |f| %> + <%= form_for :org_comment, :url => {:action => 'add_reply_in_doc', :controller => 'sub_document_comments', :id => @document.id}, :html => {:multipart => true, :id => 'message_form'} do |f| %> <%= f.kindeditor :sub_content,:width=>'99%',:height => '100px;',:editor_id=>'message_content_editor' %> <%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'message_content_editor.html("");', :class => " grey_btn fr c_white mt10 mr5" %> <%= link_to l(:button_reply), "javascript:void(0)", :onclick => "message_content_editor.sync();$('#message_form').submit();", :class => "blue_btn fr c_white mt10 mb10", :style => "margin-right: 5px;" %>