2016-09-01 08:48:20 -04:00
|
|
|
- group_link = local_assigns[:group_link]
|
2016-10-06 10:41:00 -04:00
|
|
|
- group = group_link.group
|
|
|
|
- can_admin_member = can?(current_user, :admin_project_member, @project)
|
2016-12-09 05:06:02 -05:00
|
|
|
- dom_id = "group_member_#{group_link.id}"
|
|
|
|
%li.member.group_member{ id: dom_id }
|
2016-12-22 06:00:09 -05:00
|
|
|
%span.list-item-name
|
2017-10-02 07:35:01 -04:00
|
|
|
= group_icon(group, class: "avatar s40", alt: '')
|
2018-06-06 18:55:18 -04:00
|
|
|
.user-info
|
|
|
|
= link_to group.full_name, group_path(group), class: 'member'
|
|
|
|
.cgray
|
|
|
|
Given access #{time_ago_with_tooltip(group_link.created_at)}
|
|
|
|
- if group_link.expires?
|
|
|
|
·
|
|
|
|
%span{ class: ('text-warning' if group_link.expires_soon?) }
|
|
|
|
Expires in #{distance_of_time_in_words_to_now(group_link.expires_at)}
|
2016-09-01 08:48:20 -04:00
|
|
|
.controls.member-controls
|
2018-06-06 18:55:18 -04:00
|
|
|
= form_tag project_group_link_path(@project, group_link), method: :put, remote: true, class: 'js-edit-member-form form-group row append-right-5' do
|
2016-12-09 05:06:02 -05:00
|
|
|
= hidden_field_tag "group_link[group_access]", group_link.group_access
|
|
|
|
.member-form-control.dropdown.append-right-5
|
|
|
|
%button.dropdown-menu-toggle.js-member-permissions-dropdown{ type: "button",
|
|
|
|
disabled: !can_admin_member,
|
|
|
|
data: { toggle: "dropdown", field_name: "group_link[group_access]" } }
|
|
|
|
%span.dropdown-toggle-text
|
|
|
|
= group_link.human_access
|
|
|
|
= icon("chevron-down")
|
2018-04-17 13:18:41 -04:00
|
|
|
.dropdown-menu.dropdown-select.dropdown-menu-right.dropdown-menu-selectable
|
2016-12-09 05:06:02 -05:00
|
|
|
= dropdown_title("Change permissions")
|
|
|
|
.dropdown-content
|
|
|
|
%ul
|
|
|
|
- Gitlab::Access.options.each do |role, role_id|
|
|
|
|
%li
|
|
|
|
= link_to role, "javascript:void(0)",
|
|
|
|
class: ("is-active" if group_link.group_access == role_id),
|
|
|
|
data: { id: role_id, el_id: dom_id }
|
2016-09-02 04:25:53 -04:00
|
|
|
.prepend-left-5.clearable-input.member-form-control
|
2016-10-06 10:41:00 -04:00
|
|
|
= text_field_tag 'group_link[expires_at]', group_link.expires_at, class: 'form-control js-access-expiration-date js-member-update-control', placeholder: 'Expiration date', id: "member_expires_at_#{group.id}", disabled: !can_admin_member
|
2016-09-01 08:48:20 -04:00
|
|
|
%i.clear-icon.js-clear-input
|
2016-10-06 10:41:00 -04:00
|
|
|
- if can_admin_member
|
2017-06-29 13:06:35 -04:00
|
|
|
= link_to project_group_link_path(@project, group_link),
|
2016-09-02 04:25:53 -04:00
|
|
|
method: :delete,
|
2016-09-06 11:20:20 -04:00
|
|
|
data: { confirm: "Are you sure you want to remove #{group.name}?" },
|
2016-09-02 04:25:53 -04:00
|
|
|
class: 'btn btn-remove prepend-left-10' do
|
2018-04-09 15:38:44 -04:00
|
|
|
%span.d-block.d-sm-none
|
2016-09-02 04:25:53 -04:00
|
|
|
Delete
|
2018-04-09 17:50:40 -04:00
|
|
|
= icon('trash', class: 'd-none d-sm-block')
|