2015-12-06 15:03:36 +08:00
|
|
|
|
<%= content_for(:header_tags) do %>
|
|
|
|
|
<%= import_ke(enable_at: false) %>
|
|
|
|
|
<% end %>
|
2015-09-09 17:05:32 +08:00
|
|
|
|
<h3 style="float: left">
|
|
|
|
|
<%=l(:label_system_message)%>
|
|
|
|
|
</h3><br/>
|
|
|
|
|
<div style="padding-top: 20px; padding-left: 5px;">
|
2015-09-17 14:41:03 +08:00
|
|
|
|
<%= form_for(@admin_messages, :html => {:id =>'system_messages-form'}) do |f| %>
|
2015-09-17 17:29:39 +08:00
|
|
|
|
<li>
|
|
|
|
|
<label><span class="">*</span> <%= l(:field_title) %> :</label>
|
|
|
|
|
<input type="text" name="system_message[subject]" class="hwork_input_news" id="system_message_subject" width="576px" onblur="regexTitle($(this));" maxlength="255" placeholder="255个字符以内" value="">
|
|
|
|
|
<p id="title_notice_span" class="ml55"></p>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<label class="fl" > <span class="c_red"></span> <%= l(:field_description) %> :</label>
|
|
|
|
|
<%= f.kindeditor :description,:width=>'87.5%',:editor_id=>'system_message_editor' %>
|
2015-09-11 16:05:02 +08:00
|
|
|
|
<p id="content_notice_span" class="ml55"></p>
|
2015-09-17 17:29:39 +08:00
|
|
|
|
</li>
|
2015-09-11 09:48:16 +08:00
|
|
|
|
<div>
|
|
|
|
|
<p id="content_notice_span" class="ml55"></p>
|
|
|
|
|
</div>
|
2015-12-31 17:08:27 +08:00
|
|
|
|
<div class="cl"></div>
|
2015-09-09 17:05:32 +08:00
|
|
|
|
<div class="actions">
|
2015-09-11 17:19:12 +08:00
|
|
|
|
<%= link_to l(:label_submit), "javascript:void(0)", :class => "btn_message_free", :onclick => "system_message_editor.sync();submit_message();" %>
|
2015-09-09 17:05:32 +08:00
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
2015-09-11 09:48:16 +08:00
|
|
|
|
<script>
|
2015-09-11 16:05:02 +08:00
|
|
|
|
function system_message_length() {
|
|
|
|
|
var obj = system_message_editor.html();
|
2015-09-17 17:29:39 +08:00
|
|
|
|
if (obj.length > 10000) {
|
2015-09-14 16:05:29 +08:00
|
|
|
|
$("#content_notice_span").text("内容过长,超过10000个字符");
|
2015-09-11 16:05:02 +08:00
|
|
|
|
$("#content_notice_span").css('color', '#ff0000');
|
|
|
|
|
$("#content_notice_span").focus();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$("#content_notice_span").text("填写正确");
|
|
|
|
|
$("#content_notice_span").css('color', '#008000');
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-09-17 17:29:39 +08:00
|
|
|
|
function regexTitle(obj){
|
|
|
|
|
var title = obj.val();
|
|
|
|
|
if(title.length == 0)
|
|
|
|
|
{
|
|
|
|
|
$("#title_notice_span").text("标题不能为空").css("color", "#ff0000").focus();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
else if(title.length > 255)
|
|
|
|
|
{
|
|
|
|
|
$("#title_notice_span").text("标题长度过长,不能超过255个字符").css("color", "#ff0000").focus();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
$("#title_notice_span").text("填写正确").css("color", "#008000");
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-09-11 16:05:02 +08:00
|
|
|
|
function submit_message() {
|
|
|
|
|
|
2015-09-17 17:29:39 +08:00
|
|
|
|
if (system_message_length() && regexTitle($("#system_message_subject"))) {
|
2015-09-17 14:41:03 +08:00
|
|
|
|
$("#system_messages-form").submit();
|
2015-09-11 10:30:01 +08:00
|
|
|
|
}
|
2015-09-11 16:05:02 +08:00
|
|
|
|
}
|
2015-09-11 09:48:16 +08:00
|
|
|
|
</script>
|
2015-09-09 17:05:32 +08:00
|
|
|
|
|