<% if bids.blank? %> <%#= l(:label_uncommit_homework) %> 暂无作业! <% else %> <% bids.each do |bid|%>
<%= link_to(image_tag(url_to_avatar(bid.author), :class => 'avatar'), user_path(bid.author), :class => "avatar") %>
<%= link_to(bid.author.lastname+bid.author.firstname, user_path(bid.author)) %> <%= l(:label_user_create_project_homework) %> <%= link_to(bid.name, respond_path(bid), :class => 'bid_path') %> <% if(User.current.logged? && (!Member.where('user_id = ? and course_id = ?', User.current.id, bid.courses.first.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0)) %> <%# 提交作业按钮 %> <% cur_user_homework = cur_user_homework_for_bid(bid) %> <% if cur_user_homework!= nil && cur_user_homework.count == 0 %> <%= link_to l(:label_commit_homework),new_homework_attach_path(bid) %> <% else %> <%= l(:lable_has_commit_homework)%> <% end %> <% end %> <% if (User.current.admin?||User.current.id==bid.author_id) %> <%= link_to( l(:button_edit), {:action => 'edit', :controller=>'bids', :course_id =>@course.id, :bid_id => bid.id}, :class => 'icon icon-edit' ) %> <%= link_to( l(:button_delete), {:action => 'homework_destroy', :controller=>'bids', :course_id => bid.id}, :method => :post, :data => {:confirm => l(:text_are_you_sure)}, :class => 'icon icon-del' ) %> <% end %>
<% bidding_project = bid.biding_projects.all temp = [] bidding_project.each do |pro| if pro.project && pro.project.project_status temp << pro end temp end %> <% if bid.homework_type == 1%> <%= l(:label_x_homework_project, :count => bid.homeworks.count) %>(<%= link_to bid.homeworks.count, course_for_bid_path(bid.id) %>) <% else %> <%= l(:label_x_homework_project, :count => temp.count) %>(<%= link_to temp.count, course_for_bid_path(bid.id) %>) <% end %> <%= l(:label_x_responses, :count => bid.commit) %>(<%= link_to bid.commit, respond_path(bid) %>) <% if betweentime(bid.deadline) < 0 %> <%= l(:label_commit_limit)%> <% else %> <% if betweentime(bid.deadline) < 3 %> <%= l(:label_commit_ar) %> <% else %> <% end %> <% end %>
<% if bid.reward_type.nil? or bid.reward_type == 1 %> <%= l(:label_bids_reward_method) %><%= l(:label_call_bonus) %> <%= l(:label_RMB_sign) %> <%= bid.budget%> <% elsif bid.reward_type == 2 %> <%= l(:label_bids_reward_method) %><%= bid.budget%> <% else %> <% end %>
<%#= bid.description %> <%= textilizable bid, :description %>
<%= l(:label_create_time) %> :  <%=format_time bid.created_on %> <%= l(:field_deadline) %> :  <%=bid.deadline %>
<% end %> <% end %>