Added a standard form for adding a new rate based on the membership row. #1921

This commit is contained in:
Eric Davis committed 2009-01-20 15:58:55 -08:00
1 parent 0d90144c0e
commit 0806bf13df
2 files changed
+15 -3

No files matched your search

+13 -3
View File
@@ -25,16 +25,26 @@
<%# TODO: Hook %> <%# TODO: Hook %>
<td> <td>
<% rate = Rate.for(@user, membership.project) %> <% rate = Rate.for(@user, membership.project) %>
<% if rate.default? || rate.nil? %> <% if rate.default? || rate.nil? %>
<% if rate.default? %> <% if rate.default? %>
<em><%= number_to_currency(rate.amount) %></em> <em><%= number_to_currency(rate.amount) %></em>
<% end %> <% end %>
[ Set Rate Form ]
<% form_for(:rate, :url => rates_path) do |f| %>
<%= f.text_field :amount %>
<%= f.hidden_field :date_in_effect, :value => Date.today.to_s %>
<%= f.hidden_field :project_id, :value => membership.project.id %>
<%= f.hidden_field :user_id, :value => @user.id %>
<%= hidden_field_tag "back_url", url_for(:controller => 'users', :action => 'edit', :id => @user, :tab => 'memberships') %>
<%= submit_tag(l(:rate_label_set_rate), :class => "small") %>
<% end %>
<% else %> <% else %>
<strong><%= link_to number_to_currency(rate.amount), { :action => 'edit', :id => @user, :tab => 'rates'} %></strong> <strong><%= link_to number_to_currency(rate.amount), { :action => 'edit', :id => @user, :tab => 'rates'} %></strong>
<% end %> <% end %>
</td> </td>
</tr> </tr>
</tbody> </tbody>
+2
View File
@@ -5,3 +5,5 @@ rate_label_rate_history: Rate History
rate_label_new_rate: New Rate rate_label_new_rate: New Rate
rate_label_currency: $ rate_label_currency: $
rate_error_user_not_found: User not found rate_error_user_not_found: User not found
rate_label_set_rate: Set Rate