summaryrefslogtreecommitdiff
path: root/app/views/admin/users/projects.html.haml
blob: e6da81831ab38b76032a273bab9bd68b2f7e0fb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
49
50
- 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) }, method: :delete, remote: true, class: "btn-sm btn btn-remove prepend-left-10", title: 'Remove user from group' do
                %i.fa.fa-times.fa-inverse

.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 (#{@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-sm btn btn-remove prepend-left-10", title: 'Remove user from project' do
                      %i.fa.fa-times