diff --git a/app/controllers/rates_controller.rb b/app/controllers/rates_controller.rb index 8fc06f6..a781cfc 100644 --- a/app/controllers/rates_controller.rb +++ b/app/controllers/rates_controller.rb @@ -1,4 +1,6 @@ class RatesController < ApplicationController + helper :users + # GET /rates # GET /rates.xml def index diff --git a/app/views/rates/_list.html.erb b/app/views/rates/_list.html.erb new file mode 100644 index 0000000..6a997fd --- /dev/null +++ b/app/views/rates/_list.html.erb @@ -0,0 +1,31 @@ +
| <%= l(:label_date) %> | +<%= l(:label_project) %> | +<%= l(:rate_label_rate) %> | ++ + + <% @rates.each do |rate| %> + |
|---|---|---|---|
| <%= h format_date(rate.date_in_effect) %> | ++ <%= link_to(h(rate.project), :controller => 'projects', :action => 'show', :id => rate.project) %> + | +<%= h rate.amount %> | ++ <% if rate.unlocked? %> + <%= link_to image_tag('edit.png'), + {:action => 'not_implemented', :id => @user, :rate_id => rate }, + {:method => :post } %> + <%= link_to image_tag('delete.png'), + {:action => 'not_implemented', :id => @user, :rate_id => rate }, + {:method => :post, :confirm => l(:text_are_you_sure) } %> + <% else %> + <%= image_tag('locked.png') %> + <% end %> + | +
| Amount | -User | -Project | -Date in effect | -|||
|---|---|---|---|---|---|---|
| <%=h rate.amount %> | -<%=h rate.user_id %> | -<%=h rate.project_id %> | -<%=h rate.date_in_effect %> | -<%= link_to 'Show', rate %> | -<%= link_to 'Edit', edit_rate_path(rate) %> | -<%= link_to 'Destroy', rate, :confirm => 'Are you sure?', :method => :delete %> | -
| <%= l(:label_date) %> | -<%= l(:label_project) %> | -<%= l(:rate_label_rate) %> | -- - - <% @rates.each do |rate| %> - |
|---|---|---|---|
| <%= h format_date(rate.date_in_effect) %> | -- <%= link_to(h(rate.project), :controller => 'projects', :action => 'show', :id => rate.project) %> - | -<%= h rate.amount %> | -- <% if rate.unlocked? %> - <%= link_to image_tag('edit.png'), - {:action => 'not_implemented', :id => @user, :rate_id => rate }, - {:method => :post } %> - <%= link_to image_tag('delete.png'), - {:action => 'not_implemented', :id => @user, :rate_id => rate }, - {:method => :post, :confirm => l(:text_are_you_sure) } %> - <% else %> - <%= image_tag('locked.png') %> - <% end %> - | -