show.html.haml 2.9 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 btn-small" do
11 12
      %i.icon-edit
      Edit
13 14 15
    - unless @user == current_user
      - if @user.blocked?
        = link_to 'Unblock', unblock_admin_user_path(@user), method: :put, class: "btn grouped btn-small success"
16
      - else
17 18
        = link_to 'Block', block_admin_user_path(@user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn grouped btn-small btn-remove"
      = link_to 'Destroy', [:admin, @user], confirm: "USER #{@user.name} WILL BE REMOVED! Are you sure?", method: :delete, class: "btn grouped btn-small btn-remove"
19 20
%hr

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

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

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

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

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

66
    - if @user.users_groups.present?
67
      .ui-box
68
        .title Groups:
69
        %ul.well-list
70
          - @user.users_groups.each do |user_group|
71
            - group = user_group.group
72 73
            %li
              %strong= link_to group.name, admin_group_path(group)
74 75
              .pull-right
                %span.light= user_group.human_access
76

77 78
  .span6
    .ui-box
79
      .title Projects (#{@projects.count})
80
      %ul.well-list
81
        - @projects.sort_by(&:name_with_namespace).each do |project|
82
          - tm = project.team.find_tm(@user.id)
83 84 85 86 87 88 89
          %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)
90 91 92

            - if tm
              .pull-right
93
                %span.light= tm.human_access
94
                = 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
95
                  %i.icon-remove