2014-11-03 15:35:29 +08:00
|
|
|
|
<%= stylesheet_link_tag 'css', :media => 'all' %>
|
2014-11-04 16:27:34 +08:00
|
|
|
|
<script type="text/javascript" language="javascript" xmlns="http://www.w3.org/1999/html">
|
|
|
|
|
function regexName()
|
2014-11-02 17:08:19 +08:00
|
|
|
|
{
|
2014-11-22 11:19:58 +08:00
|
|
|
|
var name = $.trim($("#homework_attach_name").val());
|
2014-11-04 16:27:34 +08:00
|
|
|
|
|
|
|
|
|
if(name=="")
|
|
|
|
|
{
|
2014-11-22 11:19:58 +08:00
|
|
|
|
$("#homework_attach_name_span").text("作品名称不能为空");
|
2014-11-04 16:27:34 +08:00
|
|
|
|
$("#homework_attach_name_span").css('color','#ff0000');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$("#homework_attach_name_span").text("填写正确");
|
|
|
|
|
$("#homework_attach_name_span").css('color','#008000');
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2014-11-02 17:08:19 +08:00
|
|
|
|
}
|
2014-11-22 11:19:58 +08:00
|
|
|
|
function regexDescription()
|
|
|
|
|
{
|
|
|
|
|
var name = $.trim($("#homework_attach_description").val());
|
|
|
|
|
|
|
|
|
|
if(name=="")
|
|
|
|
|
{
|
|
|
|
|
$("#homework_attach_description_span").text("作品描述不能为空");
|
|
|
|
|
$("#homework_attach_description_span").css('color','#ff0000');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$("#homework_attach_description_span").text("填写正确");
|
|
|
|
|
$("#homework_attach_description_span").css('color','#008000');
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-11-04 16:27:34 +08:00
|
|
|
|
|
2014-11-22 11:19:58 +08:00
|
|
|
|
function submit_homework_form(){if(regexName()&®exDescription()){$('#new_homework_attach').submit();}}
|
2014-11-03 15:35:29 +08:00
|
|
|
|
</script>
|
2014-11-02 12:58:09 +08:00
|
|
|
|
<div class="container">
|
|
|
|
|
<div class="Newwork">
|
|
|
|
|
<div id="tb_" class="tb_">
|
|
|
|
|
<ul>
|
2014-11-26 15:24:41 +08:00
|
|
|
|
<li id="tb_1" class="hovertab" onmouseover="x:HoverLi(1);" style="width: auto; padding:5px 10px 0;">
|
2014-11-02 17:08:19 +08:00
|
|
|
|
创建作品
|
|
|
|
|
</li>
|
2014-11-26 15:24:41 +08:00
|
|
|
|
<li class="N_top" style="width: 835px;">
|
2014-11-03 11:53:16 +08:00
|
|
|
|
<%= link_to(l(:label_project_new), {:controller => 'projects',
|
|
|
|
|
:action => 'new',
|
|
|
|
|
:course => 0,
|
|
|
|
|
:project_type => 0}) if User.current.allowed_to?(:add_project, nil, :global => true) %>
|
2014-11-02 17:08:19 +08:00
|
|
|
|
</li>
|
2014-11-02 12:58:09 +08:00
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
2014-11-03 15:35:29 +08:00
|
|
|
|
<div class="dis" id="tbc_01">
|
|
|
|
|
<div class="N_con">
|
|
|
|
|
<%= form_for(HomeworkAttach.new, :method => :post,
|
|
|
|
|
:name => 'new_form',
|
|
|
|
|
:url => {:controller => 'homework_attach',
|
|
|
|
|
:action => 'create',
|
|
|
|
|
:user_id => User.current.id,
|
|
|
|
|
:bid_id => @bid
|
|
|
|
|
}) do |f|%>
|
2014-11-02 12:58:09 +08:00
|
|
|
|
<p>
|
2014-11-02 17:08:19 +08:00
|
|
|
|
<label>
|
|
|
|
|
<span class="c_red">
|
|
|
|
|
*
|
|
|
|
|
</span>
|
|
|
|
|
作品名称 :
|
|
|
|
|
</label>
|
2014-12-19 11:23:16 +08:00
|
|
|
|
<%= f.text_field "name", :required => true, :size => 60, :class => "w430 bo", :maxlength => 254, :placeholder => "作品名称", :onkeyup => "regexName();" %>
|
2014-11-04 16:27:34 +08:00
|
|
|
|
<span id="homework_attach_name_span"></span>
|
2014-11-02 12:58:09 +08:00
|
|
|
|
</p>
|
|
|
|
|
<p>
|
2014-11-26 15:24:41 +08:00
|
|
|
|
<label style="float:left;">
|
2014-11-02 17:08:19 +08:00
|
|
|
|
<span class="c_red">
|
2014-11-22 11:19:58 +08:00
|
|
|
|
*
|
2014-11-02 17:08:19 +08:00
|
|
|
|
</span>
|
2014-11-26 15:24:41 +08:00
|
|
|
|
作品描述 :
|
2014-11-02 17:08:19 +08:00
|
|
|
|
</label>
|
2015-01-10 17:27:08 +08:00
|
|
|
|
<%= f.text_area "description", :class => "w620", :maxlength => 3000, :style => "width:430px", :placeholder => "最多3000个汉字", :onkeyup => "regexDescription();"%>
|
|
|
|
|
<br />
|
|
|
|
|
<span id="homework_attach_description_span" style="padding-left: 100px;"></span>
|
|
|
|
|
</p>
|
2015-01-09 17:03:58 +08:00
|
|
|
|
<br/> <span id="homework_attach_description_span" style="padding-left: 100px;"></span>
|
2014-11-02 12:58:09 +08:00
|
|
|
|
</p>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<p>
|
2014-11-26 15:24:41 +08:00
|
|
|
|
<label style="float: left;">
|
|
|
|
|
添加附件 :
|
|
|
|
|
</label>
|
2014-11-03 15:35:29 +08:00
|
|
|
|
<p style=" padding: 3px 0 3px 0;padding-left: 90px;">
|
|
|
|
|
<%= render :partial => 'attachments/form' %>
|
|
|
|
|
</p>
|
2014-11-02 12:58:09 +08:00
|
|
|
|
</p>
|
2014-11-06 13:53:57 +08:00
|
|
|
|
<p>
|
|
|
|
|
<label> 开发项目
|
|
|
|
|
<img src="/images/bid/pic_question.png" width="16" height="16"
|
|
|
|
|
title="项目是一种由用户创建的基于网络的协作空间,能够为个人或小组提供分布式的协同交流和资料管理等方面的支持。
|
|
|
|
|
项目托管平台:http://forge.trustie.ne">:
|
|
|
|
|
</label>
|
|
|
|
|
<%= f.select :project_id,options_for_select(user_projects_option), {},{:class => "w350 bo"} %>
|
|
|
|
|
</p>
|
2014-11-02 12:58:09 +08:00
|
|
|
|
|
|
|
|
|
<p>
|
2014-11-02 17:08:19 +08:00
|
|
|
|
<span style="float: left;">
|
|
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
<a href="#" class="tijiao" onclick="submit_homework_form();">
|
|
|
|
|
<%= l(:label_button_ok) %>
|
|
|
|
|
</a>
|
2014-11-03 11:53:16 +08:00
|
|
|
|
<a href="javascript:history.back()" class="tijiao">取 消</a>
|
2014-11-02 12:58:09 +08:00
|
|
|
|
<div class="cl"></div>
|
2014-10-23 11:30:34 +08:00
|
|
|
|
</p>
|
2014-11-03 15:35:29 +08:00
|
|
|
|
<% end %>
|
|
|
|
|
</div><!---创建作业内容结束-->
|
2014-11-02 12:58:09 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div><!--新建作业结束-->
|