diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb
index 557c0ae5..b1f0b987 100644
--- a/app/controllers/bids_controller.rb
+++ b/app/controllers/bids_controller.rb
@@ -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)
diff --git a/app/views/bids/_list_projects.html.erb b/app/views/bids/_list_projects.html.erb
index 74207a31..f54c6f98 100644
--- a/app/views/bids/_list_projects.html.erb
+++ b/app/views/bids/_list_projects.html.erb
@@ -22,7 +22,7 @@
-
+
<%= 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 @@
|
- <% 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 %>
<%= toggle_link '评价', b_project.id.to_s %>
@@ -97,7 +99,7 @@
<%= f.select :reward," "
.html_safe %>
<% when 2 %>
- <%= f.select :reward," "
+ <%= f.select :reward," "
.html_safe %>
<% when 3 %>
<%= f.select :reward,"
diff --git a/app/views/bids/set_reward.js.erb b/app/views/bids/set_reward.js.erb
index 868de83b..f3f20aa5 100644
--- a/app/views/bids/set_reward.js.erb
+++ b/app/views/bids/set_reward.js.erb
@@ -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'
diff --git a/app/views/context_menus/time_entries.html.erb b/app/views/context_menus/time_entries.html.erb
index 10dbcafd..fa2bd618 100644
--- a/app/views/context_menus/time_entries.html.erb
+++ b/app/views/context_menus/time_entries.html.erb
@@ -1,33 +1,41 @@
- <% if !@time_entry.nil? -%>
- - <%= context_menu_link l(:button_edit), {:controller => 'timelog', :action => 'edit', :id => @time_entry},
- :class => 'icon-edit', :disabled => !@can[:edit] %>
- <% else %>
- - <%= context_menu_link l(:button_edit), {:controller => 'timelog', :action => 'bulk_edit', :ids => @time_entries.collect(&:id)},
- :class => 'icon-edit', :disabled => !@can[:edit] %>
- <% end %>
+ <% if !@time_entry.nil? -%>
+ -
+ <%= context_menu_link l(:button_edit), {:controller => 'timelog', :action => 'edit', :id => @time_entry},
+ :class => 'icon-edit', :disabled => !@can[:edit] %>
+
+ <% else %>
+ -
+ <%= context_menu_link l(:button_edit), {:controller => 'timelog', :action => 'bulk_edit', :ids => @time_entries.collect(&:id)},
+ :class => 'icon-edit', :disabled => !@can[:edit] %>
+
+ <% end %>
- <%= call_hook(:view_time_entries_context_menu_start, {:time_entries => @time_entries, :can => @can, :back => @back }) %>
+ <%= call_hook(:view_time_entries_context_menu_start, {:time_entries => @time_entries, :can => @can, :back => @back }) %>
- <% if @activities.present? -%>
- -
-
-
- <% @activities.each do |u| -%>
- - <%= 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] %>
- <% end -%>
- - <%= 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] %>
-
-
- <% end %>
+ <% if @activities.present? -%>
+ -
+
+
+ <% @activities.each do |u| -%>
+ -
+ <%= 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] %>
+
+ <% end -%>
+ -
+ <%= 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] %>
+
+
+
+ <% end %>
- <%= call_hook(:view_time_entries_context_menu_end, {:time_entries => @time_entries, :can => @can, :back => @back }) %>
+ <%= call_hook(:view_time_entries_context_menu_end, {:time_entries => @time_entries, :can => @can, :back => @back }) %>
- -
- <%= context_menu_link l(:button_delete),
- {:controller => 'timelog', :action => 'destroy', :ids => @time_entries.collect(&:id), :back_url => @back},
- :method => :delete, :data => {:confirm => l(:text_time_entries_destroy_confirmation)}, :class => 'icon-del', :disabled => !@can[:delete] %>
-
+ -
+ <%= context_menu_link l(:button_delete),
+ {:controller => 'timelog', :action => 'destroy', :ids => @time_entries.collect(&:id), :back_url => @back},
+ :method => :delete, :data => {:confirm => l(:text_time_entries_destroy_confirmation)}, :class => 'icon-del', :disabled => !@can[:delete] %>
+
diff --git a/app/views/courses/_set_join.js.erb b/app/views/courses/_set_join.js.erb
index 05120a41..32c7dc83 100644
--- a/app/views/courses/_set_join.js.erb
+++ b/app/views/courses/_set_join.js.erb
@@ -1,8 +1,8 @@
$('#join').replaceWith('<%= escape_javascript join_in_course(course, user) %>');
<% if @state %>
<% if @state == 0 %>
- alert("加入成功")
+ alert("加入成功")
<% else %>
- alert("密码错误")
+ alert("密码错误")
<% end %>
<% end %>
diff --git a/public/images/bid/special_reward.png b/public/images/bid/special_reward.png
new file mode 100644
index 00000000..a3a4df59
Binary files /dev/null and b/public/images/bid/special_reward.png differ
|