修改系统消息样式

This commit is contained in:
ouyangxuhua 2015-09-17 17:29:39 +08:00
parent 43eeb8f457
commit 6f9c10651c
2 changed files with 31 additions and 14 deletions

View File

@ -1,16 +1,20 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<%= stylesheet_link_tag "project","public"%>
<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_messages-form'}) do |f| %>
<div class="field">
<%= f.text_area :subject %>
</div>
<div class="field">
<%= f.kindeditor :description,:width=>'87%',:editor_id=>'system_message_editor' %>
<li>
<label><span class="">*</span>&nbsp;<%= l(:field_title) %>&nbsp;&nbsp;</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" >&nbsp;&nbsp;<span class="c_red"></span>&nbsp;<%= l(:field_description) %>&nbsp;&nbsp;</label>
<%= f.kindeditor :description,:width=>'87.5%',:editor_id=>'system_message_editor' %>
<p id="content_notice_span" class="ml55"></p>
</div>
</li>
<div>
<p id="content_notice_span" class="ml55"></p>
</div>
@ -22,13 +26,7 @@
<script>
function system_message_length() {
var obj = system_message_editor.html();
if (obj.length == 0) {
$("#content_notice_span").text("内容不能为空");
$("#content_notice_span").css('color', '#ff0000');
$("#content_notice_span").focus();
return false;
}
else if (obj.length > 10000) {
if (obj.length > 10000) {
$("#content_notice_span").text("内容过长超过10000个字符");
$("#content_notice_span").css('color', '#ff0000');
$("#content_notice_span").focus();
@ -40,9 +38,27 @@
return true;
}
}
function regexTitle(obj){
var title = obj.val();
alert(title);
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;
}
}
function submit_message() {
if (system_message_length()) {
if (system_message_length() && regexTitle($("#system_message_subject"))) {
$("#system_messages-form").submit();
}
}

View File

@ -40,6 +40,7 @@
<div class="homepagePostDes">
<div class="homepagePostTo break_word">
<span class="fl"> Trustie平台 发布了系统消息:</span>
<span style="color:#0781b4; max-width:470px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;vertical-align: top;"><%= system_message.subject %></span>
</div>
<div class="cl"></div>
<p class="homepagePostIntro break_word upload_img">