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

23 lines
1.1 KiB
Plaintext

<div id="put-bid-form" style="display: none">
<%= form_for "bid_for_save", :remote=>true, :url => {:controller => 'bids', :action => 'add_homework'},
:update => "bidding_project_list",
:complete => '$("#put-bid-form").hide();' do |f| %>
<fieldset><legend><%= l(:label_attachment_plural) %></legend>
<p><%= render :partial => 'attachments/form', :locals => {:container => @homework} %></p>
</fieldset>
<%= submit_tag l(:button_create) %>
<% end %>
</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'>
<%= toggle_link l(:label_commit_homework), 'put-bid-form' %>
</div>
<% elsif @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>