Signed-off-by: alan <547533434@qq.com>

redis_cache
alan 10 years ago
parent 372bf71ca5
commit 34893db465

@ -24,7 +24,7 @@ gem 'acts-as-taggable-on', '2.4.1'
gem 'spreadsheet' gem 'spreadsheet'
gem 'ruby-ole' gem 'ruby-ole'
gem 'rails_kindeditor',path:'lib/rails_kindeditor' gem 'rails_kindeditor',path:'lib/rails_kindeditor'
gem "rmagick", ">= 2.0.0" #gem "rmagick", ">= 2.0.0"
group :development do group :development do
gem 'grape-swagger' gem 'grape-swagger'

@ -1,3 +1,16 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
<style>
.comment{
position: relative;
width: 330px;
padding: 10px;
}
.comment .ke-toolbar{
position: absolute;
bottom: -18px;
}
</style>
<%= error_messages_for 'message' %> <%= error_messages_for 'message' %>
<% replying ||= false %> <% replying ||= false %>
<% extra_option = replying ? { readonly: true} : { maxlength: 200 } %> <% extra_option = replying ? { readonly: true} : { maxlength: 200 } %>
@ -35,15 +48,50 @@
</li> </li>
<li> <li>
<div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div> <div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div>
<script>
var editor;
KindEditor.ready(function(K) {
editor = K.create('textarea[name="content"]', {
resizeType : 1,
allowPreviewEmoticons : false,
allowImageUpload : false,
width:"100%",
items : [
'emoticons']
});
});
</script>
<% unless replying %> <% unless replying %>
<label class="fl ml3" ><span class="c_red">*</span>&nbsp;<%= l(:field_description) %>&nbsp;</label> <label class="fl ml3" ><span class="c_red">*</span>&nbsp;<%= l(:field_description) %>&nbsp;</label>
<% end %> <% end %>
<%= text_area :quote,:quote,:style => 'display:none' %> <%= text_area :quote,:quote,:style => 'display:none' %>
<div class="content">
<% if replying%> <% 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 %> <% 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 %> <% end %>
</div>
<div class="cl"></div> <div class="cl"></div>
<p id="message_content_span<%= f.object.id%>" class="ml55"></p> <p id="message_content_span<%= f.object.id%>" class="ml55"></p>
</li> </li>

@ -112,11 +112,11 @@
<% end %> <% end %>
<% replies_all = topic.children. <% replies_all = topic.children.
includes(:author, :attachments, {:board => :project}). includes(:author, :attachments, {:board => :project}).
reorder("#{Message.table_name}.created_on DESC").offset(2). reorder("#{Message.table_name}.id asc").offset(2).
all %> all %>
<% replies_show = topic.children. <% replies_show = topic.children.
includes(:author, :attachments, {:board => :project}). includes(:author, :attachments, {:board => :project}).
reorder("#{Message.table_name}.created_on DESC").limit(2). reorder("#{Message.table_name}.id asc").limit(2).
all %> all %>
<% unless replies_show.empty? %> <% unless replies_show.empty? %>
<% reply_count = 0 %> <% reply_count = 0 %>

Loading…
Cancel
Save