|
|
|
@ -1,64 +1,6 @@
|
|
|
|
|
<div class="project_r_h">
|
|
|
|
|
<h2 class="project_h2"><%= l(:label_news) %></h2>
|
|
|
|
|
</div>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
function regexTitle()
|
|
|
|
|
{
|
|
|
|
|
var name = $("#news_title").val();
|
|
|
|
|
if(name.length ==0)
|
|
|
|
|
{
|
|
|
|
|
$("#title_notice_span").text("<%= l(:label_title_blank)%>");
|
|
|
|
|
$("#title_notice_span").css('color','#ff0000');
|
|
|
|
|
$("#title_notice_span").focus();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
else if(name.length <= 60)
|
|
|
|
|
{
|
|
|
|
|
$("#title_notice_span").text("<%= l(:label_field_correct)%>");
|
|
|
|
|
$("#title_notice_span").css('color','#008000');
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$("#title_notice_span").text("<%= l(:label_title_long)%>");
|
|
|
|
|
$("#title_notice_span").css('color','#ff0000');
|
|
|
|
|
$("#title_notice_span").focus();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function submitComment()
|
|
|
|
|
{
|
|
|
|
|
$("#add_comment_form").submit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function regexDescription()
|
|
|
|
|
{
|
|
|
|
|
var name = $("#news_description").val();
|
|
|
|
|
if(name.length ==0)
|
|
|
|
|
{
|
|
|
|
|
$("#description_notice_span").text("<%= l(:label_descripition_blank)%>");
|
|
|
|
|
$("#description_notice_span").css('color','#ff0000');
|
|
|
|
|
$("#description_notice_span").focus();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$("#description_notice_span").text("<%= l(:label_field_correct)%>");
|
|
|
|
|
$("#description_notice_span").css('color','#008000');
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function submitNews()
|
|
|
|
|
{
|
|
|
|
|
if(regexTitle() && regexDescription())
|
|
|
|
|
{
|
|
|
|
|
$("#news-form").submit();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<% if authorize_for('news', 'edit') %>
|
|
|
|
|
<div id="edit-news" style="display:none;">
|
|
|
|
|