2016-12-30 11:30:40 +08:00
|
|
|
|
<ul class="newuploadbox">
|
|
|
|
|
<li class="mb10 clear">
|
|
|
|
|
<label class="fl" style="width: 90px;text-align: right;">贴吧名称 : </label>
|
|
|
|
|
<!--<input maxlength="80" class="postCreateInput" onfocus="hideError();" onblur="check_forum_name();" placeholder="输入贴吧名称" >-->
|
2016-12-30 13:47:31 +08:00
|
|
|
|
<%= f.text_field :name, :label => "", :name => "forum[name]", :id => "forum_name", :class => "issues_calendar_input fl", :style => "width:320px;height:28px;", :placeholder => "请输入贴吧名称,最多50个字符", :onfocus => "$('#forum_name_error_tips').hide();" %>
|
|
|
|
|
<!--<input type="text" name="forum[name]" id="forum_name" onfocus="$('#forum_name_error_tips').hide();" placeholder="请输入贴吧名称,最多50个字符" class="issues_calendar_input fl" style="width:320px;height:28px;">-->
|
2016-12-30 11:30:40 +08:00
|
|
|
|
<div class="clear"></div>
|
|
|
|
|
<p class="c_red ml90" style="display: none" id="forum_name_error_tips"></p>
|
|
|
|
|
</li>
|
|
|
|
|
<li class=" clear">
|
|
|
|
|
<label class="fl" style="width: 90px;text-align: right;">贴吧描述 : </label>
|
2016-12-30 13:47:31 +08:00
|
|
|
|
<%= f.text_area :description, :label => "", :maxlength => "5000", :name => "forum[description]", :id => "forum_desc", :class => "mr15 mb10 fl newupload_textarea", :style => "width:320px;height:100px;", :placeholder => "请输入新建贴吧描述,最多5000个字符", :onfocus => "$('#forum_description_error_tips').hide();" %>
|
2016-12-30 11:30:40 +08:00
|
|
|
|
<div class="clear"></div>
|
|
|
|
|
<p class="c_red ml90" style="display: none" id="forum_description_error_tips"></p>
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
<div class="clear mr45 mb10">
|
|
|
|
|
<a href="javascript:void(0);" class="btn fr" onclick="hideModal()" >取消</a>
|
|
|
|
|
<a href="javascript:void(0);" class="btn btn-blue fr mr5" onclick="forums_commit();">确定</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
2016-12-30 13:47:31 +08:00
|
|
|
|
|
2016-12-30 11:30:40 +08:00
|
|
|
|
<script>
|
|
|
|
|
function forums_commit(){
|
|
|
|
|
$("#forum_name_error_tips").hide();
|
|
|
|
|
$("#forum_description_error_tips").hide();
|
|
|
|
|
if ($("#forum_name").val().trim() == ""){
|
|
|
|
|
$("#forum_name_error_tips").html("贴吧名称不能为空").show();
|
|
|
|
|
}
|
|
|
|
|
else if($("#forum_desc").val().trim() == ""){
|
|
|
|
|
$("#forum_description_error_tips").html("贴吧描述不能为空").show();
|
|
|
|
|
}
|
|
|
|
|
else if($("#forum_desc").val().length > 5000){
|
|
|
|
|
$("#forum_description_error_tips").html("贴吧描述不能超过5000个字符").show();
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
$.ajax({
|
|
|
|
|
url:'<%= check_forum_name_forums_path %>',
|
|
|
|
|
type:'get',
|
|
|
|
|
data:{
|
|
|
|
|
forum_name:$("#forum_name").val().trim()
|
|
|
|
|
},
|
|
|
|
|
success:function(data){
|
|
|
|
|
if(data.result == true){
|
|
|
|
|
$("#forum_new").submit();
|
|
|
|
|
hideModal();
|
|
|
|
|
return true;
|
|
|
|
|
}else{
|
|
|
|
|
$("#forum_name_error_tips").html("贴吧名称已存在").show();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
error:function(){
|
|
|
|
|
alert('请检查当前网络连接')
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|