@ -5,94 +5,147 @@
<% else %>
<% else %>
<% bids.each do |bid|%>
<% bids.each do |bid|%>
<table class="content-text-list">
<table class="content-text-list">
<tr><td colspan="2" valign="top" width="50" ><%= link_to(image_tag(url_to_avatar(bid.author), :class => 'avatar'), user_path(bid.author), :class => "avatar") %></td>
<tr>
<td>
<td colspan="2" valign="top" width="50" >
<table width="580px" border="0">
<%= link_to(image_tag(url_to_avatar(bid.author), :class => 'avatar'), user_path(bid.author), :class => "avatar") %>
<tr>
</td>
<td colspan="2" valign="top"><strong><%= link_to(bid.author.lastname+bid.author.firstname, user_path(bid.author)) %></strong>
<td>
<span class="font_lighter"><%= l(:label_user_create_project_homework) %></span>
<table width="580px" border="0">
<span><%= link_to(bid.name, course_for_bid_path(bid), :class => 'bid_path') %></span>
<tr>
<span style="float: right">
<td colspan="2" valign="top">
<% 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)) %>
<strong>
<%# 提交作业按钮 %>
<%= link_to(bid.author.lastname+bid.author.firstname, user_path(bid.author)) %>
<!--<%#= link_to l(:label_commit_homework), '#OpenWindow', rel: 'leanModal', onclick: "showSubH(#{bid.id}, '#{bid.name}');" if User.current.member_of?(@course) %>-->
</strong>
<% cur_user_homework = cur_user_homework_for_bid(bid) %>
<span class="font_lighter">
<% if cur_user_homework!= nil && cur_user_homework.count == 0 %>
<%= l(:label_user_create_project_homework) %>
<%= link_to l(:label_commit_homework),new_homework_attach_path(bid) %>
</span>
<% else %>
<span>
<span style="color: green; float: right"><%= l(:lable_has_commit_homework)%></span>
<%= link_to(bid.name, course_for_bid_path(bid), :class => 'bid_path') %>
<% end %>
</span>
<% end %>
<span style="float: right">
<% if (User.current.admin?||User.current.id==bid.author_id) %>
<% 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)) %>
<%= link_to(
<% cur_user_homework = cur_user_homework_for_bid(bid) %>
l(:button_edit),
<% if cur_user_homework!= nil && cur_user_homework.count == 0 %>
{:action => 'edit', :controller=>'bids', :course_id =>@course.id, :bid_id => bid.id},
<%= link_to l(:label_commit_homework),new_homework_attach_path(bid) %>
:class => 'icon icon-edit'
<% else %>
) %>
<span style="color: green; float: right">
<%= link_to(
<%= l(:lable_has_commit_homework)%>
l(:button_delete),
</span>
{:action => 'homework_destroy', :controller=>'bids', :course_id => bid.id},
<% end %>
:method => :post,
<% end %>
:data => {:confirm => l(:text_are_you_sure)},
<% if (User.current.admin?||User.current.id==bid.author_id) %>
:class => 'icon icon-del'
<%= link_to(
) %></span>
l(:button_edit),
<% end %>
{:action => 'edit', :controller=>'bids', :course_id =>@course.id, :bid_id => bid.id},
</td>
:class => 'icon icon-edit'
</tr>
) %>
<tr>
<%#= link_to(
<td colspan="2"><span class="font_lighter">
l(:button_delete),
<% bidding_project = bid.biding_projects.all
{:action => 'homework_destroy', :controller=>'bids', :course_id => bid.id},
temp = []
:method => :post,
bidding_project.each do |pro|
:data => {:confirm => l(:text_are_you_sure)},
if pro.project && pro.project.project_status
:class => 'icon icon-del'
temp << pro
) %>
end
<% end %>
temp
</span>
end
</td>
%>
</tr>
<% if bid.homework_type == 1%>
<tr>
<%= l(:label_x_homework_project, :count => bid.homeworks.count) %>(<strong><%= link_to bid.homeworks.count, course_for_bid_path(bid.id) %></strong>)
<td colspan="2">
<% else %>
<span class="font_lighter">
<%= l(:label_x_homework_project, :count => temp.count) %>(<strong><%= link_to temp.count, course_for_bid_path(bid.id) %></strong>)
<% bidding_project = bid.biding_projects.all
<% end %></span>
temp = []
<span class="font_lighter"><%= l(:label_x_responses, :count => bid.commit) %>(<strong><%= bid.commit %></strong>)</span>
bidding_project.each do |pro|
<span style="float: right">
if pro.project && pro.project.project_status
<% if betweentime(bid.deadline) < 0 %>
temp << pro
<span style="color: red; float: right"><%= l(:label_commit_limit)%></span>
end
<% else %>
temp
<% if betweentime(bid.deadline) < 3 %>
end
<span style="color: red"><%= l(:label_commit_ar) %></span>
%>
<% else %>
<% if bid.homework_type == 1%>
<% end %>
<%= l(:label_x_homework_project, :count => bid.homeworks.count) %>
(
<strong>
<% end %> </span>
<%= link_to bid.homeworks.count, course_for_bid_path(bid.id) %>
</td>
</strong>)
</tr>
<% else %>
<tr>
<%= l(:label_x_homework_project, :count => temp.count) %>
<td colspan="2"> <% if bid.reward_type.nil? or bid.reward_type == 1 %> <strong><%= l(:label_bids_reward_method) %><span style="color: #ed8924;font-family: 14px; font-family: '微软雅黑'"><%= l(:label_call_bonus) %> <%= l(:label_RMB_sign) %>
(
<%= bid.budget%></span></strong> <% elsif bid.reward_type == 2 %> <strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family:' 微软雅黑'"><%= bid.budget%></span></strong>
<strong>
<% else %>
<%= link_to temp.count, course_for_bid_path(bid.id) %>
</strong>)
<% end %> <!-- <td style="color: rgb(255, 0, 0);"><strong><%#= l(:label_price) %><%#= l(:label_RMB_sign) %><%#= bid.budget%></strong></td> --></td>
<% end %>
</tr>
</span>
<tr>
<span class="font_lighter">
<td colspan="2" width="580px" ><span class="font_description">
<%= l(:label_x_responses, :count => bid.commit) %>
<%#= bid.description %>
(
<%= textilizable bid, :description %>
<strong>
</span></td>
<%= bid.commit %>
</tr>
</strong>
<tr>
)
</span>
<span style="float: right">
<% if betweentime(bid.deadline) < 0 %>
<span style="color: red; float: right">
<%= l(:label_commit_limit)%>
</span>
<% else %>
<% if betweentime(bid.deadline) < 3 %>
<span style="color: red">
<%= l(:label_commit_ar) %>
</span>
<% end %>
<% end %>
</span>
</td>
</tr>
<tr>
<td colspan="2">
<% if bid.reward_type.nil? or bid.reward_type == 1 %>
<strong>
<%= l(:label_bids_reward_method) %>
<span style="color: #ed8924;font-family: 14px; font-family: '微软雅黑'">
<%= l(:label_call_bonus) %>
<%= l(:label_RMB_sign) %>
<%= bid.budget%>
</span>
</strong>
<% elsif bid.reward_type == 2 %>
<strong>
<%= l(:label_bids_reward_method) %>
<span style="color: #15bccf;font-family: 14px; font-family:' 微软雅黑'">
<%= bid.budget%>
</span>
</strong>
<% end %> <!-- <td style="color: rgb(255, 0, 0);"><strong><%#= l(:label_price) %><%#= l(:label_RMB_sign) %><%#= bid.budget%></strong></td> -->
</td>
</tr>
<tr>
<td colspan="2" width="580px" >
<span class="font_description">
<%= textilizable bid, :description %>
</span>
</td>
</tr>
<tr>
<td style="text-align: left">
<td style="text-align: left">
<span class="font_lighter">
<span class="font_lighter">
<%= l(:label_create_time) %> : <%=format_time bid.created_on %></span><span style="float: right"> <%= l(:field_deadline) %> : <%=bid.deadline %>
<%= l(:label_create_time) %>
</span></td>
:
<%=format_time bid.created_on %>
</span>
<span style="float: right">
<%= l(:field_deadline) %>
:
<%=bid.deadline %>
</span>
</td>
<td></td>
<td></td>
</tr>
</tr>
</table></td>
</table></td>
</tr>
</tr>
</table>
</table>
<% end %>
<% end %>
<% end %>
<% end %>
<div class="pagination">
<div class="pagination">