summaryrefslogtreecommitdiffstats
path: root/app/views/users/_memberships.rhtml
blob: 44d74ef7ba3ec294080fc44122bcba53f4714a5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<div class="box" style="margin-top: 16px;">
<h3><%= l(:label_project_plural) %></h3>

<% @user.memberships.each do |membership| %>
<% form_tag({ :action => 'edit_membership', :id => @user, :membership_id => membership }, :class => "tabular") do %>
<p style="margin:0;padding-top:0;">
    <label><%= membership.project.name %></label>
    <select name="membership[role_id]">
    <%= options_from_collection_for_select @roles, "id", "name", membership.role_id %>
    </select>
    <%= submit_tag l(:button_change), :class => "button-small" %>
    <%= link_to l(:button_delete), {:action => 'destroy_membership', :id => @user, :membership_id => membership }, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
</p>
<% end %>
<% end %>

<% if @projects.any? %>
<hr />
<p>
<label><%=l(:label_project_new)%></label><br/>
<% 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 %>
</p>
<% end %>
</div>