2012-06-04 01:37:27 +03:00
|
|
|
%h3
|
2012-02-11 19:56:18 +02:00
|
|
|
Users
|
|
|
|
= link_to 'New User', new_admin_user_path, :class => "btn small right"
|
2012-04-13 08:12:34 +03:00
|
|
|
%br
|
2012-04-16 23:33:03 +03:00
|
|
|
|
|
|
|
%ul.nav.nav-pills
|
|
|
|
%li{:class => "#{'active' unless params[:filter]}"}
|
2012-06-04 01:37:27 +03:00
|
|
|
= link_to "Active", admin_users_path
|
2012-04-16 23:33:03 +03:00
|
|
|
%li{:class => "#{'active' if params[:filter] == "admins"}"}
|
|
|
|
= link_to admin_users_path(:filter => "admins") do
|
|
|
|
Admins
|
|
|
|
%li{:class => "#{'active' if params[:filter] == "blocked"}"}
|
|
|
|
= link_to admin_users_path(:filter => "blocked") do
|
|
|
|
Blocked
|
|
|
|
%li{:class => "#{'active' if params[:filter] == "wop"}"}
|
|
|
|
= link_to admin_users_path(:filter => "wop") do
|
|
|
|
Without projects
|
|
|
|
|
|
|
|
%table.admin-table
|
2011-11-02 11:21:17 -04:00
|
|
|
%thead
|
2011-10-09 00:36:38 +03:00
|
|
|
%th Admin
|
|
|
|
%th Name
|
|
|
|
%th Email
|
|
|
|
%th Projects
|
2012-04-16 23:33:03 +03:00
|
|
|
%th Edit
|
2012-04-13 08:12:34 +03:00
|
|
|
%th Blocked
|
2011-10-09 00:36:38 +03:00
|
|
|
%th
|
|
|
|
|
|
|
|
- @admin_users.each do |user|
|
|
|
|
%tr
|
|
|
|
%td= check_box_tag "admin", 1, user.admin, :disabled => :disabled
|
2011-10-15 00:12:02 +03:00
|
|
|
%td= link_to user.name, [:admin, user]
|
2011-10-09 00:36:38 +03:00
|
|
|
%td= user.email
|
|
|
|
%td= user.users_projects.count
|
2012-02-11 19:56:18 +02:00
|
|
|
%td= link_to 'Edit', edit_admin_user_path(user), :id => "edit_#{dom_id(user)}", :class => "btn small"
|
2012-04-16 23:33:03 +03:00
|
|
|
%td
|
2012-06-04 01:37:27 +03:00
|
|
|
- if user.blocked
|
2012-04-16 23:33:03 +03:00
|
|
|
= link_to 'Unblock', unblock_admin_user_path(user), :method => :put, :class => "btn small success"
|
2012-06-04 01:37:27 +03:00
|
|
|
- else
|
2012-04-16 23:33:03 +03:00
|
|
|
= link_to 'Block', block_admin_user_path(user), :confirm => 'USER WILL BE BLOCKED! Are you sure?', :method => :put, :class => "btn small danger"
|
|
|
|
%td= link_to 'Destroy', [:admin, user], :confirm => 'USER WILL BE REMOVED! Are you sure?', :method => :delete, :class => "btn small danger"
|
2011-10-09 00:36:38 +03:00
|
|
|
|
2012-03-22 00:09:56 +02:00
|
|
|
= paginate @admin_users, :theme => "admin"
|