summaryrefslogtreecommitdiff
path: root/app/views/admin/users/index.html.haml
blob: f910e90d6ca211d9255c7bc621a4708f7bd44433 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
- @no_container = true
- page_title "Users"

%div{ class: container_class }
  .prepend-top-default
    = form_tag admin_users_path, method: :get do
      - if params[:filter].present?
        = hidden_field_tag "filter", h(params[:filter])
      .search-holder
        .search-field-holder
          = search_field_tag :search_query, params[:search_query], placeholder: 'Search by name, email or username', class: 'form-control search-text-input js-search-input', spellcheck: false
          = icon("search", class: "search-icon")
        .dropdown
          - toggle_text = if @sort.present? then sort_options_hash[@sort] else sort_title_name end
          = dropdown_toggle(toggle_text, { toggle: 'dropdown' })
          %ul.dropdown-menu.dropdown-menu-right
            %li.dropdown-header
              Sort by
            %li
              = link_to admin_users_path(sort: sort_value_name, filter: params[:filter]) do
                = sort_title_name
              = link_to admin_users_path(sort: sort_value_recently_signin, filter: params[:filter]) do
                = sort_title_recently_signin
              = link_to admin_users_path(sort: sort_value_oldest_signin, filter: params[:filter]) do
                = sort_title_oldest_signin
              = link_to admin_users_path(sort: sort_value_recently_created, filter: params[:filter]) do
                = sort_title_recently_created
              = link_to admin_users_path(sort: sort_value_oldest_created, filter: params[:filter]) do
                = sort_title_oldest_created
              = link_to admin_users_path(sort: sort_value_recently_updated, filter: params[:filter]) do
                = sort_title_recently_updated
              = link_to admin_users_path(sort: sort_value_oldest_updated, filter: params[:filter]) do
                = sort_title_oldest_updated
        = link_to 'New user', new_admin_user_path, class: 'btn btn-success btn-search'

    .top-area.scrolling-tabs-container.inner-page-scroll-tabs
      .fade-left
        = icon('angle-left')
      .fade-right
        = icon('angle-right')
      %ul.nav-links.nav.nav-tabs.scrolling-tabs
        = nav_link(html_options: { class: active_when(params[:filter].nil?) }) do
          = link_to admin_users_path do
            Active
            %small.badge.badge-pill= limited_counter_with_delimiter(User.active)
        = nav_link(html_options: { class: active_when(params[:filter] == 'admins') }) do
          = link_to admin_users_path(filter: "admins") do
            Admins
            %small.badge.badge-pill= limited_counter_with_delimiter(User.admins)
        = nav_link(html_options: { class: "#{active_when(params[:filter] == 'two_factor_enabled')} filter-two-factor-enabled" }) do
          = link_to admin_users_path(filter: 'two_factor_enabled') do
            2FA Enabled
            %small.badge.badge-pill= limited_counter_with_delimiter(User.with_two_factor)
        = nav_link(html_options: { class: "#{active_when(params[:filter] == 'two_factor_disabled')} filter-two-factor-disabled" }) do
          = link_to admin_users_path(filter: 'two_factor_disabled') do
            2FA Disabled
            %small.badge.badge-pill= limited_counter_with_delimiter(User.without_two_factor)
        = nav_link(html_options: { class: active_when(params[:filter] == 'external') }) do
          = link_to admin_users_path(filter: 'external') do
            External
            %small.badge.badge-pill= limited_counter_with_delimiter(User.external)
        = nav_link(html_options: { class: active_when(params[:filter] == 'blocked') }) do
          = link_to admin_users_path(filter: "blocked") do
            Blocked
            %small.badge.badge-pill= limited_counter_with_delimiter(User.blocked)
        = nav_link(html_options: { class: active_when(params[:filter] == 'wop') }) do
          = link_to admin_users_path(filter: "wop") do
            Without projects
            %small.badge.badge-pill= limited_counter_with_delimiter(User.without_projects)

  %ul.flex-list.content-list
    - if @users.empty?
      %li
        .nothing-here-block No users found.
    - else
      = render partial: 'admin/users/user', collection: @users

  = paginate @users, theme: "gitlab"

#delete-user-modal