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

41 lines
1.7 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| %>
2013-11-16 11:09:10 +08:00
<fieldset>
<legend>
<%= l(:label_attachment_plural) %>
</legend>
<p id="put-bid-form-partial">
<%= 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 %>
<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'>
<%= link_to l(:label_commit_homework), new_submit_homework_path, :onclick => "$('#put-bid-form').slideToggle(); this.blur(); return false;" %>
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>