BigW Consortium Gitlab

index.html.haml 3.53 KB
Newer Older
1
.row
2
  .col-md-3
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
    .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
22 23 24
      = 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'
25
        = button_tag class: 'btn btn-primary' do
26
          %i.fa.fa-search
27
      %hr
28
      = link_to 'Reset', admin_users_path, class: "btn btn-cancel"
29

30
  .col-md-9
31
    .panel.panel-default
32
      .panel-heading
33
        Users (#{@users.total_count})
34
        .panel-head-actions
Valery Sizov committed
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
          .dropdown.inline
            %a.dropdown-toggle.btn{href: '#', "data-toggle" => "dropdown"}
              %span.light sort:
              - if @sort.present?
                = @sort.humanize
              - else
                Name
              %b.caret
            %ul.dropdown-menu
              %li
                = link_to admin_users_path(sort: nil) do
                  Name
                = link_to admin_users_path(sort: 'recent_sign_in') do
                  Recent sign in
                = link_to admin_users_path(sort: 'oldest_sign_in') do
                  Oldest sign in
                = link_to admin_users_path(sort: 'recently_created') do
52
                  = sort_title_recently_created
Valery Sizov committed
53
                = link_to admin_users_path(sort: 'late_created') do
54 55
                  = sort_title_oldest_created

56
          = link_to 'New User', new_admin_user_path, class: "btn btn-new"
57
      %ul.well-list
58
        - @users.each do |user|
59
          %li
60 61
            .list-item-name
              - if user.blocked?
62
                %i.fa.fa-lock.cred
63
              - else
64
                %i.fa.fa-user.cgreen
65 66 67 68 69
              = link_to user.name, [:admin, user]
              - if user.admin?
                %strong.cred (Admin)
              - if user == current_user
                %span.cred It's you!
70 71
            .pull-right
              %span.light
72
                %i.fa.fa-envelope
73 74 75 76
                = 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
77
                - if user.blocked?
78 79
                  = link_to 'Unblock', unblock_admin_user_path(user), method: :put, class: "btn btn-small success"
                - else
80 81
                  = 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"
82
    = paginate @users, theme: "gitlab"