socialforge/app/views/admin/messages.html.erb

43 lines
1.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<h3 style="float: left">
<%=l(:label_system_message)%>
</h3><br/>
<div style="padding-top: 20px; padding-left: 5px;">
<%= form_for(@admin_messages, :html => {:id =>'system_message', :multipart => true}) do |f| %>
<div class="field">
<%= f.kindeditor :content, :edit_id => 'system_message',
:width => '87%',
:resizeType => '0',
:no_label => true
%>
</div>
<div>
<p id="content_notice_span" class="ml55"></p>
</div>
<div class="actions">
<%= f.submit l(:label_submit),:class => "small", :onclick => "system_message.sync;" %>
</div>
<% end %>
</div>
<script>
function system_message_length(obj)
{
if (obj.length == 0) {
$("#content_notice_span").text("内容不能为空");
$("#content_notice_span").css('color', '#ff0000');
$("#content_notice_span").focus();
}
else if (obj.length > 255) {
$("#content_notice_span").text("内容过长超过255个字符");
$("#content_notice_span").css('color', '#ff0000');
$("#content_notice_span").focus();
}
else {
$("#content_notice_span").text("填写正确");
$("#content_notice_span").css('color', '#008000');
$("#system_message").submit();
}
}
</script>