2015-05-18 14:53:01 +08:00
|
|
|
|
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
|
|
|
|
|
<style>
|
|
|
|
|
.comment{
|
|
|
|
|
position: relative;
|
|
|
|
|
width: 330px;
|
|
|
|
|
padding: 10px;
|
|
|
|
|
}
|
|
|
|
|
.comment .ke-toolbar{
|
|
|
|
|
position: absolute;
|
|
|
|
|
bottom: -18px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</style>
|
2015-05-07 16:10:07 +08:00
|
|
|
|
<%= error_messages_for 'message' %>
|
|
|
|
|
<% replying ||= false %>
|
|
|
|
|
<% extra_option = replying ? { readonly: true} : { maxlength: 200 } %>
|
|
|
|
|
<% if replying %>
|
|
|
|
|
<li style="display: none">
|
|
|
|
|
<label><span class="c_red">*</span> <%= l(:field_subject) %> :</label>
|
|
|
|
|
|
2015-05-14 15:11:20 +08:00
|
|
|
|
<%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}",:class=>"talk_input w585" }.merge(extra_option) %>
|
2015-05-07 16:10:07 +08:00
|
|
|
|
|
|
|
|
|
|
2015-05-14 15:11:20 +08:00
|
|
|
|
<p id="subject_span<%= f.object.id%>" class="ml55"></p>
|
2015-05-07 16:10:07 +08:00
|
|
|
|
</li>
|
|
|
|
|
<% else %>
|
|
|
|
|
<li>
|
|
|
|
|
<label><span class="c_red">*</span> <%= l(:field_subject) %> :</label>
|
|
|
|
|
|
|
|
|
|
|
2015-05-14 15:11:20 +08:00
|
|
|
|
<%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}", onkeyup: "regexSubject('#{f.object.id}');",:class=>"talk_input w585" }.merge(extra_option) %>
|
2015-05-07 16:10:07 +08:00
|
|
|
|
|
2015-05-14 15:11:20 +08:00
|
|
|
|
<p id="subject_span<%= f.object.id%>" class="ml55"></p>
|
2015-05-07 16:10:07 +08:00
|
|
|
|
</li>
|
|
|
|
|
<% end %>
|
|
|
|
|
<li class="ml60 mb5">
|
|
|
|
|
<% unless replying %>
|
|
|
|
|
<% if @message.safe_attribute? 'sticky' %>
|
|
|
|
|
<%= f.check_box :sticky %>
|
|
|
|
|
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% if @message.safe_attribute? 'locked' %>
|
|
|
|
|
<%= f.check_box :locked %>
|
|
|
|
|
<%= label_tag 'message_locked', l(:label_board_locked) %>
|
|
|
|
|
<% end %>
|
|
|
|
|
<% end %>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<div id="message_quote" class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;"></div>
|
2015-05-18 14:53:01 +08:00
|
|
|
|
<script>
|
|
|
|
|
var editor;
|
|
|
|
|
KindEditor.ready(function(K) {
|
|
|
|
|
editor = K.create('textarea[name="content"]', {
|
|
|
|
|
resizeType : 1,
|
|
|
|
|
allowPreviewEmoticons : false,
|
|
|
|
|
allowImageUpload : false,
|
|
|
|
|
width:"100%",
|
|
|
|
|
items : [
|
|
|
|
|
'emoticons']
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
</script>
|
2015-05-07 16:10:07 +08:00
|
|
|
|
<% unless replying %>
|
2015-05-14 15:11:20 +08:00
|
|
|
|
<label class="fl ml3" ><span class="c_red">*</span> <%= l(:field_description) %> :</label>
|
2015-05-07 16:10:07 +08:00
|
|
|
|
<% end %>
|
|
|
|
|
<%= text_area :quote,:quote,:style => 'display:none' %>
|
2015-05-18 14:53:01 +08:00
|
|
|
|
<div class="content">
|
2015-05-07 16:10:07 +08:00
|
|
|
|
<% if replying%>
|
2015-05-18 14:53:01 +08:00
|
|
|
|
|
|
|
|
|
<%= 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 }%>
|
|
|
|
|
|
2015-05-07 16:10:07 +08:00
|
|
|
|
<% else %>
|
2015-05-18 14:53:01 +08:00
|
|
|
|
<%= 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 }%>
|
|
|
|
|
|
2015-05-07 16:10:07 +08:00
|
|
|
|
<% end %>
|
2015-05-18 14:53:01 +08:00
|
|
|
|
</div>
|
2015-05-07 16:10:07 +08:00
|
|
|
|
<div class="cl"></div>
|
2015-05-14 15:11:20 +08:00
|
|
|
|
<p id="message_content_span<%= f.object.id%>" class="ml55"></p>
|
2015-05-07 16:10:07 +08:00
|
|
|
|
</li>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<li>
|
|
|
|
|
<% unless replying %>
|
|
|
|
|
<div class="fl ml3" style="padding-left: 52px;">
|
2015-05-12 17:14:07 +08:00
|
|
|
|
<%= render :partial => 'attachments/form_project', :locals => {:container => topic,:isReply => @isReply} %>
|
2015-05-07 16:10:07 +08:00
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
</li>
|
|
|
|
|
<li >
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</li>
|