BigW Consortium Gitlab

index.html.haml 2.53 KB
Newer Older
randx committed
1
%h3.page_title
2
  Users
3
  = link_to 'New User', new_admin_user_path, class: "btn btn-small pull-right"
randx committed
4
%br
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
.row
  .span3
    .admin-filter
      = form_tag admin_users_path, method: :get, class: 'form-inline' do
        = search_field_tag :name, params[:name], placeholder: 'Name, email or username', class: 'search-text-input span2'
        = button_tag type: 'submit', class: 'btn' do
          %i.icon-search
      %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
      = link_to 'Reset', admin_users_path, class: "btn btn-cancel"
32

33 34 35
  .span9
    .ui-box
      %h5.title
36
        Users (#{@users.total_count})
37
      %ul.well-list
38
        - @users.each do |user|
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
          %li
            - if user.blocked?
              %i.icon-lock.cred
            - else
              %i.icon-user.cgreen
            = 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
                %i.icon-envelope
                = 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
56
                - if user.blocked?
57 58 59 60
                  = link_to 'Unblock', unblock_admin_user_path(user), method: :put, class: "btn btn-small success"
                - else
                  = link_to 'Block', block_admin_user_path(user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn btn-small btn-remove"
                = link_to 'Destroy', [:admin, user], confirm: "USER #{user.name} WILL BE REMOVED! Are you sure?", method: :delete, class: "btn btn-small btn-remove"
61
      = paginate @users, theme: "gitlab"