diff --git a/Gemfile b/Gemfile index fbe74f8dd..9642e320c 100644 --- a/Gemfile +++ b/Gemfile @@ -24,7 +24,7 @@ gem 'acts-as-taggable-on', '2.4.1' gem 'spreadsheet' gem 'ruby-ole' gem 'rails_kindeditor',path:'lib/rails_kindeditor' -gem "rmagick", ">= 2.0.0" +#gem "rmagick", ">= 2.0.0" group :development do gem 'grape-swagger' diff --git a/app/views/boards/_form_project.html.erb b/app/views/boards/_form_project.html.erb index 8288debe2..69f8d7b2c 100644 --- a/app/views/boards/_form_project.html.erb +++ b/app/views/boards/_form_project.html.erb @@ -1,3 +1,16 @@ +<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> + <%= error_messages_for 'message' %> <% replying ||= false %> <% extra_option = replying ? { readonly: true} : { maxlength: 200 } %> @@ -35,15 +48,50 @@
  • + <% unless replying %> <% end %> <%= text_area :quote,:quote,:style => 'display:none' %> +
    <% if replying%> - <%= f.text_area :content, :class => 'talk_text fl', :id => "message_content#{f.object.id}", :onkeyup => "regexContent('#{f.object.id}');", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)", :style=>"width: 575px;" %> + + <%= f.kindeditor :content, :editor_id => 'message_content_editor', + :width => '89%', + :height => 300, + :input_html => { :id => "message_content#{f.object.id}", + :onkeyup => "regexContent('#{f.object.id}');", + :class => 'talk_text fl', + :placeholder => "最多3000个汉字(或6000个英文字符)", + :maxlength => 5000 }%> + <% else %> - <%= f.text_area :content, :class => 'talk_text fl', :id => "message_content#{f.object.id}", :onkeyup => "regexContent('#{f.object.id}');", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %> + <%= f.kindeditor :content, :editor_id => 'message_content_editor', + :owner_id => @message.nil? ? 0: @message.id, + :owner_type => OwnerTypeHelper::MESSAGE, + :width => '90%', + :height => 300, + :class => 'talk_text fl', + :input_html => { :id => "message_content#{f.object.id}", + :onkeyup => "regexContent('#{f.object.id}');", + :class => 'talk_text fl', + :placeholder => "最多3000个汉字(或6000个英文字符)", + :maxlength => 5000 }%> + <% end %> +

  • diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb index 63bb66a6a..db66b1a7e 100644 --- a/app/views/boards/_project_show.html.erb +++ b/app/views/boards/_project_show.html.erb @@ -112,11 +112,11 @@ <% end %> <% replies_all = topic.children. includes(:author, :attachments, {:board => :project}). - reorder("#{Message.table_name}.created_on DESC").offset(2). + reorder("#{Message.table_name}.id asc").offset(2). all %> <% replies_show = topic.children. includes(:author, :attachments, {:board => :project}). - reorder("#{Message.table_name}.created_on DESC").limit(2). + reorder("#{Message.table_name}.id asc").limit(2). all %> <% unless replies_show.empty? %> <% reply_count = 0 %>