debian-mirror-gitlab/app/views/admin/users/show.html.haml

228 lines
8.2 KiB
Text
Raw Normal View History

2014-09-02 18:07:02 +05:30
%h3.page-title
User:
= @user.name
- if @user.blocked?
%span.cred (Blocked)
- if @user.admin
%span.cred (Admin)
.pull-right
= link_to edit_admin_user_path(@user), class: "btn btn-grouped" do
2015-04-26 12:48:37 +05:30
%i.fa.fa-pencil-square-o
2014-09-02 18:07:02 +05:30
Edit
%hr
%ul.nav.nav-tabs
%li.active
%a{"data-toggle" => "tab", href: "#account"} Account
%li
%a{"data-toggle" => "tab", href: "#profile"} Profile
%li
%a{"data-toggle" => "tab", href: "#groups"} Groups
%li
%a{"data-toggle" => "tab", href: "#projects"} Projects
2015-04-26 12:48:37 +05:30
%li
%a{"data-toggle" => "tab", href: "#ssh-keys"} SSH keys
2014-09-02 18:07:02 +05:30
.tab-content
#account.tab-pane.active
.row
.col-md-6
.panel.panel-default
.panel-heading
Account:
%ul.well-list
%li
%span.light Name:
%strong= @user.name
%li
%span.light Username:
%strong
= @user.username
%li
%span.light Email:
%strong
= mail_to @user.email
- @user.emails.each do |email|
%li
%span.light Secondary email:
%strong= email.email
2015-04-26 12:48:37 +05:30
= link_to remove_email_admin_user_path(@user, email), data: { confirm: "Are you sure you want to remove #{email.email}?" }, method: :delete, class: "btn-xs btn btn-remove pull-right", title: 'Remove secondary email', id: "remove_email_#{email.id}" do
%i.fa.fa-times
2014-09-02 18:07:02 +05:30
%li
%span.light Can create groups:
%strong
= @user.can_create_group ? "Yes" : "No"
%li
%span.light Personal projects limit:
%strong
= @user.projects_limit
%li
%span.light Member since:
%strong
= @user.created_at.stamp("Nov 12, 2031")
- if @user.confirmed_at
%li
%span.light Confirmed at:
%strong
= @user.confirmed_at.stamp("Nov 12, 2031")
- else
%li
%span.light Confirmed:
%strong.cred
No
2015-04-26 12:48:37 +05:30
%li
%span.light Current sign-in at:
%strong
- if @user.current_sign_in_at
= @user.current_sign_in_at.stamp("Nov 12, 2031")
- else
never
2014-09-02 18:07:02 +05:30
%li
%span.light Last sign-in at:
%strong
- if @user.last_sign_in_at
= @user.last_sign_in_at.stamp("Nov 12, 2031")
- else
never
2015-04-26 12:48:37 +05:30
%li
%span.light Sign-in count:
%strong
= @user.sign_in_count
2014-09-02 18:07:02 +05:30
- if @user.ldap_user?
%li
%span.light LDAP uid:
%strong
2015-04-26 12:48:37 +05:30
= @user.ldap_identity.extern_uid
2014-09-02 18:07:02 +05:30
- if @user.created_by
%li
%span.light Created by:
%strong
= link_to @user.created_by.name, [:admin, @user.created_by]
.col-md-6
- unless @user == current_user
- if @user.blocked?
2015-04-26 12:48:37 +05:30
.panel.panel-info
.panel-heading
This user is blocked
.panel-body
%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 Personal projects will be left
%li Owned groups will be left
%br
= link_to 'Unblock user', unblock_admin_user_path(@user), method: :put, class: "btn btn-info", data: { confirm: 'Are you sure?' }
2014-09-02 18:07:02 +05:30
- else
2015-04-26 12:48:37 +05:30
.panel.panel-warning
.panel-heading
Block this user
.panel-body
%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
%br
= link_to 'Block user', block_admin_user_path(@user), data: { confirm: 'USER WILL BE BLOCKED! Are you sure?' }, method: :put, class: "btn btn-warning"
2014-09-02 18:07:02 +05:30
2015-04-26 12:48:37 +05:30
.panel.panel-danger
.panel-heading
2014-09-02 18:07:02 +05:30
Remove user
2015-04-26 12:48:37 +05:30
.panel-body
%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(', ')}
%br
= link_to 'Remove user', [:admin, @user], data: { confirm: "USER #{@user.name} WILL BE REMOVED! Are you sure?" }, method: :delete, class: "btn btn-remove"
2014-09-02 18:07:02 +05:30
#profile.tab-pane
.row
.col-md-6
.panel.panel-default
.panel-heading
= @user.name
%ul.well-list
%li
= image_tag avatar_icon(@user.email, 60), class: "avatar s60"
%li
%span.light Profile page:
%strong
= link_to user_path(@user) do
= @user.username
.col-md-6
= render 'users/profile', user: @user
#groups.tab-pane
2015-04-26 12:48:37 +05:30
- if @user.group_members.present?
2014-09-02 18:07:02 +05:30
.panel.panel-default
.panel-heading Groups:
%ul.well-list
2015-04-26 12:48:37 +05:30
- @user.group_members.each do |group_member|
- group = group_member.group
%li.group_member
%span{class: ("list-item-name" unless group_member.owner?)}
2014-09-02 18:07:02 +05:30
%strong= link_to group.name, admin_group_path(group)
.pull-right
2015-04-26 12:48:37 +05:30
%span.light= group_member.human_access
- unless group_member.owner?
= link_to group_group_member_path(group, group_member), data: { confirm: remove_user_from_group_message(group, group_member) }, method: :delete, remote: true, class: "btn-xs btn btn-remove", title: 'Remove user from group' do
%i.fa.fa-times.fa-inverse
2014-09-02 18:07:02 +05:30
- else
.nothing-here-block This user has no groups.
#projects.tab-pane
- if @user.groups.any?
.panel.panel-default
.panel-heading Group projects
%ul.well-list
- @user.groups.each do |group|
%li
%strong= group.name
– access to
#{pluralize(group.projects.count, 'project')}
.row
.col-md-6
= render 'users/projects', projects: @personal_projects
.col-md-6
.panel.panel-default
.panel-heading Joined projects (#{@joined_projects.count})
%ul.well-list
- @joined_projects.sort_by(&:name_with_namespace).each do |project|
2015-04-26 12:48:37 +05:30
- member = project.team.find_member(@user.id)
%li.project_member
2014-09-02 18:07:02 +05:30
.list-item-name
2015-04-26 12:48:37 +05:30
= link_to admin_namespace_project_path(project.namespace, project), class: dom_class(project) do
2014-09-02 18:07:02 +05:30
= project.name_with_namespace
2015-04-26 12:48:37 +05:30
- if member
2014-09-02 18:07:02 +05:30
.pull-right
2015-04-26 12:48:37 +05:30
- if member.owner?
2014-09-02 18:07:02 +05:30
%span.light Owner
- else
2015-04-26 12:48:37 +05:30
%span.light= member.human_access
2014-09-02 18:07:02 +05:30
2015-04-26 12:48:37 +05:30
- if member.respond_to? :project
= link_to namespace_project_project_member_path(project.namespace, project, member), data: { confirm: remove_from_project_team_message(project, member) }, remote: true, method: :delete, class: "btn-xs btn btn-remove", title: 'Remove user from project' do
%i.fa.fa-times
#ssh-keys.tab-pane
= render 'profiles/keys/key_table', admin: true