1.add special reward

2.give a root controller in bid controller && give the administrator the root can change the reward who is deadine.
This commit is contained in:
xianbo 2013-10-24 20:36:57 +08:00
parent 2fa6276829
commit a50aff3fb4
6 changed files with 46 additions and 33 deletions

View File

@ -629,7 +629,7 @@ class BidsController < ApplicationController
@b_p = nil
@biding_project_id = nil
if params[:set_reward][:reward]
if params[:set_reward][:reward]&&((User.current.id==@bid.author_id)||User.current.admin)
# @bid_id = params[:id]
@biding_project_id = params[:set_reward][:b_id]
@b_p = BidingProject.find_by_id(@biding_project_id)

View File

@ -22,7 +22,7 @@
<!-- 如果需求到期 并且是该需求的管理员 -->
<td style="color: red;" align="right" valign="0.1em" width="16%">
<strong><span id="reward_result_<%=b_project.id%>">
<strong><span id="reward_result_<%=b_project.id%>"> <!-- 调用js进行刷新 -->
<%= l(:label_system_grade) %>:<%= (b_project.project.project_status.grade.nil? ? 0 : b_project.project.project_status.grade) unless (b_project.project.project_status.nil? && b_project.project.nil?) %>
<% if get_prize(b_project).nil? or get_prize(b_project) == "" %>
<% if @bid.deadline < Date.today %>
@ -41,6 +41,8 @@
<% end %>
<% when 2 %>
<% case get_prize(b_project) %>
<% when '-1' %>
<%= image_tag("/images/bid/special_reward.png")%>
<% when '0' %>
<%= image_tag("/images/bid/first_reward.png")%>
<% when '1' %>
@ -84,7 +86,7 @@
</td>
<!-- 评价显隐控制按钮-->
<% if User.current.id == @bid.author_id && @bid.deadline > Date.today %>
<% if ((User.current.id == @bid.author_id) && (@bid.deadline > Date.today))||User.current.admin %>
<td valign="top" align="right" width="10%">
<span> <%= toggle_link '评价', b_project.id.to_s %></span>
<!-- 评价应标项目的表单 -->
@ -97,7 +99,7 @@
<%= f.select :reward,"<option value = '6'>中标</option> <option value = '7'>备选</option> <option value = '8'>淘汰</option>"
.html_safe %>
<% when 2 %>
<%= f.select :reward,"<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>"
<%= 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>"
.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>

View File

@ -17,6 +17,9 @@ else
end
when 2
case get_prize(@b_p)
when '-1'
image_tag("/images/bid/s_reward.png")
when '1'
when '0'
image_tag("/images/bid/first_reward.png")
when '1'

View File

@ -1,10 +1,14 @@
<ul>
<% if !@time_entry.nil? -%>
<li><%= context_menu_link l(:button_edit), {:controller => 'timelog', :action => 'edit', :id => @time_entry},
:class => 'icon-edit', :disabled => !@can[:edit] %></li>
<li>
<%= context_menu_link l(:button_edit), {:controller => 'timelog', :action => 'edit', :id => @time_entry},
:class => 'icon-edit', :disabled => !@can[:edit] %>
</li>
<% else %>
<li><%= context_menu_link l(:button_edit), {:controller => 'timelog', :action => 'bulk_edit', :ids => @time_entries.collect(&:id)},
:class => 'icon-edit', :disabled => !@can[:edit] %></li>
<li>
<%= context_menu_link l(:button_edit), {:controller => 'timelog', :action => 'bulk_edit', :ids => @time_entries.collect(&:id)},
:class => 'icon-edit', :disabled => !@can[:edit] %>
</li>
<% end %>
<%= call_hook(:view_time_entries_context_menu_start, {:time_entries => @time_entries, :can => @can, :back => @back }) %>
@ -14,11 +18,15 @@
<a href="#" class="submenu"><%= l(:field_activity) %></a>
<ul>
<% @activities.each do |u| -%>
<li><%= context_menu_link h(u.name), {:controller => 'timelog', :action => 'bulk_update', :ids => @time_entries.collect(&:id), :time_entry => {'activity_id' => u}, :back_url => @back}, :method => :post,
:selected => (@time_entry && u == @time_entry.activity), :disabled => !@can[:edit] %></li>
<li>
<%= context_menu_link h(u.name), {:controller => 'timelog', :action => 'bulk_update', :ids => @time_entries.collect(&:id), :time_entry => {'activity_id' => u}, :back_url => @back}, :method => :post,
:selected => (@time_entry && u == @time_entry.activity), :disabled => !@can[:edit] %>
</li>
<% end -%>
<li><%= context_menu_link l(:label_none), {:controller => 'timelog', :action => 'bulk_update', :ids => @time_entries.collect(&:id), :time_entry => {'activity_id' => 'none'}, :back_url => @back}, :method => :post,
:selected => (@time_entry && @time_entry.activity.nil?), :disabled => !@can[:edit] %></li>
<li>
<%= context_menu_link l(:label_none), {:controller => 'timelog', :action => 'bulk_update', :ids => @time_entries.collect(&:id), :time_entry => {'activity_id' => 'none'}, :back_url => @back}, :method => :post,
:selected => (@time_entry && @time_entry.activity.nil?), :disabled => !@can[:edit] %>
</li>
</ul>
</li>
<% end %>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB