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

43 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();
}
window.onready = function()
{
<% if !@is_teacher && @homework_list.count > 0%>
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_attach/praise_alert') %>');
showModal('ajax-modal', '480px');
$('#ajax-modal').css('height','250px');
<% end %>
}
</script>
2013-09-13 21:52:24 +08:00
</div>
<div id='bidding_project_list'>
<%= render :partial => 'homework_list' %>
2013-09-13 21:52:24 +08:00
</div>