|
|
|
@ -1,51 +1,77 @@
|
|
|
|
|
<%#= error_messages_for 'softapplication' %>
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript" xmlns="http://www.w3.org/1999/html">
|
|
|
|
|
<script type="text/javascript" xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html">
|
|
|
|
|
//验证作品名称
|
|
|
|
|
function regexName()
|
|
|
|
|
{
|
|
|
|
|
var name = $("#softapplication_name").val();
|
|
|
|
|
if(name.length == 0)
|
|
|
|
|
{
|
|
|
|
|
$("#spane_name_notice").text("作品名称不能为空");
|
|
|
|
|
$("#spane_name_notice").text("<%= l(:label_no_softapplication_name) %>");
|
|
|
|
|
$("#spane_name_notice").css('color','#ff0000');
|
|
|
|
|
$("#spane_name_notice").focus();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
else if(name.length <= 25)
|
|
|
|
|
{
|
|
|
|
|
$("#spane_name_notice").text("填写正确");
|
|
|
|
|
$("#spane_name_notice").text("<%= l(:label_field_correct) %>");
|
|
|
|
|
$("#spane_name_notice").css('color','#008000');
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$("#spane_name_notice").text("作品名称超过25个汉字");
|
|
|
|
|
$("#spane_name_notice").text("<%= l(:label_work_name_condition) %>");
|
|
|
|
|
$("#spane_name_notice").css('color','#ff0000');
|
|
|
|
|
$("#spane_name_notice").focus();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// added by longjun
|
|
|
|
|
//验证作品简介
|
|
|
|
|
function regexDescription()
|
|
|
|
|
{
|
|
|
|
|
var name = $("#softapplication_description").val();
|
|
|
|
|
if(name.length ==0)
|
|
|
|
|
{
|
|
|
|
|
$("#span_sofapplication_description").text("<%= l(:label_no_softapplication_description) %>");
|
|
|
|
|
$("#span_sofapplication_description").css('color','#ff0000');
|
|
|
|
|
$("#span_sofapplication_description").focus();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
else if(name.length <= 500)
|
|
|
|
|
{
|
|
|
|
|
$("#span_sofapplication_description").text("<%= l(:label_field_correct) %>");
|
|
|
|
|
$("#span_sofapplication_description").css('color','#008000');
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$("#span_sofapplication_description").text("<%= l(:label_work_description_condition) %>");
|
|
|
|
|
$("#span_sofapplication_description").css('color','#ff0000');
|
|
|
|
|
$("#span_sofapplication_description").focus();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//验证运行平台
|
|
|
|
|
function regexWorkdescription()
|
|
|
|
|
{
|
|
|
|
|
var workDescription = $("#softapplication_android_min_version_available").val();
|
|
|
|
|
if(workDescription.length ==0)
|
|
|
|
|
{
|
|
|
|
|
$("#spane_workdescription_notice").text("运行平台不能为空");
|
|
|
|
|
$("#spane_workdescription_notice").text("<%= l(:label_no_softapplication_platform) %>");
|
|
|
|
|
$("#spane_workdescription_notice").css('color','#ff0000');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if(workDescription.length <= 125)
|
|
|
|
|
{
|
|
|
|
|
$("#spane_workdescription_notice").text("填写正确");
|
|
|
|
|
$("#spane_workdescription_notice").text("<%= l(:label_field_correct) %>");
|
|
|
|
|
$("#spane_workdescription_notice").css('color','#008000');
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$("#spane_workdescription_notice").text("运行平台超过125个汉字");
|
|
|
|
|
$("#spane_workdescription_notice").text("<%= l(:label_work_platform_condition) %>");
|
|
|
|
|
$("#spane_workdescription_notice").css('color','#ff0000');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -77,7 +103,7 @@
|
|
|
|
|
//提交验证
|
|
|
|
|
function submit_new_softapplication()
|
|
|
|
|
{
|
|
|
|
|
if(regexName() && regexWorkdescription() && regexDevelopers())
|
|
|
|
|
if(regexName() && regexDescription() && regexDevelopers())
|
|
|
|
|
{
|
|
|
|
|
$("#new_softapplication").submit();
|
|
|
|
|
}
|
|
|
|
@ -90,71 +116,39 @@
|
|
|
|
|
<tr style="width:700px; margin-left: -10px;">
|
|
|
|
|
<span><%= l(:label_work_name) %></span>
|
|
|
|
|
<span class="contest-star"> * </span>:
|
|
|
|
|
<td>
|
|
|
|
|
|
|
|
|
|
<%= f.text_field :name,
|
|
|
|
|
:required => true,
|
|
|
|
|
:size => 60,
|
|
|
|
|
:style => "width:320px;",
|
|
|
|
|
:onblur => "regexName();"
|
|
|
|
|
%>
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
<span style="font-size: 10px;" id="spane_name_notice">(<%= l(:label_workname_lengthlimit) %>)</span>
|
|
|
|
|
</tr>
|
|
|
|
|
<br/>
|
|
|
|
|
<br/>
|
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
|
<tr style="width:800px;">
|
|
|
|
|
<span><%= l(:label_running_platform) %></span>
|
|
|
|
|
<span class="contest-star"> * </span>:
|
|
|
|
|
<td style="width: 100px">
|
|
|
|
|
<%= f.text_field :android_min_version_available,
|
|
|
|
|
:required => true,
|
|
|
|
|
:size => 60,
|
|
|
|
|
:style => "width:320px;",
|
|
|
|
|
:onblur=>"regexWorkdescription();"
|
|
|
|
|
%>
|
|
|
|
|
</td>
|
|
|
|
|
<span style="font-size: 10px" id="spane_workdescription_notice">(<%= l(:label_workdescription_lengthlimit) %>)</span>
|
|
|
|
|
</tr>
|
|
|
|
|
<br/>
|
|
|
|
|
<br/>
|
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
|
<tr style="width:800px;">
|
|
|
|
|
<span><%= l(:label_work_type) %></span>
|
|
|
|
|
<span class="contest-star"> * </span>:
|
|
|
|
|
<td style="width: 100px">
|
|
|
|
|
<span>
|
|
|
|
|
<%#= select_tag 'app_type_name', work_type_opttion, {:name => 'app_type_name',:style => "width:358px;"} %>
|
|
|
|
|
</span>
|
|
|
|
|
<%= f.select :app_type_name,work_type_opttion,
|
|
|
|
|
{},
|
|
|
|
|
{:style => "width:328px;",:onchange => "selectChange(this)"} %>
|
|
|
|
|
<%#= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %>
|
|
|
|
|
</td>
|
|
|
|
|
<span style="font-size: 10px;display: none" id="other_span">
|
|
|
|
|
<%#= f.text_field :other_input, :required => true, :size => 60, :style => "width:100px;" %>
|
|
|
|
|
<input type="text" style="width: 120px;" id="other_input" name = "other_input"/>
|
|
|
|
|
</span>
|
|
|
|
|
</tr>
|
|
|
|
|
<br/>
|
|
|
|
|
<br/>
|
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
|
<tr style="width:800px;">
|
|
|
|
|
<td style="padding-bottom: 290px;">
|
|
|
|
|
<span><%= l(:label_work_description) %></span>
|
|
|
|
|
<span class="contest-star"> * </span>:
|
|
|
|
|
</td>
|
|
|
|
|
<td style="width: 100px">
|
|
|
|
|
<%= f.text_field :description,
|
|
|
|
|
<tr style="width:800px; padding-bottom: 30px;">
|
|
|
|
|
|
|
|
|
|
<span style="margin-top: 5px; float: left; display: block;"><%= l(:label_work_description) %> </span>
|
|
|
|
|
<span style="margin-top: 5px;float: left; display: block;" class="contest-star"> * </span>
|
|
|
|
|
<span style="margin-top: 5px; float: left; display: block;"> : </span>
|
|
|
|
|
|
|
|
|
|
<!-- modified by longjun 将单行输入框改成多行-->
|
|
|
|
|
<%= f.text_area :description,
|
|
|
|
|
:required => true,
|
|
|
|
|
:size => 60,
|
|
|
|
|
:rows => 3,
|
|
|
|
|
:onblur => 'regexDescription();',
|
|
|
|
|
:style => "width:320px; "
|
|
|
|
|
%>
|
|
|
|
|
</td>
|
|
|
|
|
<span style="font-size: 10px;" id="span_sofapplication_description">(<%= l(:label_work_description_lengthlimit) %>)</span>
|
|
|
|
|
<!--span style="font-size: 10px">(<%#= l(:label_workdescription_lengthlimit) %>)</span-->
|
|
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
|
<br/>
|
|
|
|
|
<br/>
|
|
|
|
@ -163,14 +157,14 @@
|
|
|
|
|
<tr style="width:800px;">
|
|
|
|
|
<span><%= l(:label_softapplication_developers) %></span>
|
|
|
|
|
<span class="contest-star"> * </span>:
|
|
|
|
|
<td style="width: 100px">
|
|
|
|
|
|
|
|
|
|
<%= f.text_field :application_developers,
|
|
|
|
|
:required => true,
|
|
|
|
|
:size => 60,
|
|
|
|
|
:style => "width:320px;",
|
|
|
|
|
:onblur => 'regexDevelopers();'
|
|
|
|
|
%>
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
<span style="font-size: 10px" id="span_softapplication_application_developers">
|
|
|
|
|
(<%= l(:label_workdescription_lengthlimit) %>)
|
|
|
|
|
</span>
|
|
|
|
|