Merge branch 'szzh' into develop

This commit is contained in:
sw 2015-06-13 15:24:25 +08:00
commit 1637977159
4 changed files with 8 additions and 61 deletions

View File

@ -107,7 +107,7 @@
<!--邀请加入-->
<div class="subNavBox">
<% if User.current.member_of?(@project) %>
<div class="subNav currentDd currentDt subNav_jiantou" id="expand_tools_expand_invit" nhtype="toggle4cookie" data-id="expand_invit" data-target="#navContent_invit">
<div class="subNav currentDd currentDt subNav_jiantou" id="expand_tools_expand_invit" nhtype="toggle4cookie" data-id="expand_invit" data-target="#navContent_invit" data-val="expand">
<%= l(:label_invite)%>
</div>
<ul class="navContent " style="display:block" id="navContent_invit">

View File

@ -28,7 +28,7 @@
<%= link_to l(:button_create), "javascript:void(0)", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'blue_btn fl c_white' %>
<%= link_to l(:button_cancel), project_news_index_path(@project), :onclick => '$("#add-news").hide()', :class => 'blue_btn grey_btn fl c_white' %>
<% else %>
<%= link_to l(:button_save), "javascript:void(0)", :onclick => "submitNews();",:onmouseover => 'this.focus()',:class => 'blue_btn fl c_white' %>
<%= link_to l(:button_save), "javascript:void(0)", :onclick => "submitNews();",:onmouseover => 'this.focus()',:class => 'blue_btn fl c_white'%>
<%= link_to l(:button_cancel), news_path(@news), :class => 'blue_btn grey_btn fl c_white' %>
<% end %>
<div class="cl"></div>

View File

@ -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;">

View File

@ -265,6 +265,11 @@ function submitFocus(obj) {
$(obj).focus();
}
function submitComment()
{
$("#add_comment_form").submit();
}
//当项目描述长度小于112px时不显示更多按钮
$(function () {
// alert($("#course_description_content").height());
@ -485,4 +490,4 @@ function judgeprojectname(){
name:{required : "请填写项目名称!",remote:'您已新建过同名项目,请修改项目名称!'}
}
});
}
}