2012-08-25 13:31:19 -04:00
|
|
|
%h3.page_title
|
2012-02-11 12:56:18 -05:00
|
|
|
Users
|
2012-08-10 18:07:50 -04:00
|
|
|
= link_to 'New User', new_admin_user_path, class: "btn small right"
|
2012-04-13 01:12:34 -04:00
|
|
|
%br
|
2012-04-16 16:33:03 -04:00
|
|
|
|
2012-08-23 17:04:43 -04:00
|
|
|
= form_tag admin_users_path, method: :get, class: 'form-inline' do
|
2012-08-10 18:07:50 -04:00
|
|
|
= text_field_tag :name, params[:name], class: "xlarge"
|
|
|
|
= submit_tag "Search", class: "btn submit primary"
|
2012-11-27 22:14:05 -05:00
|
|
|
%ul.nav.nav-tabs
|
2012-08-10 18:07:50 -04:00
|
|
|
%li{class: "#{'active' unless params[:filter]}"}
|
2012-06-03 18:37:27 -04:00
|
|
|
= link_to "Active", admin_users_path
|
2012-08-10 18:07:50 -04:00
|
|
|
%li{class: "#{'active' if params[:filter] == "admins"}"}
|
|
|
|
= link_to admin_users_path(filter: "admins") do
|
2012-04-16 16:33:03 -04:00
|
|
|
Admins
|
2012-08-10 18:07:50 -04:00
|
|
|
%li{class: "#{'active' if params[:filter] == "blocked"}"}
|
|
|
|
= link_to admin_users_path(filter: "blocked") do
|
2012-04-16 16:33:03 -04:00
|
|
|
Blocked
|
2012-08-10 18:07:50 -04:00
|
|
|
%li{class: "#{'active' if params[:filter] == "wop"}"}
|
|
|
|
= link_to admin_users_path(filter: "wop") do
|
2012-04-16 16:33:03 -04:00
|
|
|
Without projects
|
|
|
|
|
2012-09-03 14:53:16 -04:00
|
|
|
%table
|
2011-11-02 11:21:17 -04:00
|
|
|
%thead
|
2011-10-08 17:36:38 -04:00
|
|
|
%th Admin
|
|
|
|
%th Name
|
2012-11-27 22:14:05 -05:00
|
|
|
%th Username
|
2011-10-08 17:36:38 -04:00
|
|
|
%th Email
|
|
|
|
%th Projects
|
2012-04-16 16:33:03 -04:00
|
|
|
%th Edit
|
2012-07-19 00:05:57 -04:00
|
|
|
%th.cred Danger Zone!
|
2011-10-08 17:36:38 -04:00
|
|
|
|
|
|
|
- @admin_users.each do |user|
|
|
|
|
%tr
|
2012-08-10 18:07:50 -04:00
|
|
|
%td= check_box_tag "admin", 1, user.admin, disabled: :disabled
|
2011-10-14 17:12:02 -04:00
|
|
|
%td= link_to user.name, [:admin, user]
|
2012-11-27 22:14:05 -05:00
|
|
|
%td= user.username
|
2011-10-08 17:36:38 -04:00
|
|
|
%td= user.email
|
|
|
|
%td= user.users_projects.count
|
2012-08-10 18:07:50 -04:00
|
|
|
%td= link_to 'Edit', edit_admin_user_path(user), id: "edit_#{dom_id(user)}", class: "btn small"
|
2012-11-27 22:14:05 -05:00
|
|
|
%td.bgred
|
2012-06-03 18:37:27 -04:00
|
|
|
- if user.blocked
|
2012-08-10 18:07:50 -04:00
|
|
|
= link_to 'Unblock', unblock_admin_user_path(user), method: :put, class: "btn small success"
|
2012-06-03 18:37:27 -04:00
|
|
|
- else
|
2012-08-10 18:07:50 -04:00
|
|
|
= link_to 'Block', block_admin_user_path(user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn small danger"
|
2012-11-27 22:14:05 -05:00
|
|
|
= link_to 'Destroy', [:admin, user], confirm: "USER #{user.name} WILL BE REMOVED! Are you sure?", method: :delete, class: "btn small danger"
|
2011-10-08 17:36:38 -04:00
|
|
|
|
2012-08-10 18:07:50 -04:00
|
|
|
= paginate @admin_users, theme: "admin"
|