2013-12-19 15:59:10 +08:00
|
|
|
<%= render_flash_messages %>
|
2013-09-13 21:52:24 +08:00
|
|
|
<div id="put-bid-form" style="display: none">
|
2013-12-19 15:59:10 +08:00
|
|
|
<%= 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| %>
|
2014-10-30 15:12:45 +08:00
|
|
|
<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" %>
|
2013-11-16 11:09:10 +08:00
|
|
|
<% end %>
|
2013-12-19 15:59:10 +08:00
|
|
|
<script type="text/javascript">
|
|
|
|
function j_submit () {
|
2014-06-04 09:55:38 +08:00
|
|
|
alert('start');
|
2013-12-19 15:59:10 +08:00
|
|
|
var submit_homework = function(){
|
|
|
|
$('#add_homework_form').clone().attr('action', '<%= url_for({:controller => "bids", :action => "add_homework"})+".js" %>').ajaxSubmit()
|
|
|
|
};
|
2014-06-04 09:55:38 +08:00
|
|
|
alert('stop');
|
2013-12-19 15:59:10 +08:00
|
|
|
$.globalEval(submit_homework());
|
|
|
|
return false;
|
|
|
|
}
|
2014-06-20 10:52:34 +08:00
|
|
|
|
|
|
|
function show()
|
|
|
|
{
|
|
|
|
$("#what_is_project_div").slideToggle();
|
|
|
|
}
|
2013-12-19 15:59:10 +08:00
|
|
|
</script>
|
2013-09-13 21:52:24 +08:00
|
|
|
</div>
|
2014-06-26 17:49:23 +08:00
|
|
|
<% 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) %>
|
2014-10-30 15:12:45 +08:00
|
|
|
<div class='icon icon-add'>
|
|
|
|
<%= link_to l(:label_course_new_homework),new_homework_attach_path %>
|
|
|
|
<strong style="color: #a9a9a9"> (每一个作业都可以是一个精美的作品)</strong>
|
|
|
|
</div>
|
2013-11-16 11:09:10 +08:00
|
|
|
<% end %>
|
|
|
|
|
2013-09-13 21:52:24 +08:00
|
|
|
<div id='bidding_project_list'>
|
|
|
|
<%= render :partial => 'homework_list', :locals => {:homework => @homework_list} %>
|
|
|
|
</div>
|