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

91 lines
4.1 KiB
Plaintext

<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>
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf">高校课程实践社区</td>
<td style="width: auto; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
</tr>
<tr>
<td style="padding-left: 8px"><a><%= link_to request.host()+"/courses", :controller => 'projects', :action => 'course'%></a></td>
<td><p class="top-content-list-homework"><%=link_to "主页", home_path %> > <%=link_to l(:label_course_practice), :controller => 'projects', :action => 'course' %> >
<span><%= link_to(@homework.bid.courses.first.name.to_s, homework_project_path(@homework.bid.courses.first)) if @homework.bid.courses.first%></span> >
<%=link_to(@homework.bid.name, respond_path(@homework.bid)) %> > <span><%= link_to "修改作业",edit_homework_attach_path(@homework)%></span></p></td>
</tr>
</table>
</div>
<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>标&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;题:</strong>&nbsp;
<%= f.text_field :name, :required => true, :name => "homework_name", :size => 60, :style => "width:490px;"%>
</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">描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述:</strong>&nbsp;
<span style="margin-left:-10px;padding-right: 20px;">
<%= f.text_area :description, :rows => 8, :name => "homework_description", :class => 'wiki-edit', :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} %>
</p>
<legend>
<%= l(:label_attachment_plural) %>
</legend>
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
<%= render :partial => 'attachments/form' %>
</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>