Ability to block user

This commit is contained in:
randx 2012-04-13 08:12:34 +03:00
parent fb6d4511a0
commit 497ee5fbbc
9 changed files with 60 additions and 25 deletions

View file

@ -32,10 +32,15 @@
.clearfix
= f.label :twitter
.input= f.text_field :twitter
%hr
.clearfix
= f.label :admin do
= f.check_box :admin
%span Administrator
.clearfix
= f.label :blocked do
= f.check_box :blocked
%span Blocked
.actions
= f.submit 'Save', :class => "btn primary"
- if @admin_user.new_record?

View file

@ -1,13 +1,14 @@
%h3
Users
= link_to 'New User', new_admin_user_path, :class => "btn small right"
%hr
%table.zebra-striped
%br
%table.zebra-striped.table-bordered
%thead
%th Admin
%th Name
%th Email
%th Projects
%th Blocked
%th
%th
@ -17,6 +18,7 @@
%td= link_to user.name, [:admin, user]
%td= user.email
%td= user.users_projects.count
%td= check_box_tag "blocked", 1, user.blocked, :disabled => :disabled
%td= link_to 'Edit', edit_admin_user_path(user), :id => "edit_#{dom_id(user)}", :class => "btn small"
%td= link_to 'Destroy', [:admin, user], :confirm => 'Are you sure?', :method => :delete, :class => "btn small danger"

View file

@ -16,6 +16,11 @@
%b
Admin:
%td= check_box_tag "admin", 1, @admin_user.admin, :disabled => :disabled
%tr
%td
%b
Blocked:
%td= check_box_tag "blocked", 1, @admin_user.blocked, :disabled => :disabled
%tr
%td
%b