socialforge/app/views/bids/_homework.html.erb

70 lines
2.7 KiB
Plaintext

<%= render_flash_messages %>
<div id="put-bid-form" style="display: none">
<%= form_for HomeworkAttach.new, :url => {:controller => 'bids', :action => 'add_homework'}, :update => "bidding_project_list", :complete => '$("#put-bid-form").hide();', :html => {:multipart => true, :id => 'add_homework_form'} do |f| %>
<fieldset>
<legend>
<%= l(:label_attachment_plural) %>
</legend>
<p id="put-bid-form-partial">
<%= render :partial => 'attachments/form' %>
</p>
</fieldset>
<%= submit_tag l(:button_create), :onclick => "return true" %>
<% end %>
<script type="text/javascript">
function j_submit () {
alert('start');
var submit_homework = function(){
$('#add_homework_form').clone().attr('action', '<%= url_for({:controller => "bids", :action => "add_homework"})+".js" %>').ajaxSubmit()
};
alert('stop');
$.globalEval(submit_homework());
return false;
}
function show()
{
$("#what_is_project_div").slideToggle();
}
</script>
</div>
<% if User.current.logged? && User.current.member_of_course?(@bid.courses.first) && cur_user_homework_for_bid(@bid).count == 0 && is_cur_course_student(@bid.courses.first) %>
<div class='icon icon-add'>
<%#= link_to l(:label_commit_homework), new_submit_homework_path, :onclick => "$('#put-bid-form').slideToggle(); this.blur(); return false;" %>
<%= link_to l(:label_course_new_homework),new_homework_attach_path %><strong style="color: #a9a9a9">&nbsp;&nbsp;(每一个作业都可以是一个精美的作品)</strong>
</div>
<% end %>
<table style="width: 100%">
<tr>
<td style="width: 50%">
<% if @homework_list.empty? %>
<div class="font_lighter_sidebar" style="padding-left: 10px;">
<span>暂无学生提交作业!</span>
</div>
<% end %>
</td>
<td style="width: 50%">
<div class="font_lighter_sidebar" style="padding-left: 200px;">
<strong><a href="#" onclick="show()" style="color:#919294;">什么是项目?</a></strong>
</div>
</td>
</tr>
<tr>
<td style="width: 50%">
</td>
<td style="width: 50%">
<div id = "what_is_project_div" style="display: none">
<p>项目是一种由用户创建的基于网络的协作空间,能够为个人或小组提供分布式的协同交流和资料管理等方面的支持。</p>
<p>项目托管平台:<a href="http://forge.trustie.net/">http://forge.trustie.net/</a> </p>
<%= link_to "我要创建项目",new_project_path(course: 0, project_type: 0), :target => '_blank'%>
</div>
</td>
</tr>
</table>
<div id='bidding_project_list'>
<%= render :partial => 'homework_list', :locals => {:homework => @homework_list} %>
</div>