Patched UsersHelper#user_settings_tabs to add a new Rates tab

* Wrapped UsersHelper#user_settings_tabs with an alias_method_chain
* Added the new Rate element to the return of user_settings_tabs
* Added RSpecs to confirm the change works without breaking
* Added a partial view for users/rates which will be used by Redmine
  when it renders the user edit panel

  #1913
This commit is contained in:
Eric Davis
2009-01-16 14:42:33 -08:00
parent 48d394704a
commit e1278bcb69
5 changed files with 66 additions and 1 deletions
+24
View File
@@ -0,0 +1,24 @@
require_dependency 'users_helper'
module RateUsersHelperPatch
def self.included(base) # :nodoc:
base.send(:include, InstanceMethods)
base.class_eval do
alias_method_chain :user_settings_tabs, :rate_tab
end
end
module InstanceMethods
# Adds a rates tab to the user administration page
def user_settings_tabs_with_rate_tab
tabs = user_settings_tabs_without_rate_tab
tabs << { :name => 'rates', :partial => 'users/rates', :label => :rate_label_rates}
return tabs
end
end
end
UsersHelper.send(:include, RateUsersHelperPatch)