Add active status to user show/edit.
This commit is contained in:
		
							parent
							
								
									4ad622e906
								
							
						
					
					
						commit
						0b5978d4ef
					
				@ -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
 | 
				
			||||||
 | 
				
			|||||||
@ -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 %>
 | 
				
			||||||
 | 
				
			|||||||
@ -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>
 | 
				
			||||||
 | 
				
			|||||||
@ -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 %>
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user