show.html.haml 4.4 KB
Newer Older
1
%h3.page-title
2
  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
      %i.icon-edit
      Edit
13 14
    - if @user.blocked?
      = link_to 'Unblock', unblock_admin_user_path(@user), method: :put, class: "btn grouped success"
15 16
%hr

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

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

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

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

69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
    - unless @user == current_user
      .alert
        %h4 Block 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
        = link_to 'Block user', block_admin_user_path(@user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn btn-remove"

      .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(', ')}
        = link_to 'Remove user', [:admin, @user], confirm: "USER #{@user.name} WILL BE REMOVED! Are you sure?", method: :delete, class: "btn btn-remove"
97 98

  .span6
99
    - if @user.users_groups.present?
100
      .ui-box
101
        .title Groups:
102
        %ul.well-list
103
          - @user.users_groups.each do |user_group|
104
            - group = user_group.group
105
            %li.users_group
106
              %strong= link_to group.name, admin_group_path(group)
107 108
              .pull-right
                %span.light= user_group.human_access
109 110 111
                - unless user_group.owner?
                  = link_to group_users_group_path(group, user_group), confirm: remove_user_from_group_message(group, @user), method: :delete, remote: true, class: "btn-tiny btn btn-remove", title: 'Remove user from group' do
                    %i.icon-remove.icon-white
112

113
    .ui-box
114
      .title Projects (#{@projects.count})
115
      %ul.well-list
116
        - @projects.sort_by(&:name_with_namespace).each do |project|
117
          - tm = project.team.find_tm(@user.id)
118
          %li.users_project
119
            = link_to admin_project_path(project), class: dom_class(project) do
D
Dmitriy Zaporozhets 已提交
120
              = project.name_with_namespace
121 122 123

            - if tm
              .pull-right
124 125 126 127
                - if tm.owner?
                  %span.light Owner
                - else
                  %span.light= tm.human_access
128 129 130 131

                  - if tm.respond_to? :project
                    = link_to project_team_member_path(project, @user), confirm: remove_from_project_team_message(project, @user), remote: true, method: :delete, class: "btn-tiny btn btn-remove", title: 'Remove user from project' do
                      %i.icon-remove
132 133