Moved users into new admin-namespace and made the controller restful. Also moved some logic from the controller into the user-model (dry it up..).

This commit is contained in:
Benjamin Meichsner 2009-01-12 18:26:09 +01:00
parent 47398c6a70
commit 461dfa8531
19 changed files with 242 additions and 94 deletions

View file

@ -0,0 +1,50 @@
<%= @form.error_messages %>
<table style="float:left;width:52%;">
<tr>
<td><%= @form.label :nick %></td>
<td><%= @form.text_field :nick %></td>
</tr>
<tr>
<td><%= @form.label :first_name %></td>
<td><%= @form.text_field :first_name %></td>
</tr>
<tr>
<td><%= @form.label :last_name %></td>
<td><%= @form.text_field :last_name %></td>
</tr>
<tr>
<td><%= @form.label :email %></td>
<td><%= @form.text_field :email %></td>
</tr>
<tr>
<td><%= @form.label :phone %></td>
<td><%= @form.text_field :phone %></td>
</tr>
<tr>
<td><%= @form.label :address %></td>
<td><%= @form.text_field :address %></td>
</tr>
<tr>
<td/>
</tr>
<tr>
<td><%= @form.label :password, "Password" %></td>
<td><%= @form.password_field :password %></td>
</tr>
<tr>
<td><%= @form.label :password_confirmation, "Password confirmation" %></td>
<td><%= @form.password_field :password_confirmation %></td>
</tr>
</table>
<table style="float:right;width:45%;">
<tr>
<td colspan="2"><b>Einstellungen:</b></td>
</tr>
<% for setting in User::setting_keys.keys -%>
<tr>
<td><label for="user[setting_attributes][<%= setting %>]"><%=h User::setting_keys[setting]%></label></td>
<td><%= check_box_tag "user[setting_attributes][#{setting}]", '1', @user.settings[setting] == '1' || @user.settings_default(setting) %></td>
</tr>
<% end -%>
</table>