Eric Davis
3f4ea96777
Changed RatesController#update to redirect to:
...
* Rate list for user or
* the back_url if provided
#1914
2009-01-19 11:54:54 -08:00
Eric Davis
e97a68be0d
Show different buttons based on if the Rate is new. #1914
2009-01-19 11:49:43 -08:00
Eric Davis
7d32fc7088
Added a new helper to UsersHelper.
...
* project_options_for_select doesn't allow setting the selected project
so it is replaced with project_options_for_select_with_selected in the views
#1914
2009-01-19 11:47:02 -08:00
Eric Davis
627a03c5e6
Enabled the edit link on index.
2009-01-19 11:35:39 -08:00
Eric Davis
22ec6f56b7
Added a back_url field to the Rate for that will store the redirect path.
...
* Used in the User Administration panel so RatesController can redirect back to
the panel as needed.
#1914
2009-01-19 11:32:27 -08:00
Eric Davis
cc063768b6
Once saving a rate, the user is redirected to the rate list. #1914
2009-01-19 11:22:42 -08:00
Eric Davis
b7a4850b06
Wrong name for the project select field. #1914
2009-01-19 11:20:00 -08:00
Eric Davis
2fe0bd3052
Refactored duplicate logic to a before_filter. #1914
2009-01-19 11:17:13 -08:00
Eric Davis
86c1990faa
Require a user_id on the new action. #1914
2009-01-19 11:14:57 -08:00
Eric Davis
8fe67ef8ae
Updated the form to use the form_for now that there is a Rate object. #1914
2009-01-19 11:14:39 -08:00
Eric Davis
83764cfe40
Use the same form for new as well as edit. #1916
2009-01-19 10:57:28 -08:00
Eric Davis
c178f616d5
Integrated views into the controller specs. #1916
2009-01-19 10:56:39 -08:00
Eric Davis
e6bb0de7e7
Updated url documentation
2009-01-19 10:46:51 -08:00
Eric Davis
ae0be85f76
Using form partial for the new rate. #1916
2009-01-19 10:45:53 -08:00
Eric Davis
c3250c882a
Blocked all non-admins from using the RatesController. #1916
2009-01-19 10:40:42 -08:00
Eric Davis
6698ff8169
Moved the Rate History out of the users partial and into a partial for Rates
...
* This will allow the RatesController to use the same view
#1916
2009-01-19 10:28:58 -08:00
Eric Davis
a2e77e8182
Converted RatesController#index to require a user_id parameter
...
* This action will turn into the Rate History screen
#1916
2009-01-19 10:25:04 -08:00
Eric Davis
441a86e7a6
Added generated RESTful RatesController. #1916
2009-01-19 09:53:47 -08:00
Eric Davis
8eeb0f4872
Moved form to a partial, it will be used with other views. #1914
2009-01-19 09:46:14 -08:00
Eric Davis
ff93fc6df7
Removed custom project selector with one from the helpers. #1914
2009-01-19 09:43:54 -08:00
Eric Davis
973e6bc2b6
Mocked up a nonfunctional New Rate form. #1914
2009-01-19 09:39:44 -08:00
Eric Davis
b993a5ae2f
Refactored the date checks into a separate methods. #1920
2009-01-16 17:03:24 -08:00
Eric Davis
2950051383
Checking date input for Rate#for. #1920
2009-01-16 16:59:49 -08:00
Eric Davis
7bca02b511
Instead of returning nil, which could get confused with No Rate, passing
...
incorrect objects to Rate#for will now throw a Rate::InvalidParameterException
back to the caller.
Normally you don't need to be this strict but this is a public API that will
be consumed by several third parties so we need to be very clear what happened.
#1920
2009-01-16 16:53:00 -08:00
Eric Davis
94e8aad493
Rate#for should handle invalid projects. #1920
2009-01-16 16:43:26 -08:00
Eric Davis
08b267741b
Rate#for should handle invalid users. #1920
2009-01-16 16:40:50 -08:00
Eric Davis
da891cc607
Refactored Rate#for_user_project_and_date to allow nil projects. #1920
2009-01-16 16:34:38 -08:00
Eric Davis
3451286011
Typo, don't need two rates. Rate.rate_for... #1920
2009-01-16 16:21:18 -08:00
Eric Davis
06f8258b38
Extracted an ugly finder method from Rate#for to a private method. #1920
2009-01-16 16:16:39 -08:00
Eric Davis
69d922a029
Refactored Rate#for to only get one record. #1920
2009-01-16 16:08:13 -08:00
Eric Davis
6a211c3e5e
Rate#for will now return the most current rate for the user matching the parameters. #1920
2009-01-16 16:06:12 -08:00
Eric Davis
b59c87b1f6
Implementing Rate#for's internal logic. #1920
2009-01-16 16:03:15 -08:00
Eric Davis
0d9c7e50de
Added specs for the Rate#for parameter. #1920
2009-01-16 15:54:14 -08:00
Eric Davis
820337576c
Show a lock icon if a Rate is locked. #1915
2009-01-16 15:45:01 -08:00
Eric Davis
0e8bd2153c
Prevent Rates from being destroyed if they are locked. #1919
2009-01-16 15:33:42 -08:00
Eric Davis
3ffb31fafc
Require that a Rate be unlocked before saving it. #1919
2009-01-16 15:28:34 -08:00
Eric Davis
9b0332bf78
Added a Rate#locked? check. #1919
2009-01-16 15:23:30 -08:00
Eric Davis
931ecae4d1
Renamed the Rates tab to Rate History to match the comp. #1915
2009-01-16 15:17:34 -08:00
Eric Davis
bba40af42a
Cleaned up the rate partial UI to better match the comps. #1915
2009-01-16 15:14:05 -08:00
Eric Davis
33d1f84878
Added a named scope to make history lookups easier, Rate.history_for_user(user). #1915
2009-01-16 15:09:46 -08:00
Eric Davis
5296368183
Added the start of a Rate History table in the Rate partial
...
* Had to do Model level access in the view. Once there is a hook in the
controller, it can be moved to there.
* Added a table listing each rate using the memberships table as a base
#1915
2009-01-16 15:05:52 -08:00
Eric Davis
e1278bcb69
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
2009-01-16 14:42:33 -08:00
Eric Davis
48d394704a
Added data validation for Rates. #1917
2009-01-16 14:14:21 -08:00
Eric Davis
3f39bdaa6b
Added associations to Rate. #1917
2009-01-16 14:00:11 -08:00
Eric Davis
a3c12fed19
Added basic rate model and it's database schema
2009-01-16 13:56:04 -08:00