2018-06-09 02:45:05 -04:00
|
|
|
- add_to_breadcrumbs "Users", admin_users_path
|
|
|
|
- breadcrumb_title @user.name
|
2016-12-28 17:22:57 -05:00
|
|
|
- page_title "Groups and projects", @user.name, "Users"
|
2015-06-22 11:12:20 -04:00
|
|
|
= render 'admin/users/head'
|
|
|
|
|
|
|
|
- if @user.groups.any?
|
2018-04-10 13:11:34 -04:00
|
|
|
.card
|
|
|
|
.card-header Group projects
|
2018-05-29 11:08:35 -04:00
|
|
|
%ul.hover-list
|
2018-08-27 11:31:01 -04:00
|
|
|
- @user.group_members.includes(:source).each do |group_member| # rubocop: disable CodeReuse/ActiveRecord
|
2016-12-28 17:22:57 -05:00
|
|
|
- group = group_member.group
|
|
|
|
%li.group_member
|
2016-11-28 12:14:05 -05:00
|
|
|
%strong= link_to group.name, admin_group_path(group)
|
2015-06-22 11:12:20 -04:00
|
|
|
– access to
|
|
|
|
#{pluralize(group.projects.count, 'project')}
|
2018-04-09 13:42:45 -04:00
|
|
|
.float-right
|
2016-12-28 17:22:57 -05:00
|
|
|
%span.light.vertical-align-middle= group_member.human_access
|
|
|
|
- unless group_member.owner?
|
2018-04-12 17:13:36 -04:00
|
|
|
= link_to group_group_member_path(group, group_member), data: { confirm: remove_member_message(group_member) }, method: :delete, remote: true, class: "btn-sm btn btn-remove prepend-left-10", title: 'Remove user from group' do
|
2016-12-28 17:22:57 -05:00
|
|
|
%i.fa.fa-times.fa-inverse
|
2015-06-22 11:12:20 -04:00
|
|
|
|
|
|
|
.row
|
|
|
|
.col-md-6
|
|
|
|
- if @personal_projects.present?
|
2015-11-25 17:00:35 -05:00
|
|
|
= render 'admin/users/projects', projects: @personal_projects
|
2015-06-22 11:12:20 -04:00
|
|
|
- else
|
|
|
|
.nothing-here-block This user has no personal projects.
|
|
|
|
|
|
|
|
|
|
|
|
.col-md-6
|
2018-04-10 13:11:34 -04:00
|
|
|
.card
|
|
|
|
.card-header Joined projects (#{@joined_projects.count})
|
2018-05-29 11:08:35 -04:00
|
|
|
%ul.hover-list
|
2018-03-05 08:45:35 -05:00
|
|
|
- @joined_projects.sort_by(&:full_name).each do |project|
|
2015-06-22 11:12:20 -04:00
|
|
|
- member = project.team.find_member(@user.id)
|
|
|
|
%li.project_member
|
|
|
|
.list-item-name
|
2017-06-29 13:06:35 -04:00
|
|
|
= link_to admin_project_path(project), class: dom_class(project) do
|
2018-03-05 08:45:35 -05:00
|
|
|
= project.full_name
|
2015-06-22 11:12:20 -04:00
|
|
|
|
|
|
|
- if member
|
2018-04-09 13:42:45 -04:00
|
|
|
.float-right
|
2015-06-22 11:12:20 -04:00
|
|
|
- if member.owner?
|
|
|
|
%span.light Owner
|
|
|
|
- else
|
2016-12-28 17:22:57 -05:00
|
|
|
%span.light.vertical-align-middle= member.human_access
|
2015-06-22 11:12:20 -04:00
|
|
|
|
|
|
|
- if member.respond_to? :project
|
2018-04-12 17:13:36 -04:00
|
|
|
= link_to project_project_member_path(project, member), data: { confirm: remove_member_message(member) }, remote: true, method: :delete, class: "btn-sm btn btn-remove prepend-left-10", title: 'Remove user from project' do
|
2015-06-22 11:12:20 -04:00
|
|
|
%i.fa.fa-times
|