2013-02-13 10:28:28 -05:00
.row
2013-12-30 16:55:15 -05:00
.col-md-3
2013-02-13 10:28:28 -05:00
.admin-filter
%ul.nav.nav-pills.nav-stacked
%li{class: "#{'active' unless params[:filter]}"}
= link_to admin_users_path do
Active
%small.pull-right= User.active.count
%li{class: "#{'active' if params[:filter] == "admins"}"}
= link_to admin_users_path(filter: "admins") do
Admins
%small.pull-right= User.admins.count
%li{class: "#{'active' if params[:filter] == "blocked"}"}
= link_to admin_users_path(filter: "blocked") do
Blocked
%small.pull-right= User.blocked.count
%li{class: "#{'active' if params[:filter] == "wop"}"}
= link_to admin_users_path(filter: "wop") do
Without projects
%small.pull-right= User.without_projects.count
%hr
2014-02-15 07:31:01 -05:00
= form_tag admin_users_path, method: :get, class: 'form-inline' do
.form-group
= search_field_tag :name, params[:name], placeholder: 'Name, email or username', class: 'form-control'
2014-09-26 10:52:36 -04:00
= button_tag class: 'btn btn-primary' do
2014-10-01 18:21:29 -04:00
%i.fa.fa-search
2014-02-15 07:31:01 -05:00
%hr
2013-02-13 10:28:28 -05:00
= link_to 'Reset', admin_users_path, class: "btn btn-cancel"
2012-04-16 16:33:03 -04:00
2013-12-30 16:55:15 -05:00
.col-md-9
2014-05-29 11:42:44 -04:00
.panel.panel-default
2014-05-29 11:43:21 -04:00
.panel-heading
2013-06-26 08:57:02 -04:00
Users (#{@users.total_count})
2014-05-29 12:42:49 -04:00
.panel-head-actions
2013-08-01 15:35:40 -04:00
= link_to 'New User', new_admin_user_path, class: "btn btn-new"
2013-02-13 10:28:28 -05:00
%ul.well-list
2013-06-26 08:57:02 -04:00
- @users.each do |user|
2013-02-13 10:28:28 -05:00
%li
2014-03-26 03:25:02 -04:00
.list-item-name
- if user.blocked?
2014-10-01 18:21:29 -04:00
%i.fa.fa-lock.cred
2014-03-26 03:25:02 -04:00
- else
2014-10-01 18:21:29 -04:00
%i.fa.fa-user.cgreen
2014-03-26 03:25:02 -04:00
= link_to user.name, [:admin, user]
- if user.admin?
%strong.cred (Admin)
- if user == current_user
%span.cred It's you!
2013-02-13 10:28:28 -05:00
.pull-right
%span.light
2014-10-01 18:21:29 -04:00
%i.fa.fa-envelope
2013-02-13 10:28:28 -05:00
= mail_to user.email, user.email, class: 'light'
= link_to 'Edit', edit_admin_user_path(user), id: "edit_#{dom_id(user)}", class: "btn btn-small"
- unless user == current_user
2013-03-04 09:52:30 -05:00
- if user.blocked?
2013-02-13 10:28:28 -05:00
= link_to 'Unblock', unblock_admin_user_path(user), method: :put, class: "btn btn-small success"
- else
2013-12-10 14:33:21 -05:00
= link_to 'Block', block_admin_user_path(user), data: {confirm: 'USER WILL BE BLOCKED! Are you sure?'}, method: :put, class: "btn btn-small btn-remove"
= link_to 'Destroy', [:admin, user], data: { confirm: "USER #{user.name} WILL BE REMOVED! All tickets linked to this user will also be removed! Maybe block the user instead? Are you sure?" }, method: :delete, class: "btn btn-small btn-remove"
2013-07-31 10:05:22 -04:00
= paginate @users, theme: "gitlab"