|
|
|
@ -1,75 +1,103 @@
|
|
|
|
|
<!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()
|
|
|
|
|
{
|
|
|
|
|
$('#edit_homework_attach_<%= @homework.id%>').submit();
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
</head>
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
function switchTab(ProTag) {
|
|
|
|
|
var display_index = 3 - ProTag;
|
|
|
|
|
$("#tab" + ProTag).attr("class","selected");
|
|
|
|
|
$("#tab" + display_index).attr("class","");
|
|
|
|
|
$("#content" + ProTag).show();
|
|
|
|
|
$("#content" + display_index).hide();
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<body>
|
|
|
|
|
<div class="container">
|
|
|
|
|
<div class="Newwork">
|
|
|
|
|
<div id="tb_" class="tb_">
|
|
|
|
|
<ul>
|
|
|
|
|
<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>
|
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
<p style="font-weight: bold; color: rgb(237,137,36)" xmlns="http://www.w3.org/1999/html"> <%=raw l(:label_edit_homework)%> </p>
|
|
|
|
|
<div class="tabs">
|
|
|
|
|
<ul>
|
|
|
|
|
<li>
|
|
|
|
|
<a id = "tab1" href="#" class = "selected" onclick="switchTab(1);this.blur();return false;">
|
|
|
|
|
<%= l(:label_information_plural) %>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<a id="tab2" href="#" onclick="switchTab(2); this.blur(); return false;">
|
|
|
|
|
<%= l(:label_member_plural) %>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="box" id="content1">
|
|
|
|
|
<%= form_for(@homework) do |f|%>
|
|
|
|
|
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
|
|
|
|
|
<strong>标 题 <span style="color: red">*</span>:</strong>
|
|
|
|
|
<%= f.text_field :name, :required => true, :name => "homework_name", :size => 60, :style => "width:490px;", :maxlength => 254%>
|
|
|
|
|
</p>
|
|
|
|
|
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
|
|
|
|
|
<strong>提交项目 :</strong>
|
|
|
|
|
<% if @homework.project.nil? %>
|
|
|
|
|
<%= f.select :project_id, options_for_select(user_projects_option),:name => "project_id", :required => true%>
|
|
|
|
|
<% else %>
|
|
|
|
|
<%= f.select :project_id, options_for_select(user_projects_option,@homework.project.id),:name => "project_id", :required => true%>
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
<%= link_to '创建项目', new_project_path(course: 0, project_type: 0), :target => '_blank' %>
|
|
|
|
|
<p class="font_lighter" style="padding-left:120px;clear:left;">提交项目可以为空</p>
|
|
|
|
|
</p>
|
|
|
|
|
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
|
|
|
|
|
<strong style="vertical-align: top">描 述 :</strong>
|
|
|
|
|
<span style="margin-left:-10px;padding-right: 20px;">
|
|
|
|
|
<%= f.text_area :description, :rows => 8, :name => "homework_description", :class => 'wiki-edit', :maxlength => 3000, :style => "font-size:small;width:490px;margin-left:10px;" %>
|
|
|
|
|
</span>
|
|
|
|
|
</p>
|
|
|
|
|
<p style="padding-left: 60px">
|
|
|
|
|
<fieldset style="text-align: left;">
|
|
|
|
|
<p style="padding-left: 60px">
|
|
|
|
|
<% options = {:author => true, :deletable => attach_delete(@homework)} %>
|
|
|
|
|
<%= render :partial => 'attachments/links',
|
|
|
|
|
:locals => {:attachments => @homework.attachments, :options => options} %>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="content1">
|
|
|
|
|
<div class="N_con">
|
|
|
|
|
<%= form_for(@homework) do |f|%>
|
|
|
|
|
<p>
|
|
|
|
|
<label><span class="c_red">*</span> 作品名称 :</label>
|
|
|
|
|
<%= f.text_field :name, :required => true, :name => "homework_name", :class => "w430 bo", :maxlength => 254, :placeholder => "作品名称"%>
|
|
|
|
|
</p>
|
|
|
|
|
<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>
|
|
|
|
|
<p>
|
|
|
|
|
<label style="float:left;">
|
|
|
|
|
<span class="c_red">*</span>
|
|
|
|
|
作业描述 :
|
|
|
|
|
</label>
|
|
|
|
|
<%= f.text_area :description, :rows => 8, :name => "homework_description", :class => "w620",
|
|
|
|
|
:maxlength => 3000, :placeholder => "最多3000个汉字" %>
|
|
|
|
|
</p>
|
|
|
|
|
<legend>
|
|
|
|
|
<%= l(:label_attachment_plural) %>
|
|
|
|
|
</legend>
|
|
|
|
|
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
|
|
|
|
|
<%= render :partial => 'attachments/form' %>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<p>
|
|
|
|
|
<label style="float: left;"> 添加附件 :</label>
|
|
|
|
|
<%#= render :partial => 'attachments/form' %>
|
|
|
|
|
<p style=" padding: 3px 0 3px 0;padding-left: 90px;">
|
|
|
|
|
<% options = {:author => true, :deletable => attach_delete(@homework)} %>
|
|
|
|
|
<%= render :partial => 'attachments/links',
|
|
|
|
|
:locals => {:attachments => @homework.attachments, :options => options} %>
|
|
|
|
|
</p>
|
|
|
|
|
<p style=" padding: 3px 0 3px 0;padding-left: 90px;">
|
|
|
|
|
<%= render :partial => 'attachments/form' %>
|
|
|
|
|
</p>
|
|
|
|
|
</p>
|
|
|
|
|
</fieldset>
|
|
|
|
|
</p>
|
|
|
|
|
<p style="padding-left: 60px;padding-top: 10px;">
|
|
|
|
|
<span >
|
|
|
|
|
<%= submit_tag t(:label_button_ok), :sta => 0, :class => "enterprise"%>
|
|
|
|
|
</span>
|
|
|
|
|
</p>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="content2" style="display: none" >
|
|
|
|
|
<%= render :partial => "homework_member",:locals => {:members => @members,:hoemwork_users =>@hoemwork_users,:homework => @homework} %>
|
|
|
|
|
</div>
|
|
|
|
|
<p>
|
|
|
|
|
<span style="float: left;">
|
|
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
<a href="#" class="tijiao" onclick="submit_homework_form();">
|
|
|
|
|
<%= 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>
|
|
|
|
|