Permalink
Browse files

Adjust admin ui edit form for column changes

  • Loading branch information...
1 parent de074cd commit 7a1e787679b3e5ee8fe3b6de76685ad5559fac8e @andey committed Feb 10, 2013
Showing with 44 additions and 3 deletions.
  1. +2 −2 app/views/admin/users/edit.html.erb
  2. +42 −1 app/views/admin/users/new.html.erb
@@ -24,9 +24,9 @@
<%= f.text_field :modhash %>
</div>
<div class="field">
- <%= f.label :active %>
+ <%= f.label :banned %>
<br/>
- <%= f.check_box :active %>
+ <%= f.check_box :banned %>
</div>
<div class="field">
<%= f.label :link_karma %>
@@ -1,5 +1,46 @@
<h1>New user</h1>
-<%= render 'form' %>
+<%= form_for(@user, :url => admin_users_path) do |f| %>
+ <% if @user.errors.any? %>
+ <div id="error_explanation">
+ <h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
+
+ <ul>
+ <% @user.errors.full_messages.each do |msg| %>
+ <li><%= msg %></li>
+ <% end %>
+ </ul>
+ </div>
+ <% end %>
+
+ <div class="field">
+ <%= f.label :username %>
+ <br/>
+ <%= f.text_field :username %>
+ </div>
+ <div class="field">
+ <%= f.label :modhash %>
+ <br/>
+ <%= f.text_field :modhash %>
+ </div>
+ <div class="field">
+ <%= f.label :banned %>
+ <br/>
+ <%= f.check_box :banned %>
+ </div>
+ <div class="field">
+ <%= f.label :link_karma %>
+ <br/>
+ <%= f.number_field :link_karma %>
+ </div>
+ <div class="field">
+ <%= f.label :comment_karma %>
+ <br/>
+ <%= f.number_field :comment_karma %>
+ </div>
+ <div class="actions">
+ <%= f.submit %>
+ </div>
+<% end %>
<%= link_to 'Back', users_path %>

0 comments on commit 7a1e787

Please sign in to comment.