2014-06-04 20:29:15 +08:00
|
|
|
|
<%= error_messages_for @contestnotifications %>
|
2014-10-23 10:57:23 +08:00
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
function regexTitle()
|
|
|
|
|
{
|
|
|
|
|
var title = $.trim($("#contestnotification_title").val());
|
|
|
|
|
if(title.length ==0)
|
|
|
|
|
{
|
|
|
|
|
$("#title_span").text("<%= l(:label_no_contest_news_title) %>");
|
|
|
|
|
$("#title_span").css('color','#ff0000');
|
|
|
|
|
$("#title_span").focus();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
else if(title.length <= 254)
|
|
|
|
|
{
|
|
|
|
|
$("#title_span").text("<%= l(:label_field_correct) %>");
|
|
|
|
|
$("#title_span").css('color','#008000');
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$("#title_span").text("<%= l(:label_contest_news_title_condition) %>");
|
|
|
|
|
$("#title_span").css('color','#ff0000');
|
|
|
|
|
$("#title_span").focus();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//验证描述:不能为空,不能多余5000个字符
|
|
|
|
|
function regexDescription()
|
|
|
|
|
{
|
|
|
|
|
var description = $.trim($("#contestnotification_description").val());
|
|
|
|
|
if(description.length ==0)
|
|
|
|
|
{
|
|
|
|
|
$("#description_span").text("<%= l(:label_no_contest_news_description) %>");
|
|
|
|
|
$("#description_span").css('color','#ff0000');
|
|
|
|
|
$("#description_span").focus();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
else if(description.length <= 5000)
|
|
|
|
|
{
|
|
|
|
|
$("#description_span").text("<%= l(:label_field_correct) %>");
|
|
|
|
|
$("#description_span").css('color','#008000');
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$("#description_span").text("<%= l(:label_contest_news_condition) %>");
|
|
|
|
|
$("#description_span").css('color','#ff0000');
|
|
|
|
|
$("#description_span").focus();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
2014-06-04 20:29:15 +08:00
|
|
|
|
<div class="add_frame_header" >
|
2014-06-09 11:30:18 +08:00
|
|
|
|
<%= l(:bale_news_notice) %>
|
2014-06-04 20:29:15 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="box tabular">
|
2014-10-23 10:44:06 +08:00
|
|
|
|
<p>
|
|
|
|
|
<%= f.text_field :title,
|
|
|
|
|
:required => true,
|
|
|
|
|
:size => 60,
|
|
|
|
|
:maxlength => 60,
|
|
|
|
|
:style => "width:488px;",
|
2014-12-19 11:23:16 +08:00
|
|
|
|
:onkeyup => "regexTitle();"
|
2014-10-23 10:44:06 +08:00
|
|
|
|
%>
|
|
|
|
|
</p>
|
|
|
|
|
<span id="title_span" style="padding-left: 100px;"></span>
|
|
|
|
|
<p>
|
|
|
|
|
<%= f.text_area :description,
|
|
|
|
|
:required => true,
|
|
|
|
|
:cols => 60,
|
|
|
|
|
:rows => 11,
|
|
|
|
|
:class => 'wiki-edit',
|
|
|
|
|
:style => "width:490px;",
|
2014-12-19 11:23:16 +08:00
|
|
|
|
:onkeyup => "regexDescription();"
|
2014-10-23 10:44:06 +08:00
|
|
|
|
%>
|
|
|
|
|
</p>
|
|
|
|
|
<span id="description_span" style="padding-left: 100px;"></span>
|
2014-06-04 20:29:15 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<%= wikitoolbar_for 'news_description' %>
|