show.html.haml 3.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
%h3.page_title
  User:
  = @admin_user.name
  - if @admin_user.blocked?
    %span.cred (Blocked)
  - if @admin_user.admin
    %span.cred (Admin)

  .pull-right
    = link_to edit_admin_user_path(@admin_user), class: "btn grouped btn-small" do
      %i.icon-edit
      Edit
    - unless @admin_user == current_user
      - if @admin_user.blocked?
        = link_to 'Unblock', unblock_admin_user_path(@admin_user), method: :put, class: "btn grouped btn-small success"
      - else
        = link_to 'Block', block_admin_user_path(@admin_user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn grouped btn-small btn-remove"
      = link_to 'Destroy', [:admin, @admin_user], confirm: "USER #{@admin_user.name} WILL BE REMOVED! Are you sure?", method: :delete, class: "btn grouped btn-small btn-remove"
%hr

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

        %li
          %span.light Member since:
          %strong
            = @admin_user.created_at.stamp("Nov 12, 2031")

        %li
          %span.light Last sign-in at:
          %strong
49 50 51 52
            - if @admin_user.last_sign_in_at
              = @admin_user.last_sign_in_at.stamp("Nov 12, 2031")
            - else
              never
53 54 55 56 57 58 59 60 61 62 63 64 65

        - if @admin_user.ldap_user?
          %li
            %span.light LDAP uid:
            %strong
              = @admin_user.extern_uid

        - if @admin_user.created_by
          %li
            %span.light Created by:
            %strong
              = link_to @admin_user.created_by.name, [:admin, @admin_user.created_by]

66 67 68 69 70 71 72
    - if @admin_user.owned_groups.present?
      .ui-box
        %h5.title Owned groups:
        %ul.well-list
          - @admin_user.groups.each do |group|
            %li
              %strong= link_to group.name, admin_group_path(group)
73

D
Dmitriy Zaporozhets 已提交
74

75

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

            - if project.owner == @admin_user
              %span.label.label-info owner

            - if tm
              .pull-right
                = link_to edit_admin_project_member_path(project, tm.user), class: "btn grouped btn-small" do
96
                  %i.icon-edit
97
                = link_to admin_project_member_path(project, tm.user), confirm: remove_from_project_team_message(project, @admin_user), method: :delete, class: "btn grouped btn-small btn-remove" do
98
                  %i.icon-remove
99 100 101 102

              .pull-right.light
                = tm.project_access_human