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

41 lines
1.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;
}
</script>
</div>
<% if User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0) %>
<div class='icon icon-add'>
<%= link_to l(:label_commit_homework), new_submit_homework_path, :onclick => "$('#put-bid-form').slideToggle(); this.blur(); return false;" %>
</div>
<% end %>
<% if @homework_list.empty? %>
<div class="font_lighter_sidebar" style="padding-left: 10px">
暂无学生提交作业!
</div>
<% end %>
<div id='bidding_project_list'>
<%= render :partial => 'homework_list', :locals => {:homework => @homework_list} %>
</div>