2014-11-03 15:35:29 +08:00
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
|
<head>
|
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
|
<title>新建作业</title>
|
|
|
|
|
<%= stylesheet_link_tag 'css'%>
|
|
|
|
|
<script type="text/javascript" language="javascript">
|
|
|
|
|
function switchTab(ProTag){
|
|
|
|
|
var display_index = 3 - ProTag;
|
|
|
|
|
$("#tb_" + ProTag).attr("class","hovertab");
|
|
|
|
|
$("#tb_" + display_index).attr("class","normaltab");
|
|
|
|
|
$("#content" + ProTag).show();
|
|
|
|
|
$("#content" + display_index).hide();
|
|
|
|
|
}
|
|
|
|
|
function submit_homework_form()
|
|
|
|
|
{
|
2014-11-04 16:27:34 +08:00
|
|
|
|
if(regexName()){$('#edit_homework_attach_<%= @homework.id%>').submit();}
|
|
|
|
|
}
|
|
|
|
|
function regexName()
|
|
|
|
|
{
|
|
|
|
|
var name = $("#homework_attach_name").val();
|
|
|
|
|
|
|
|
|
|
if(name=="")
|
|
|
|
|
{
|
|
|
|
|
$("#homework_attach_name_span").text("名称不能为空");
|
|
|
|
|
$("#homework_attach_name_span").css('color','#ff0000');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2015-04-10 16:59:45 +08:00
|
|
|
|
$("#homework_attach_name_span").text("<%= l(:label_field_correct)%>");
|
2014-11-04 16:27:34 +08:00
|
|
|
|
$("#homework_attach_name_span").css('color','#008000');
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2014-11-03 15:35:29 +08:00
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
</head>
|
2014-10-23 11:30:34 +08:00
|
|
|
|
|
2014-11-03 15:35:29 +08:00
|
|
|
|
<body>
|
2015-01-31 14:29:11 +08:00
|
|
|
|
<div class="container" id="content">
|
2014-11-03 15:35:29 +08:00
|
|
|
|
<div class="Newwork">
|
|
|
|
|
<div id="tb_" class="tb_">
|
|
|
|
|
<ul>
|
2014-11-26 15:24:41 +08:00
|
|
|
|
<li id="tb_1" class="hovertab" onclick="switchTab(1);this.blur();return false;" style="width: auto; padding:5px 10px 0;">
|
2014-11-03 15:35:29 +08:00
|
|
|
|
修改作业
|
|
|
|
|
</li>
|
|
|
|
|
<li id="tb_2" class="normaltab" onclick="switchTab(2);this.blur();return false;">
|
|
|
|
|
成员
|
|
|
|
|
</li>
|
2014-11-26 15:24:41 +08:00
|
|
|
|
<li class="N_top" style="width: 747px;">
|
2014-11-03 15:35:29 +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) %>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
2014-10-23 11:30:34 +08:00
|
|
|
|
|
2014-11-03 15:35:29 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div id="content1">
|
|
|
|
|
<div class="N_con">
|
|
|
|
|
<%= form_for(@homework) do |f|%>
|
|
|
|
|
<p>
|
2014-11-26 15:24:41 +08:00
|
|
|
|
<label>
|
|
|
|
|
<span class="c_red">*</span>
|
|
|
|
|
作品名称 :
|
|
|
|
|
</label>
|
2014-12-19 11:23:16 +08:00
|
|
|
|
<%= f.text_field :name, :required => true, :name => "homework_name", :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-03 15:35:29 +08:00
|
|
|
|
</p>
|
|
|
|
|
<p>
|
2014-11-26 15:24:41 +08:00
|
|
|
|
<label style="float:left;">
|
|
|
|
|
<span class="c_red">*</span>
|
|
|
|
|
作业描述 :
|
2014-11-03 15:35:29 +08:00
|
|
|
|
</label>
|
|
|
|
|
<%= f.text_area :description, :rows => 8, :name => "homework_description", :class => "w620",
|
|
|
|
|
:maxlength => 3000, :placeholder => "最多3000个汉字" %>
|
2014-10-23 11:30:34 +08:00
|
|
|
|
</p>
|
2014-11-03 15:35:29 +08:00
|
|
|
|
<p>
|
2014-11-26 15:24:41 +08:00
|
|
|
|
<label style="float: left;">
|
|
|
|
|
添加附件 :
|
|
|
|
|
</label>
|
2015-04-28 14:57:02 +08:00
|
|
|
|
<div style="float: left;padding-bottom: 15px;">
|
|
|
|
|
<%= render :partial => 'attachments/form', :locals => {:container => @homework}%>
|
|
|
|
|
</div>
|
2014-10-23 11:30:34 +08:00
|
|
|
|
</p>
|
2015-04-28 14:57:02 +08:00
|
|
|
|
<div class="cl"></div>
|
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>
|
|
|
|
|
<% if @homework.project.nil? %>
|
|
|
|
|
<%= f.select :project_id, options_for_select(user_projects_option),{}, {:name => "project_id", :required => true,:class => "w350 bo"}%>
|
|
|
|
|
<% else %>
|
|
|
|
|
<%= f.select :project_id, options_for_select(user_projects_option,@homework.project.id),{},{:name => "project_id", :required => true, :class => "w350 bo"}%>
|
|
|
|
|
<% end %>
|
|
|
|
|
</p>
|
2014-10-23 11:30:34 +08:00
|
|
|
|
|
2014-11-03 15:35:29 +08:00
|
|
|
|
<p>
|
|
|
|
|
<span style="float: left;">
|
|
|
|
|
|
|
|
|
|
</span>
|
2015-03-25 10:21:33 +08:00
|
|
|
|
<a href="javascript:" class="tijiao" onclick="submit_homework_form();">
|
2014-11-03 15:35:29 +08:00
|
|
|
|
<%= l(:label_button_ok) %>
|
|
|
|
|
</a>
|
|
|
|
|
<a href="javascript:history.back()" class="tijiao">取 消</a>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</p>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div><!---创建作业内容结束-->
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="content2" class="undis">
|
|
|
|
|
<%= render :partial => "homework_member",:locals => {:members => @members,:hoemwork_users =>@hoemwork_users,:homework => @homework} %>
|
|
|
|
|
</div><!---成员结束-->
|
|
|
|
|
</div>
|
|
|
|
|
</div><!--新建作业结束-->
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|