Merge branch 'members' of github.com:Geekner/Open-Source-Access-Control-Web-Interface into members

This commit is contained in:
Will Bradley 2012-12-01 23:51:52 -07:00
commit 4fc18013d9
4 changed files with 14 additions and 1 deletions

View File

@ -6,7 +6,7 @@ class User < ActiveRecord::Base
:recoverable, :rememberable, :trackable, :validatable :recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model # Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me, :name, :admin attr_accessible :email, :password, :password_confirmation, :remember_me, :name, :admin, :active
has_many :cards has_many :cards
end end

View File

@ -33,6 +33,10 @@
<a href="?password=edit">Change Password</a> <a href="?password=edit">Change Password</a>
</div> </div>
<% end %> <% end %>
<div class="field">
<%= f.label :active, "Active?" %><br />
<%= f.check_box :active %>
</div>
<div class="field"> <div class="field">
<%= f.label :admin, "Admin?" %><br /> <%= f.label :admin, "Admin?" %><br />
<%= f.check_box :admin %> <%= f.check_box :admin %>

View File

@ -8,6 +8,8 @@
<th>Name</th> <th>Name</th>
<th>Email</th> <th>Email</th>
<th>Cards</th> <th>Cards</th>
<th>Active?</th>
<th>Waiver?</th>
<th>Admin?</th> <th>Admin?</th>
<th></th> <th></th>
<th></th> <th></th>
@ -23,6 +25,8 @@
<%= link_to c.card_number, card_url(c) %><%= "," unless c == user.cards.last %> <%= link_to c.card_number, card_url(c) %><%= "," unless c == user.cards.last %>
<% end %> <% end %>
</td> </td>
<td><%= if user.active? then "Active" end %></td>
<td><%= if user.waiver.blank? then "Not Signed" else "Signed" end %></td>
<td><%= if user.admin? then "Admin" end %></td> <td><%= if user.admin? then "Admin" end %></td>
<td><%= link_to 'Edit', edit_user_path(user) if can? :update, user %></td> <td><%= link_to 'Edit', edit_user_path(user) if can? :update, user %></td>
<td><%= link_to 'Destroy', user, :confirm => 'Are you sure? WARNING: THIS DOES NOT REMOVE THE USER FROM THE DOOR SYSTEM! DISABLE THEM FIRST.', :method => :delete if can? :destroy, user %></td> <td><%= link_to 'Destroy', user, :confirm => 'Are you sure? WARNING: THIS DOES NOT REMOVE THE USER FROM THE DOOR SYSTEM! DISABLE THEM FIRST.', :method => :delete if can? :destroy, user %></td>

View File

@ -9,6 +9,11 @@
<%= @user.email %> <%= @user.email %>
</p> </p>
<p>
<b>Active?</b>
<%= @user.active %>
</p>
<p> <p>
<b>Admin?</b> <b>Admin?</b>
<%= @user.admin %> <%= @user.admin %>