Removed the Redmine core template and Redmine core hooks instead.

This commit is contained in:
Eric Davis
2009-08-01 10:57:10 -07:00
parent 43c20ae820
commit 724dd470ba
4 changed files with 39 additions and 72 deletions

View File

@@ -0,0 +1,23 @@
<td id="rate_<%= membership.project.id %>_<%= membership.user.id %>">
<% rate = Rate.for(user, membership.project) %>
<% if rate.nil? || rate.default? %>
<% if rate && rate.default? %>
<em><%= number_to_currency(rate.amount) %></em>
<% end %>
<% remote_form_for(:rate, :url => formatted_rates_path('js')) do |f| %>
<%= f.text_field :amount %>
<%= f.hidden_field :date_in_effect, :value => Date.today.to_s, :id => "" %>
<%= 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 %>
<strong><%= link_to number_to_currency(rate.amount), { :action => 'edit', :id => user, :tab => 'rates'} %></strong>
<% end %>
</td>

View File

@@ -1,72 +0,0 @@
<%# TODO: Override the default view until post 0.8.x which will have the hooks %>
<% if @memberships && @memberships.any? %>
<table class="list memberships">
<thead>
<th><%= l(:label_project) %></th>
<th><%= l(:label_role) %></th>
<th style="width:15%"></th>
<%# TODO: Hook %>
<th><%= l(:rate_label_rate) %> <%= l(:rate_label_currency) %></td>
</thead>
<tbody>
<% @memberships.each do |membership| %>
<% next if membership.new_record? %>
<tr class="<%= cycle 'odd', 'even' %>">
<td><%=h membership.project %></td>
<td align="center">
<% form_tag({ :action => 'edit_membership', :id => @user, :membership_id => membership }) do %>
<%= select_tag 'membership[role_id]', options_from_collection_for_select(@roles, "id", "name", membership.role_id) %>
<%= submit_tag l(:button_change), :class => "small" %>
<% end %>
</td>
<td align="center">
<%= link_to l(:button_delete), {:action => 'destroy_membership', :id => @user, :membership_id => membership }, :method => :post, :class => 'icon icon-del' %>
</td>
<%# TODO: Hook %>
<td id="rate_<%= membership.project.id %>_<%= membership.user.id %>">
<% rate = Rate.for(@user, membership.project) %>
<% if rate.nil? || rate.default? %>
<% if rate && rate.default? %>
<em><%= number_to_currency(rate.amount) %></em>
<% end %>
<% remote_form_for(:rate, :url => formatted_rates_path('js')) do |f| %>
<%= f.text_field :amount %>
<%= f.hidden_field :date_in_effect, :value => Date.today.to_s, :id => "" %>
<%= 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 %>
<strong><%= link_to number_to_currency(rate.amount), { :action => 'edit', :id => @user, :tab => 'rates'} %></strong>
<% end %>
</td>
</tr>
</tbody>
<% end; reset_cycle %>
</table>
<% else %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>
<% if @projects.any? %>
<p>
<label><%=l(:label_project_new)%></label><br/>
<% form_tag({ :action => 'edit_membership', :id => @user }) do %>
<%# 0.8.x compatibility %>
<% if respond_to?(:options_for_membership_project_select) %>
<%= select_tag 'membership[project_id]', options_for_membership_project_select(@user, @projects) %>
<% else %>
<%= select_tag 'membership[project_id]', projects_options_for_select(@projects) %>
<% end %>
<%= l(:label_role) %>:
<%= select_tag 'membership[role_id]', options_from_collection_for_select(@roles, "id", "name") %>
<%= submit_tag l(:button_add) %>
<% end %>
</p>
<% end %>