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| %>
|
2013-11-16 11:09:10 +08:00
|
|
|
<fieldset>
|
|
|
|
<legend>
|
|
|
|
<%= l(:label_attachment_plural) %>
|
|
|
|
</legend>
|
2013-12-16 14:39:02 +08:00
|
|
|
<p id="put-bid-form-partial">
|
2013-12-19 15:59:10 +08:00
|
|
|
<%= render :partial => 'attachments/form' %>
|
2013-11-16 11:09:10 +08:00
|
|
|
</p>
|
|
|
|
</fieldset>
|
2014-01-17 16:42:31 +08:00
|
|
|
<%= 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 () {
|
|
|
|
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>
|
2013-09-13 21:52:24 +08:00
|
|
|
</div>
|
2013-11-14 09:07:55 +08:00
|
|
|
<% 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) %>
|
2013-09-13 21:52:24 +08:00
|
|
|
<div class='icon icon-add'>
|
2014-05-29 20:02:02 +08:00
|
|
|
<!-- <%= 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 %>
|
2013-09-13 21:52:24 +08:00
|
|
|
</div>
|
2013-11-16 11:09:10 +08:00
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% if @homework_list.empty? %>
|
|
|
|
<div class="font_lighter_sidebar" style="padding-left: 10px">
|
|
|
|
暂无学生提交作业!
|
|
|
|
</div>
|
2013-09-23 08:44:48 +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>
|