upz, forgot to take out comments
[boxroom-stian.git] / app / views / user / _form.rhtml
blobcd61c61e3eeec8a8500b772557343e425b5916cf
1 <%= name_to_username(error_messages_for('user')) %>\r
2 \r
3 <!--[form:user]-->\r
4 \r
5 <label for="user_name">Username</label><br/>\r
6 <% if @logged_in_user.is_admin? %>\r
7   <%= text_field 'user', 'name', :style => 'width:220px;' %><br />\r
8 <% else %>\r
9   <b><%= @user.name %></b><br/>\r
10 <% end %>\r
11 <br />\r
13 <label for="user_email">E-mail address</label><br/>\r
14 <%= text_field 'user', 'email', :style => 'width:220px;' %><br />\r
15 <br />\r
17 <label for="user_password"><% unless controller.action_name == 'new' %>New p<% else %>P<% end %>assword</label><br/>\r
18 <%= password_field 'user', 'password', :style => 'width:220px;' %><br />\r
19 <br />\r
21 <label for="user_password_confirmation">Confirm <% unless controller.action_name == 'new' %>new<% end %> password</label><br/>\r
22 <%= password_field 'user', 'password_confirmation', :style => 'width:220px;' %><br />\r
23 <br />\r
25 <% if @logged_in_user.is_admin? %>\r
26 Member of these groups<br>\r
27 <table>\r
28     <tr>\r
29     <% i = 0 %>\r
30     <% for group in Group.find(:all) %>\r
31         <% if @user.groups.find_by_id(group.id) %>\r
32             <% checked = 'checked' %>\r
33         <% else %>\r
34             <% checked = '' %>\r
35         <% end %>\r
37         <% if @user and @user.is_the_administrator? and group.is_the_administrators_group? %>\r
38         <td style="color:#818181;"><%= check_box('belongs_to_group', group.id, {:checked => checked, :disabled => true}, 'yes', 'no') %> <%= h(group.name) %></td>\r
39         <% else %>\r
40         <td><%= check_box('belongs_to_group', group.id, {:checked => checked}, 'yes', 'no') %> <%= h(group.name) %></td>\r
41         <% end %>\r
43         <% i += 1 %>\r
44         <% if i % 3 == 0 %></tr><tr><% end %>\r
45     <% end %>\r
46     </tr>\r
47 </table>\r
48 <br />\r
49 <% end %>\r
51 <!--[eoform:user]-->