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

41 lines
1.6 KiB
Plaintext
Raw Normal View History

<%= render_flash_messages %>
2013-09-13 21:52:24 +08:00
<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" %>
2013-11-16 11:09:10 +08:00
<% 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>
2013-09-13 21:52:24 +08:00
</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_course_new_homework),new_homework_attach_path %>
<strong style="color: #a9a9a9">&nbsp;&nbsp;(每一个作业都可以是一个精美的作品)</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>