diff --git a/app/views/users/_memberships.rhtml b/app/views/users/_memberships.rhtml new file mode 100644 index 0000000..c64cc0b --- /dev/null +++ b/app/views/users/_memberships.rhtml @@ -0,0 +1,57 @@ +<%# TODO: Override the default view until post 0.8.x which will have the hooks %> +<% if @memberships.any? %> +
| <%= l(:label_project) %> | +<%= l(:label_role) %> | ++ <%# TODO: Hook %> + | <%= l(:rate_label_rate) %> <%= l(:rate_label_currency) %> + | + + <% @memberships.each do |membership| %> + <% next if membership.new_record? %> +
|---|---|---|---|
| <%=h membership.project %> | ++ <% 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 %> + | ++ <%= link_to l(:button_delete), {:action => 'destroy_membership', :id => @user, :membership_id => membership }, :method => :post, :class => 'icon icon-del' %> + | + <%# TODO: Hook %> ++ <% rate = Rate.for(@user, membership.project) %> + + <% if rate.default? || rate.nil? %> + <% if rate.default? %> + <%= number_to_currency(rate.amount) %> + <% end %> + [ Set Rate Form ] + <% else %> + <%= link_to number_to_currency(rate.amount), { :action => 'edit', :id => @user, :tab => 'rates'} %> + <% end %> + + | +
<%= l(:label_no_data) %>
+<% end %> + +<% if @projects.any? %> +
+
+<% form_tag({ :action => 'edit_membership', :id => @user }) do %>
+<%= select_tag 'membership[project_id]', projects_options_for_select(@projects) %>
+<%= l(:label_role) %>:
+<%= select_tag 'membership[role_id]', options_from_collection_for_select(@roles, "id", "name") %>
+<%= submit_tag l(:button_add) %>
+<% end %>
+