show.html.haml 4.9 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 16
.row
  .span6
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

        %li
          %span.light Last sign-in at:
          %strong
50 51
            - if @user.last_sign_in_at
              = @user.last_sign_in_at.stamp("Nov 12, 2031")
52 53
            - else
              never
54

55
        - if @user.ldap_user?
56 57 58
          %li
            %span.light LDAP uid:
            %strong
59
              = @user.extern_uid
60

61
        - if @user.created_by
62 63 64
          %li
            %span.light Created by:
            %strong
65
              = link_to @user.created_by.name, [:admin, @user.created_by]
66

67
    - unless @user == current_user
68 69 70 71 72 73 74 75 76 77 78
      - 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 已提交
79
          = link_to 'Unblock user', unblock_admin_user_path(@user), method: :put, class: "btn btn-new", data: { confirm: 'Are you sure?' }
80 81 82 83 84 85 86 87 88 89 90
      - 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 已提交
91
          = link_to 'Block user', block_admin_user_path(@user), data: { confirm: 'USER WILL BE BLOCKED! Are you sure?' }, method: :put, class: "btn btn-remove"
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106

      .alert.alert-error
        %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 已提交
107
        = link_to 'Remove user', [:admin, @user], data: { confirm: "USER #{@user.name} WILL BE REMOVED! Are you sure?" }, method: :delete, class: "btn btn-remove"
108 109

  .span6
110
    - if @user.users_groups.present?
111
      .ui-box
112
        .title Groups:
113
        %ul.well-list
114
          - @user.users_groups.each do |user_group|
115
            - group = user_group.group
116
            %li.users_group
117
              %strong= link_to group.name, admin_group_path(group)
118 119
              .pull-right
                %span.light= user_group.human_access
120
                - unless user_group.owner?
D
Dmitriy Zaporozhets 已提交
121
                  = 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
122
                    %i.icon-remove.icon-white
123

124
    .ui-box
125
      .title Projects (#{@projects.count})
126
      %ul.well-list
127
        - @projects.sort_by(&:name_with_namespace).each do |project|
128
          - tm = project.team.find_tm(@user.id)
129
          %li.users_project
130
            = link_to admin_project_path(project), class: dom_class(project) do
D
Dmitriy Zaporozhets 已提交
131
              = project.name_with_namespace
132 133 134

            - if tm
              .pull-right
135 136 137 138
                - if tm.owner?
                  %span.light Owner
                - else
                  %span.light= tm.human_access
139 140

                  - if tm.respond_to? :project
D
Dmitriy Zaporozhets 已提交
141
                    = 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
142
                      %i.icon-remove
143 144