OSDN Git Service

5bc73d11f31cffe74d84745500303795d1d71346
[wvm/gitlab.git] / app / views / admin / users / index.html.haml
1 .row
2   .span3
3     .admin-filter
4       = form_tag admin_users_path, method: :get, class: 'form-inline' do
5         = search_field_tag :name, params[:name], placeholder: 'Name, email or username', class: 'input-xpadding span2'
6         = button_tag type: 'submit', class: 'btn btn-primary' do
7           %i.icon-search
8       %ul.nav.nav-pills.nav-stacked
9         %li{class: "#{'active' unless params[:filter]}"}
10           = link_to admin_users_path do
11             Active
12             %small.pull-right= User.active.count
13         %li{class: "#{'active' if params[:filter] == "admins"}"}
14           = link_to admin_users_path(filter: "admins") do
15             Admins
16             %small.pull-right= User.admins.count
17         %li{class: "#{'active' if params[:filter] == "blocked"}"}
18           = link_to admin_users_path(filter: "blocked") do
19             Blocked
20             %small.pull-right= User.blocked.count
21         %li{class: "#{'active' if params[:filter] == "wop"}"}
22           = link_to admin_users_path(filter: "wop") do
23             Without projects
24             %small.pull-right= User.without_projects.count
25       %hr
26       = link_to 'Reset', admin_users_path, class: "btn btn-cancel"
27
28   .span9
29     .ui-box
30       .title
31         Users (#{@users.total_count})
32         .pull-right
33           = link_to 'New User', new_admin_user_path, class: "btn btn-new"
34       %ul.well-list
35         - @users.each do |user|
36           %li
37             - if user.blocked?
38               %i.icon-lock.cred
39             - else
40               %i.icon-user.cgreen
41             = link_to user.name, [:admin, user]
42             - if user.admin?
43               %strong.cred (Admin)
44             - if user == current_user
45               %span.cred It's you!
46             .pull-right
47               %span.light
48                 %i.icon-envelope
49                 = mail_to user.email, user.email, class: 'light'
50                
51               = link_to 'Edit', edit_admin_user_path(user), id: "edit_#{dom_id(user)}", class: "btn btn-small"
52               - unless user == current_user
53                 - if user.blocked?
54                   = link_to 'Unblock', unblock_admin_user_path(user), method: :put, class: "btn btn-small success"
55                 - else
56                   = 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"
57                 = 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"
58     = paginate @users, theme: "gitlab"