show.html.haml 5.2 KB
Newer Older
1
%h3.page-title
2
  %span.cgray User:
3 4
  = @user.name
  - if @user.blocked?
5
    %span.cred (Blocked)
6
  - if @user.admin
7 8 9
    %span.cred (Admin)

  .pull-right
10
    = link_to edit_admin_user_path(@user), class: "btn grouped" do
11 12 13 14
      %i.icon-edit
      Edit
%hr

15
.row
D
Dmitriy Zaporozhets 已提交
16
  .col-md-6
17
    .ui-box
18
      .title
19 20
        Account:
        .pull-right
S
Steven Thonus 已提交
21
          = image_tag avatar_icon(@user.email, 32), class: "avatar s32"
22 23 24
      %ul.well-list
        %li
          %span.light Name:
25
          %strong= @user.name
26 27 28
        %li
          %span.light Username:
          %strong
29
            = @user.username
30 31 32
        %li
          %span.light Email:
          %strong
33
            = mail_to @user.email
34 35 36 37 38 39 40 41
        %li
          %span.light Can create groups:
          %strong
            = @user.can_create_group ? "Yes" : "No"
        %li
          %span.light Personal projects limit:
          %strong
            = @user.projects_limit
42 43 44
        %li
          %span.light Member since:
          %strong
45
            = @user.created_at.stamp("Nov 12, 2031")
46 47 48 49 50 51 52 53 54 55
        - if @user.confirmed_at
          %li
            %span.light Confirmed at:
            %strong
              = @user.confirmed_at.stamp("Nov 12, 2031")
        - else
          %li
            %span.light Confirmed:
            %strong.cred
              No
56 57 58 59

        %li
          %span.light Last sign-in at:
          %strong
60 61
            - if @user.last_sign_in_at
              = @user.last_sign_in_at.stamp("Nov 12, 2031")
62 63
            - else
              never
64

65
        - if @user.ldap_user?
66 67 68
          %li
            %span.light LDAP uid:
            %strong
69
              = @user.extern_uid
70

71
        - if @user.created_by
72 73 74
          %li
            %span.light Created by:
            %strong
75
              = link_to @user.created_by.name, [:admin, @user.created_by]
76

77
    - unless @user == current_user
78 79 80 81 82 83 84 85 86 87 88
      - if @user.blocked?
        .alert.alert-info
          %h4 This user is blocked
          %br
          %p Blocking user has the following effects:
          %ul
            %li User will not be able to login
            %li User will not be able to access git repositories
            %li User will be removed from joined projects and groups
            %li Personal projects will be left
            %li Owned groups will be left
D
Dmitriy Zaporozhets 已提交
89
          = link_to 'Unblock user', unblock_admin_user_path(@user), method: :put, class: "btn btn-new", data: { confirm: 'Are you sure?' }
90 91 92 93 94 95 96 97 98 99 100
      - else
        .alert
          %h4 Block this user
          %br
          %p Blocking user has the following effects:
          %ul
            %li User will not be able to login
            %li User will not be able to access git repositories
            %li User will be removed from joined projects and groups
            %li Personal projects will be left
            %li Owned groups will be left
D
Dmitriy Zaporozhets 已提交
101
          = link_to 'Block user', block_admin_user_path(@user), data: { confirm: 'USER WILL BE BLOCKED! Are you sure?' }, method: :put, class: "btn btn-remove"
102

D
Dmitriy Zaporozhets 已提交
103
      .alert.alert-danger
104 105 106 107 108 109 110 111 112 113 114 115 116
        %h4
          Remove user
        %br
        %p Deleting a user has the following effects:
        %ul
          %li All user content like authored issues, snippets, comments will be removed
          - rp = @user.personal_projects.count
          - unless rp.zero?
            %li #{pluralize rp, 'personal project'} will be removed and cannot be restored
          - if @user.solo_owned_groups.present?
            %li
              Next groups with all content will be removed:
              %strong #{@user.solo_owned_groups.map(&:name).join(', ')}
D
Dmitriy Zaporozhets 已提交
117
        = link_to 'Remove user', [:admin, @user], data: { confirm: "USER #{@user.name} WILL BE REMOVED! Are you sure?" }, method: :delete, class: "btn btn-remove"
118

D
Dmitriy Zaporozhets 已提交
119
  .col-md-6
120
    - if @user.users_groups.present?
121
      .ui-box
122
        .title Groups:
123
        %ul.well-list
124
          - @user.users_groups.each do |user_group|
125
            - group = user_group.group
126
            %li.users_group
127
              %strong= link_to group.name, admin_group_path(group)
128 129
              .pull-right
                %span.light= user_group.human_access
130
                - unless user_group.owner?
D
Dmitriy Zaporozhets 已提交
131
                  = link_to group_users_group_path(group, user_group), data: { confirm: remove_user_from_group_message(group, @user) }, method: :delete, remote: true, class: "btn-tiny btn btn-remove", title: 'Remove user from group' do
132
                    %i.icon-remove.icon-white
133

134
    .ui-box
135
      .title Projects (#{@projects.count})
136
      %ul.well-list
137
        - @projects.sort_by(&:name_with_namespace).each do |project|
138
          - tm = project.team.find_tm(@user.id)
139
          %li.users_project
140
            = link_to admin_project_path(project), class: dom_class(project) do
D
Dmitriy Zaporozhets 已提交
141
              = project.name_with_namespace
142 143 144

            - if tm
              .pull-right
145 146 147 148
                - if tm.owner?
                  %span.light Owner
                - else
                  %span.light= tm.human_access
149 150

                  - if tm.respond_to? :project
D
Dmitriy Zaporozhets 已提交
151
                    = link_to project_team_member_path(project, @user), data: { confirm: remove_from_project_team_message(project, @user) }, remote: true, method: :delete, class: "btn-tiny btn btn-remove", title: 'Remove user from project' do
152
                      %i.icon-remove
153 154