gitlab-org--gitlab-foss/app/views/admin/users/projects.html.haml

52 lines
2.3 KiB
Text

- add_to_breadcrumbs _("Users"), admin_users_path
- breadcrumb_title @user.name
- page_title _("Groups and projects"), @user.name, _("Users")
= render 'admin/users/head'
- if @user.groups.any?
.card
.card-header= _('Group projects')
%ul.hover-list
- @user.group_members.includes(:source).each do |group_member| # rubocop: disable CodeReuse/ActiveRecord
- group = group_member.group
%li.group_member
%strong= link_to group.name, admin_group_path(group)
– access to
#{pluralize(group.projects.count, 'project')}
.float-right
%span.light.vertical-align-middle= group_member.human_access
- unless group_member.owner?
= link_to group_group_member_path(group, group_member), data: { confirm: remove_member_message(group_member), testid: 'remove-user' }, method: :delete, remote: true, class: "btn btn-sm btn-danger gl-button btn-icon gl-ml-3", title: _('Remove user from group') do
= sprite_icon('remove', size: 16, css_class: 'gl-icon')
.row
.col-md-6
- if @personal_projects.present?
= render 'admin/users/projects', projects: @personal_projects
- else
.nothing-here-block= _('This user has no personal projects.')
.col-md-6
.card
.card-header= _('Joined projects (%{projects_count})') % { projects_count: @joined_projects.count }
%ul.hover-list
- @joined_projects.sort_by(&:full_name).each do |project|
- member = project.team.find_member(@user.id)
%li.project_member
.list-item-name
= link_to admin_project_path(project), class: dom_class(project) do
= project.full_name
- if member
.float-right
- if member.owner?
%span.light= _('Owner')
- else
%span.light.vertical-align-middle= member.human_access
- if member.respond_to? :project
= link_to project_project_member_path(project, member), data: { confirm: remove_member_message(member) }, remote: true, method: :delete, class: "btn btn-sm btn-danger gl-button btn-icon gl-ml-3", title: _('Remove user from project') do
= sprite_icon('remove', size: 16, css_class: 'gl-icon')
= render partial: 'admin/users/modals'