% if @memberships.any? %>
<%= l(:label_project) %> | <%= l(:label_role) %> | <% @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' %> |
<%= l(:label_no_data) %>
<% end %> <% if @projects.any? %>
<% form_tag({ :action => 'edit_membership', :id => @user }) do %>
<%= select_tag 'membership[project_id]', options_for_membership_project_select(@user, @projects) %>
<%= l(:label_role) %>:
<%= select_tag 'membership[role_id]', options_from_collection_for_select(@roles, "id", "name") %>
<%= submit_tag l(:button_add) %>
<% end %>