socialforge/app/views/homework_attach/edit.html.erb

121 lines
5.2 KiB
Plaintext
Raw Normal View History

<!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;
}
}
</script>
</head>
<body>
2015-01-31 14:29:11 +08:00
<div class="container" id="content">
<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;">
修改作业
</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;">
<%= 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>
</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>
&nbsp;&nbsp;作品名称&nbsp;&nbsp;&nbsp;&nbsp;
</label>
<%= 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>
</p>
<p>
2014-11-26 15:24:41 +08:00
<label style="float:left;">
<span class="c_red">*</span>
&nbsp;&nbsp;作业描述&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</label>
<%= f.text_area :description, :rows => 8, :name => "homework_description", :class => "w620",
:maxlength => 3000, :placeholder => "最多3000个汉字" %>
</p>
<p>
2014-11-26 15:24:41 +08:00
<label style="float: left;">
&nbsp;&nbsp;&nbsp;添加附件&nbsp;&nbsp;&nbsp;&nbsp;
</label>
2015-04-28 14:57:02 +08:00
<div style="float: left;padding-bottom: 15px;">
<%= render :partial => 'attachments/form', :locals => {:container => @homework}%>
</div>
</p>
2015-04-28 14:57:02 +08:00
<div class="cl"></div>
<p>
<label>&nbsp;&nbsp;&nbsp;开发项目
<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>
<p>
<span style="float: left;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>
<a href="javascript:" class="tijiao" onclick="submit_homework_form();">
<%= l(:label_button_ok) %>
</a>
<a href="javascript:history.back()" class="tijiao">取&nbsp;&nbsp;消</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>