diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2006-12-26 11:28:22 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2006-12-26 11:28:22 +0000 |
commit | 4c84165aa074546df9c8d1aea0911b71fd9734bc (patch) | |
tree | 877aed86f253ba85075ca4781f6bb7b2841f1ab8 /app/views/users | |
parent | a6c8feea214ddd75e9e471140c5be39230c2ee41 (diff) | |
download | redmine-4c84165aa074546df9c8d1aea0911b71fd9734bc.tar.gz redmine-4c84165aa074546df9c8d1aea0911b71fd9734bc.zip |
added the ability to manage users memberships directly on users/edit (administration module)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@118 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/users')
-rw-r--r-- | app/views/users/_memberships.rhtml | 29 | ||||
-rw-r--r-- | app/views/users/edit.rhtml | 2 |
2 files changed, 31 insertions, 0 deletions
diff --git a/app/views/users/_memberships.rhtml b/app/views/users/_memberships.rhtml new file mode 100644 index 000000000..ccf2111a6 --- /dev/null +++ b/app/views/users/_memberships.rhtml @@ -0,0 +1,29 @@ +<div class="box" style="margin-top: 16px;">
+<h3><%= l(:label_project_plural) %></h3>
+
+<% @user.memberships.each do |membership| %>
+<%= start_form_tag({ :action => 'edit_membership', :id => @user, :membership_id => membership }, :class => "tabular") %>
+<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), :post => true, :class => 'pic picDelete' %>
+</p>
+<%= end_form_tag %>
+<% end %>
+<hr />
+<p>
+<label><%=l(:label_project_new)%></label><br/>
+<%= start_form_tag({ :action => 'edit_membership', :id => @user }) %>
+<select name="membership[project_id]">
+<%= options_from_collection_for_select @projects, "id", "name", @membership.project_id %>
+</select>
+<select name="membership[role_id]">
+<%= options_from_collection_for_select @roles, "id", "name", @membership.role_id %>
+</select>
+<%= submit_tag l(:button_add) %>
+<%= end_form_tag %>
+</p>
+</div>
\ No newline at end of file diff --git a/app/views/users/edit.rhtml b/app/views/users/edit.rhtml index 2332b70ad..0da99d0d2 100644 --- a/app/views/users/edit.rhtml +++ b/app/views/users/edit.rhtml @@ -4,3 +4,5 @@ <%= render :partial => 'form', :locals => { :f => f } %> <%= submit_tag l(:button_save) %> <% end %> + +<%= render :partial => 'memberships' %>
\ No newline at end of file |