2015-09-11 14:41:01 +05:30
- page_title "Users"
= render 'shared/show_aside'
2014-09-02 18:07:02 +05:30
.row
2015-04-26 12:48:37 +05:30
%aside.col-md-3
2014-09-02 18:07:02 +05:30
.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
2015-09-11 14:41:01 +05:30
%li.filter-two-factor-enabled{class: "#{'active' if params[:filter] == 'two_factor_enabled'}"}
= link_to admin_users_path(filter: 'two_factor_enabled') do
2FA Enabled
%small.pull-right= User.with_two_factor.count
%li.filter-two-factor-disabled{class: "#{'active' if params[:filter] == 'two_factor_disabled'}"}
= link_to admin_users_path(filter: 'two_factor_disabled') do
2FA Disabled
%small.pull-right= User.without_two_factor.count
2014-09-02 18:07:02 +05:30
%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
= 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'
2015-09-11 14:41:01 +05:30
= hidden_field_tag "filter", params[:filter]
2015-04-26 12:48:37 +05:30
= button_tag class: 'btn btn-primary' do
%i.fa.fa-search
2014-09-02 18:07:02 +05:30
%hr
= link_to 'Reset', admin_users_path, class: "btn btn-cancel"
2015-04-26 12:48:37 +05:30
%section.col-md-9
2014-09-02 18:07:02 +05:30
.panel.panel-default
.panel-heading
Users (#{@users.total_count})
.panel-head-actions
2015-04-26 12:48:37 +05:30
.dropdown.inline
%a.dropdown-toggle.btn.btn-sm{href: '#', "data-toggle" => "dropdown"}
%span.light sort:
- if @sort.present?
= sort_options_hash[@sort]
- else
= sort_title_name
%b.caret
%ul.dropdown-menu
%li
= link_to admin_users_path(sort: sort_value_name) do
= sort_title_name
= link_to admin_users_path(sort: sort_value_recently_signin) do
= sort_title_recently_signin
= link_to admin_users_path(sort: sort_value_oldest_signin) do
= sort_title_oldest_signin
= link_to admin_users_path(sort: sort_value_recently_created) do
= sort_title_recently_created
= link_to admin_users_path(sort: sort_value_oldest_created) do
= sort_title_oldest_created
= link_to admin_users_path(sort: sort_value_recently_updated) do
= sort_title_recently_updated
= link_to admin_users_path(sort: sort_value_oldest_updated) do
= sort_title_oldest_updated
= link_to 'New User', new_admin_user_path, class: "btn btn-new btn-sm"
2014-09-02 18:07:02 +05:30
%ul.well-list
- @users.each do |user|
%li
.list-item-name
- if user.blocked?
2015-04-26 12:48:37 +05:30
%i.fa.fa-lock.cred
2014-09-02 18:07:02 +05:30
- else
2015-04-26 12:48:37 +05:30
%i.fa.fa-user.cgreen
2014-09-02 18:07:02 +05:30
= link_to user.name, [:admin, user]
- if user.admin?
%strong.cred (Admin)
- if user == current_user
%span.cred It's you!
.pull-right
%span.light
2015-04-26 12:48:37 +05:30
%i.fa.fa-envelope
2014-09-02 18:07:02 +05:30
= mail_to user.email, user.email, class: 'light'
2015-09-11 14:41:01 +05:30
= link_to 'Edit', edit_admin_user_path(user), id: "edit_#{dom_id(user)}", class: "btn btn-xs"
2014-09-02 18:07:02 +05:30
- unless user == current_user
- if user.blocked?
2015-09-11 14:41:01 +05:30
= link_to 'Unblock', unblock_admin_user_path(user), method: :put, class: "btn btn-xs btn-success"
2014-09-02 18:07:02 +05:30
- else
2015-09-11 14:41:01 +05:30
= link_to 'Block', block_admin_user_path(user), data: {confirm: 'USER WILL BE BLOCKED! Are you sure?'}, method: :put, class: "btn btn-xs btn-warning"
- if user.access_locked?
= link_to 'Unlock', unlock_admin_user_path(user), method: :put, class: "btn btn-xs btn-success", data: { confirm: 'Are you sure?' }
- if user.can_be_removed?
2015-09-25 12:07:36 +05:30
= link_to 'Destroy', [:admin, user], data: { confirm: "USER #{user.name} WILL BE REMOVED! All issues, merge requests and groups linked to this user will also be removed! Maybe block the user instead? Are you sure?" }, method: :delete, class: "btn btn-xs btn-remove"
2014-09-02 18:07:02 +05:30
= paginate @users, theme: "gitlab"