2013-11-04 21:58:40 +08:00
<% if @bid.reward_type == 3%>
2013-10-31 21:44:10 +08:00
<%= form_tag(:controller => 'bids', :action => "show_project", :method => :get) do %>
<div class="project-search-block">
<table width="100%" valign="center">
<tr>
2013-12-17 20:49:23 +08:00
<td width="16%"><span style="margin-left:0px"><%= l(:label_task_plural)%></span></td>
2013-10-31 21:44:10 +08:00
<td align="right">
<div class="project-search">
<%= text_field_tag 'student_id', params[:student_id], :size => 30 %>
<%= submit_tag l(:label_search_by_student_id), :class => "small", :name => nil %>
</div></td>
</tr>
</table>
</div>
<% end %>
2013-11-04 21:58:40 +08:00
<% end %>
2013-09-23 20:19:42 +08:00
<% bidding_project.each do |b_project|%>
2013-10-30 10:45:37 +08:00
<% if b_project.project %>
2013-09-23 20:19:42 +08:00
<table width="90%" border="0" align='center'>
<tr>
<td>
<table width="660px" border="0" align='center'>
<tr>
<td width="50px" valign="top" colspan="2" align="middle">
<div style="width: 50px; height: 50px;">
2013-11-01 15:48:23 +08:00
<%= image_tag(url_to_avatar(b_project.project), :class => 'avatar3') %>
2013-10-21 09:42:09 +08:00
2013-09-23 20:19:42 +08:00
</div></td>
2013-09-28 10:00:40 +08:00
<td width="65%" valign="top">
2013-09-23 20:19:42 +08:00
<table width="100%" valign="top">
<tr>
2013-09-28 10:00:40 +08:00
<td colspan="2" valign="top" width="50%"><strong>
2013-09-23 20:19:42 +08:00
<%= link_to(b_project.project.name, project_path(b_project.project)) %>
2013-10-21 09:42:09 +08:00
2013-12-19 19:54:39 +08:00
</strong><span class="font_lighter">
2013-12-17 20:49:23 +08:00
<% if @bid.reward_type == 2 %>
2013-12-19 19:54:39 +08:00
<%= l(:label_joined_contest)%>
2013-12-17 20:49:23 +08:00
<% end %>
<% if @bid.reward_type == 1 %>
<%= l(:label_join_bidding)%>
<% end %>
2013-12-19 19:54:39 +08:00
</span>
2013-09-23 20:19:42 +08:00
</td>
<!-- 如果需求到期 并且是该需求的管理员 -->
2013-11-06 16:43:07 +08:00
<td style="color: #ec6300;" align="right" valign="0.1em" width="16%">
2013-10-24 20:36:57 +08:00
<strong><span id="reward_result_<%=b_project.id%>"> <!-- 调用js进行刷新 -->
2013-10-31 21:44:10 +08:00
<%= l(:label_system_grade) %>:<%= (b_project.project.project_status.nil? ? 0.0 : b_project.project.project_status.grade) unless (b_project.project.project_status.nil? && b_project.project.nil?) %>
2013-09-23 20:19:42 +08:00
<% if get_prize(b_project).nil? or get_prize(b_project) == "" %>
2013-09-29 19:58:57 +08:00
<% if @bid.deadline < Date.today %>
2013-10-19 15:39:53 +08:00
<%= l(:label_noawards)%>
2013-09-29 19:58:57 +08:00
<% end %>
2013-09-23 20:19:42 +08:00
<% else %>
2013-09-29 19:58:57 +08:00
<% case @bid.reward_type %>
<% when 1 %>
<% case get_prize(b_project) %>
<% when '6' %>
<%= image_tag("/images/bid/win_bid.png")%>
<% when '7' %>
<%= image_tag("/images/bid/candidate.png")%>
<% when '8' %>
<%= image_tag("/images/bid/obsolete.png")%>
<% end %>
<% when 2 %>
<% case get_prize(b_project) %>
2013-10-24 20:36:57 +08:00
<% when '-1' %>
<%= image_tag("/images/bid/special_reward.png")%>
2013-09-29 19:58:57 +08:00
<% when '0' %>
<%= image_tag("/images/bid/first_reward.png")%>
<% when '1' %>
<%= image_tag("/images/bid/second_reward.png")%>
<% when '2' %>
<%= image_tag("/images/bid/third_reward.png")%>
<% when '3' %>
<%= image_tag("/images/bid/forth_reward.png")%>
<% when '4' %>
<%= image_tag("/images/bid/fifth_reward.png")%>
<% when '5' %>
<%= image_tag("/images/bid/qualified.png")%>
<% end %>
<% when 3 %>
<% case get_prize(b_project) %>
<% when '10' %>
<%= image_tag("/images/bid/A.jpg")%>
<% when '11' %>
<%= image_tag("/images/bid/B+.jpg")%>
<% when '12' %>
<%= image_tag("/images/bid/B.jpg")%>
<% when '13' %>
<%= image_tag("/images/bid/C+.jpg")%>
<% when '14' %>
<%= image_tag("/images/bid/C.jpg")%>
<% when '15' %>
<%= image_tag("/images/bid/D+.jpg")%>
<% when '16' %>
<%= image_tag("/images/bid/D.jpg")%>
<% when '17' %>
<%= image_tag("/images/bid/E+.png")%>
<% when '18' %>
<%= image_tag("/images/bid/E.png")%>
<% when '19' %>
<%= image_tag("/images/bid/F.jpg")%>
<% end %>
<% end %>
2013-09-23 20:19:42 +08:00
<% end %>
2013-09-29 19:58:57 +08:00
2013-09-23 20:19:42 +08:00
</span></strong>
</td>
<!-- 评价显隐控制按钮-->
2013-10-24 20:36:57 +08:00
<% if ((User.current.id == @bid.author_id) && (@bid.deadline > Date.today))||User.current.admin %>
2013-09-28 10:00:40 +08:00
<td valign="top" align="right" width="10%">
2013-09-23 20:19:42 +08:00
<span> <%= toggle_link '评价', b_project.id.to_s %></span>
2013-09-28 10:00:40 +08:00
<!-- 评价应标项目的表单 -->
<span style="display: none; vertical-align: top " id = '<%= b_project.id %>'>
<%= form_for "set_reward",:remote=>true,:url=>set_reward_path do |f| %>
<%= f.text_field :b_id,:style => "display:none",:value => b_project.id,:size=>"0" %>
2013-09-29 19:58:57 +08:00
<% case @bid.reward_type %>
<% when 1 %>
<%= f.select :reward,"<option value = '6'>中标</option> <option value = '7'>备选</option> <option value = '8'>淘汰</option>"
.html_safe %>
<% when 2 %>
2013-10-24 20:36:57 +08:00
<%= f.select :reward,"<option value = '-1'>#{l(:label_special_reward)}</option><option value = '0'>#{l(:label_first_reward)}</option> <option value = '1'>#{l(:label_second_reward)}</option> <option value = '2'>三等奖</option> <option value = '3'>四等奖</option> <option value = '4'>五等奖</option> <option value = '5'>#{l(:label_comfort_reward)}</option>"
2013-09-29 19:58:57 +08:00
.html_safe %>
<% when 3 %>
<%= f.select :reward,"<option value = '10'>A</option> <option value = '11'>B+</option> <option value = '12'>B</option> <option value = '13'>C+</option> <option value = '14'>C</option> <option value = '15'>D+</option>
<option value = '16'>D</option> <option value = '17'>E+</option> <option value = '18'>E</option> <option value = '19'>F</option>"
.html_safe %>
<% end %>
2013-09-28 10:00:40 +08:00
<%= f.submit "提交",:class=>"submit" %>
<% end %>
</span>
2013-09-23 20:19:42 +08:00
</td>
<% end %>
</tr>
<tr></tr>
<tr>
2013-09-28 10:00:40 +08:00
<td valign="top" width="50%" style=" word-wrap: break-word; word-break: break-all"><%= b_project.project.description %></td>
2013-09-23 20:19:42 +08:00
</tr>
<tr>
2013-10-16 10:53:11 +08:00
<td valign="top"><span class="font_lighter">
2013-12-17 20:49:23 +08:00
<%= format_time b_project.created_at%>
2013-10-16 10:53:11 +08:00
</span></td>
2013-09-23 20:19:42 +08:00
</tr>
2013-09-28 10:00:40 +08:00
</table>
</td>
2013-09-23 20:19:42 +08:00
<td width="30%">
<div class="bid-user-message" style="border-left: 1px solid rgb(225, 225, 225); margin-left: 20px; padding-left: 20px;">
<table width="100%">
2013-10-14 22:40:34 +08:00
<% if @bid.reward_type == 3 %>
2013-09-23 20:19:42 +08:00
<tr>
2013-12-17 16:01:46 +08:00
<td>
<% if (im_watching_student_id? @bid) && user.user_extensions.identity.to_i.eql?(1) %>
<%= l(:label_bidding_user_studentcode) %> : <%= b_project.user.user_extensions.student_id %>
<% end %>
</td>
2013-10-14 22:40:34 +08:00
</tr>
<tr>
2013-10-16 10:53:11 +08:00
<td><%= l(:label_bidding_user_homework) %> :
2013-11-06 11:10:26 +08:00
<% unless b_project.user.nil? %>
2013-09-29 19:46:59 +08:00
<%= link_to(b_project.user.lastname+b_project.user.firstname, user_path(b_project.user)) %>
2013-11-06 11:10:26 +08:00
<% end %>
2013-10-14 22:40:34 +08:00
</td>
2013-09-23 20:19:42 +08:00
</tr>
<tr>
2013-10-16 22:14:49 +08:00
<td style=" word-wrap: break-word; word-break: break-all"><%= l(:label_bidding_reason_homewrok) %> : <%= b_project.description %></td>
2013-09-23 20:19:42 +08:00
</tr>
2013-10-14 22:40:34 +08:00
<% else %>
<tr>
2013-12-17 20:49:23 +08:00
<td><strong>
<% if @bid.reward_type == 2%>
<%= l(:label_contest_user) %>
<% end %>
<% if @bid.reward_type == 1 %>
<%= l(:label_bidding_user) %>
<% end %>
2013-11-06 11:10:26 +08:00
<% unless b_project.user.nil? %>
<%= b_project.user.lastname %><%= b_project.user.firstname %>
2013-11-16 10:51:22 +08:00
<% end %></strong>
<!-- added by bai 加入学号 -->
2013-12-17 16:01:46 +08:00
<p><strong>
<% if (im_watching_student_id? @bid) && b_project.user.user_extensions.identity.to_i.eql?(1) %>
<%= l(:label_bidding_user_studentcode) %> : <%= b_project.user.user_extensions.student_id %>
<% end %>
</strong></p>
2013-10-14 22:40:34 +08:00
</td>
2013-11-16 10:51:22 +08:00
<!-- end -->
2013-10-14 22:40:34 +08:00
</tr>
<tr>
2013-12-17 20:49:23 +08:00
<td style=" word-wrap: break-word; word-break: break-all">
<% if @bid.reward_type == 2%>
<%= l(:label_contest_reason) %>
<% end %>
<% if @bid.reward_type == 1 %>
<%= l(:label_bidding_reason) %>
<% end %>
<%= b_project.description %></td>
2013-10-14 22:40:34 +08:00
</tr>
<% end %>
2013-09-23 20:19:42 +08:00
</table>
</div></td>
</tr>
</table></td>
</tr>
</table>
<% end %>
2013-10-30 10:45:37 +08:00
<% end %>
2013-09-23 20:19:42 +08:00