修正作业数显示不一致问题

This commit is contained in:
z9hang 2014-05-14 17:05:51 +08:00
parent 5649cc545e
commit a19a1b74a7
1 changed files with 12 additions and 3 deletions

View File

@ -35,10 +35,19 @@
</tr>
<tr>
<td colspan="2"><span class="font_lighter">
<% if bid.homework_type == 1%>
<%= l(:label_x_homework_project, :count => bid.homeworks.count) %>(<strong><%= link_to bid.homeworks.count, project_for_bid_path(bid.id) %></strong>)
<% @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 => @temp.count) %>(<strong><%= link_to @temp.count, project_for_bid_path(bid.id) %></strong>)
<% else %>
<%= l(:label_x_homework_project, :count => bid.biding_projects.count) %>(<strong><%= link_to bid.biding_projects.count, project_for_bid_path(bid.id) %></strong>)
<%= l(:label_x_homework_project, :count => @temp.count) %>(<strong><%= link_to @temp.count, project_for_bid_path(bid.id) %></strong>)
<% end %></span>
<span class="font_lighter"><%= l(:label_x_responses, :count => bid.commit) %>(<strong><%= link_to bid.commit, respond_path(bid) %></strong>)</span>
<span style="float: right">