2014-09-15 10:58:14 +08:00
|
|
|
|
<%#= error_messages_for 'softapplication' %>
|
|
|
|
|
|
2014-09-22 14:55:29 +08:00
|
|
|
|
<script type="text/javascript" xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html">
|
2014-09-15 10:58:14 +08:00
|
|
|
|
//验证作品名称
|
|
|
|
|
function regexName()
|
|
|
|
|
{
|
2014-10-14 17:09:52 +08:00
|
|
|
|
var name = $.trim($("#softapplication_name").val());
|
2014-09-22 14:55:29 +08:00
|
|
|
|
if(name.length == 0)
|
2014-09-15 10:58:14 +08:00
|
|
|
|
{
|
2014-09-22 14:55:29 +08:00
|
|
|
|
$("#spane_name_notice").text("<%= l(:label_no_softapplication_name) %>");
|
2014-09-15 10:58:14 +08:00
|
|
|
|
$("#spane_name_notice").css('color','#ff0000');
|
|
|
|
|
$("#spane_name_notice").focus();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
else if(name.length <= 25)
|
|
|
|
|
{
|
2014-09-22 14:55:29 +08:00
|
|
|
|
$("#spane_name_notice").text("<%= l(:label_field_correct) %>");
|
2014-09-15 10:58:14 +08:00
|
|
|
|
$("#spane_name_notice").css('color','#008000');
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-09-22 14:55:29 +08:00
|
|
|
|
$("#spane_name_notice").text("<%= l(:label_work_name_condition) %>");
|
2014-09-15 10:58:14 +08:00
|
|
|
|
$("#spane_name_notice").css('color','#ff0000');
|
|
|
|
|
$("#spane_name_notice").focus();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-22 14:55:29 +08:00
|
|
|
|
// added by longjun
|
|
|
|
|
//验证作品简介
|
|
|
|
|
function regexDescription()
|
|
|
|
|
{
|
2014-10-14 17:09:52 +08:00
|
|
|
|
var name = $.trim($("#softapplication_description").val());
|
2014-09-22 14:55:29 +08:00
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-09-15 10:58:14 +08:00
|
|
|
|
//验证运行平台
|
|
|
|
|
function regexWorkdescription()
|
|
|
|
|
{
|
2014-10-14 17:09:52 +08:00
|
|
|
|
var workDescription = $.trim($("#softapplication_android_min_version_available").val());
|
2014-09-15 10:58:14 +08:00
|
|
|
|
if(workDescription.length ==0)
|
|
|
|
|
{
|
2014-09-22 14:55:29 +08:00
|
|
|
|
$("#spane_workdescription_notice").text("<%= l(:label_no_softapplication_platform) %>");
|
2014-09-15 10:58:14 +08:00
|
|
|
|
$("#spane_workdescription_notice").css('color','#ff0000');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if(workDescription.length <= 125)
|
|
|
|
|
{
|
2014-09-22 14:55:29 +08:00
|
|
|
|
$("#spane_workdescription_notice").text("<%= l(:label_field_correct) %>");
|
2014-09-15 10:58:14 +08:00
|
|
|
|
$("#spane_workdescription_notice").css('color','#008000');
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-09-22 14:55:29 +08:00
|
|
|
|
$("#spane_workdescription_notice").text("<%= l(:label_work_platform_condition) %>");
|
2014-09-15 10:58:14 +08:00
|
|
|
|
$("#spane_workdescription_notice").css('color','#ff0000');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//验证开发人员
|
|
|
|
|
function regexDevelopers()
|
|
|
|
|
{
|
2014-10-14 17:09:52 +08:00
|
|
|
|
var workDescription = $.trim($("#softapplication_application_developers").val());
|
2014-09-15 10:58:14 +08:00
|
|
|
|
if(workDescription.length ==0)
|
|
|
|
|
{
|
2014-09-22 14:55:29 +08:00
|
|
|
|
$("#span_softapplication_application_developers").text("<%= l(:label_no_softapplication_developers) %>");
|
2014-09-15 10:58:14 +08:00
|
|
|
|
$("#span_softapplication_application_developers").css('color','#ff0000');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if(workDescription.length <= 125)
|
|
|
|
|
{
|
2014-09-22 14:55:29 +08:00
|
|
|
|
$("#span_softapplication_application_developers").text("<%= l(:label_field_correct) %>");
|
2014-09-15 10:58:14 +08:00
|
|
|
|
$("#span_softapplication_application_developers").css('color','#008000');
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2014-09-22 14:55:29 +08:00
|
|
|
|
$("#span_softapplication_application_developers").text("<%= l(:label_softapplication_developers_condition) %>");
|
2014-09-15 10:58:14 +08:00
|
|
|
|
$("#span_softapplication_application_developers").css('color','#ff0000');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//提交验证
|
|
|
|
|
function submit_new_softapplication()
|
|
|
|
|
{
|
2014-09-22 14:55:29 +08:00
|
|
|
|
if(regexName() && regexDescription() && regexDevelopers())
|
2014-09-15 10:58:14 +08:00
|
|
|
|
{
|
|
|
|
|
$("#new_softapplication").submit();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<%= form_for Softapplication.new, :url => softapplications_path do |f| %>
|
|
|
|
|
<fieldset class="contes-new-box" style="padding-left: 36px; line-height: 8px; margin-left: 1px" >
|
|
|
|
|
<%= hidden_field_tag 'contest_id', @contest.id %>
|
|
|
|
|
<tr style="width:700px; margin-left: -10px;">
|
|
|
|
|
<span><%= l(:label_work_name) %></span>
|
|
|
|
|
<span class="contest-star"> * </span>:
|
2014-09-22 14:55:29 +08:00
|
|
|
|
|
2014-09-15 10:58:14 +08:00
|
|
|
|
<%= f.text_field :name,
|
|
|
|
|
:required => true,
|
|
|
|
|
:size => 60,
|
|
|
|
|
:style => "width:320px;",
|
|
|
|
|
:onblur => "regexName();"
|
|
|
|
|
%>
|
2014-09-22 14:55:29 +08:00
|
|
|
|
|
2014-09-15 10:58:14 +08:00
|
|
|
|
<span style="font-size: 10px;" id="spane_name_notice">(<%= l(:label_workname_lengthlimit) %>)</span>
|
|
|
|
|
</tr>
|
|
|
|
|
<br/>
|
|
|
|
|
<br/>
|
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-09-22 14:55:29 +08:00
|
|
|
|
<tr style="width:800px; padding-bottom: 30px;">
|
|
|
|
|
|
2014-09-22 17:32:18 +08:00
|
|
|
|
<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>
|
2014-09-22 14:55:29 +08:00
|
|
|
|
|
|
|
|
|
<!-- modified by longjun 将单行输入框改成多行-->
|
|
|
|
|
<%= f.text_area :description,
|
2014-09-15 10:58:14 +08:00
|
|
|
|
:required => true,
|
|
|
|
|
:size => 60,
|
2014-09-22 14:55:29 +08:00
|
|
|
|
:rows => 3,
|
|
|
|
|
:onblur => 'regexDescription();',
|
|
|
|
|
:style => "width:320px; "
|
2014-09-15 10:58:14 +08:00
|
|
|
|
%>
|
2014-09-22 14:55:29 +08:00
|
|
|
|
<span style="font-size: 10px;" id="span_sofapplication_description">(<%= l(:label_work_description_lengthlimit) %>)</span>
|
2014-09-15 10:58:14 +08:00
|
|
|
|
<!--span style="font-size: 10px">(<%#= l(:label_workdescription_lengthlimit) %>)</span-->
|
2014-09-22 17:32:18 +08:00
|
|
|
|
|
2014-09-15 10:58:14 +08:00
|
|
|
|
</tr>
|
|
|
|
|
<br/>
|
|
|
|
|
<br/>
|
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
|
<tr style="width:800px;">
|
|
|
|
|
<span><%= l(:label_softapplication_developers) %></span>
|
|
|
|
|
<span class="contest-star"> * </span>:
|
2014-09-22 14:55:29 +08:00
|
|
|
|
|
2014-09-15 10:58:14 +08:00
|
|
|
|
<%= f.text_field :application_developers,
|
|
|
|
|
:required => true,
|
|
|
|
|
:size => 60,
|
|
|
|
|
:style => "width:320px;",
|
|
|
|
|
:onblur => 'regexDevelopers();'
|
|
|
|
|
%>
|
2014-09-22 14:55:29 +08:00
|
|
|
|
|
2014-09-15 10:58:14 +08:00
|
|
|
|
<span style="font-size: 10px" id="span_softapplication_application_developers">
|
|
|
|
|
(<%= l(:label_workdescription_lengthlimit) %>)
|
|
|
|
|
</span>
|
|
|
|
|
</tr>
|
|
|
|
|
<br/>
|
|
|
|
|
<br/>
|
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
|
<tr style="width:800px;">
|
|
|
|
|
<span><%= l(:label_work_deposit_project) %>:</span>
|
|
|
|
|
<span style="padding-left: 4px">
|
|
|
|
|
<%= select_tag 'project',
|
|
|
|
|
options_for_select(select_option_helper(@option)),
|
|
|
|
|
:name => 'project',
|
|
|
|
|
:class => 'grayline2',
|
|
|
|
|
:style => "width:328px;"
|
|
|
|
|
%>
|
|
|
|
|
</span>
|
|
|
|
|
<span>
|
|
|
|
|
|
|
|
|
|
<!-- modified by longjun -->
|
|
|
|
|
<%= link_to l(:label_create_new_projects),
|
|
|
|
|
new_project_path(:course => 0, :project_type => 0, :host => Setting.project_domain),
|
|
|
|
|
:target => '_blank'
|
|
|
|
|
%>
|
|
|
|
|
<!-- end longjun -->
|
|
|
|
|
</span><!-- new_project_path(course: 0, project_type: 0) -->
|
|
|
|
|
</tr>
|
|
|
|
|
<br/>
|
|
|
|
|
<br/>
|
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
|
<fieldset style="width: 500px; padding-top: 10px">
|
|
|
|
|
<legend>
|
|
|
|
|
<%= l(:label_upload_softworkpacket_photo) %>
|
|
|
|
|
</legend>
|
|
|
|
|
<%#= render_flash_messages %>
|
|
|
|
|
<p id="put-bid-form-partial">
|
|
|
|
|
<%= render :partial => 'attachments/form' %>
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<p style="font-size: 11px;line-height:normal;">
|
|
|
|
|
1、<%= l(:label_upload_softapplication_packets_mustpacketed) %> <br/>
|
|
|
|
|
<br>
|
|
|
|
|
2、<%= l(:label_upload_softapplication_photo_condition) %>
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
</fieldset>
|
|
|
|
|
</fieldset></br>
|
|
|
|
|
<div class="align-center" style="padding-top: -3px; padding-bottom: 8px">
|
2014-09-22 14:55:29 +08:00
|
|
|
|
<input type="button" class="enterprise" value="<%=l(:button_create) %>" onclick="submit_new_softapplication();" >
|
|
|
|
|
<%#= submit_tag l(:button_create) %>
|
2014-09-15 10:58:14 +08:00
|
|
|
|
<%= submit_tag l(:button_cancel),
|
|
|
|
|
:name => nil,
|
|
|
|
|
:onclick => "cancel();",
|
|
|
|
|
:type => 'button',
|
|
|
|
|
:class => "enterprise",
|
|
|
|
|
:onmouseout => "this.style.backgroundPosition = 'left top'",
|
|
|
|
|
:onmouseover => "this.style.backgroundPosition = 'left -30px'" %>
|
|
|
|
|
</div>
|
2014-07-28 14:58:01 +08:00
|
|
|
|
<% end %>
|