show.html.haml 3.3 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
    - unless @user == current_user
      - if @user.blocked?
15
        = link_to 'Unblock', unblock_admin_user_path(@user), method: :put, class: "btn grouped success"
16
      - else
17
        = link_to 'Block', block_admin_user_path(@user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn grouped btn-remove"
18 19
%hr

20 21
.row
  .span6
22
    .ui-box
23
      .title
24 25
        Account:
        .pull-right
26
          = image_tag gravatar_icon(@user.email, 32), class: "avatar s32"
27 28 29
      %ul.well-list
        %li
          %span.light Name:
30
          %strong= @user.name
31 32 33
        %li
          %span.light Username:
          %strong
34
            = @user.username
35 36 37
        %li
          %span.light Email:
          %strong
38
            = mail_to @user.email
39 40 41 42

        %li
          %span.light Member since:
          %strong
43
            = @user.created_at.stamp("Nov 12, 2031")
44 45 46 47

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

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

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

65 66 67 68 69 70 71 72 73 74 75
    .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
        %li User personal projects will be removed and cannot be restored
        %li Owned groups will be transfered to first admin
      = link_to 'Remove user', [:admin, @user], confirm: "USER #{@user.name} WILL BE REMOVED! Are you sure?", method: :delete, class: "btn btn-remove"

  .span6
76
    - if @user.users_groups.present?
77
      .ui-box
78
        .title Groups:
79
        %ul.well-list
80
          - @user.users_groups.each do |user_group|
81
            - group = user_group.group
82 83
            %li
              %strong= link_to group.name, admin_group_path(group)
84 85
              .pull-right
                %span.light= user_group.human_access
86

87
    .ui-box
88
      .title Projects (#{@projects.count})
89
      %ul.well-list
90
        - @projects.sort_by(&:name_with_namespace).each do |project|
91
          - tm = project.team.find_tm(@user.id)
92 93 94 95 96 97 98
          %li
            = link_to admin_project_path(project), class: dom_class(project) do
              - if project.namespace
                = project.namespace.human_name
                \/
              %strong.well-title
                = truncate(project.name, length: 45)
99 100 101

            - if tm
              .pull-right
102 103 104 105 106 107
                - if tm.owner?
                  %span.light Owner
                - else
                  %span.light= tm.human_access
                  = link_to admin_project_member_path(project, tm.user), confirm: remove_from_project_team_message(project, @user), method: :delete, class: "btn btn-small btn-remove" do
                    %i.icon-remove
108 109