2016-11-03 12:29:30 +05:30
|
|
|
- group_link = local_assigns[:group_link]
|
2020-03-13 15:44:24 +05:30
|
|
|
- group = group_link.shared_with_group
|
|
|
|
- can_admin_member = local_assigns[:can_admin_member]
|
|
|
|
- group_link_path = local_assigns[:group_link_path]
|
2017-08-17 22:00:37 +05:30
|
|
|
- dom_id = "group_member_#{group_link.id}"
|
2019-09-04 21:01:54 +05:30
|
|
|
|
|
|
|
-# Note this is just for groups. For individual members please see shared/members/_member
|
|
|
|
|
2021-01-03 14:25:43 +05:30
|
|
|
%li.member.js-member.group_member.py-2.px-3.d-flex.flex-column.flex-md-row{ id: dom_id, data: { qa_selector: 'group_row' } }
|
2019-09-04 21:01:54 +05:30
|
|
|
%span.list-item-name.mb-2.m-md-0
|
|
|
|
= group_icon(group, class: "avatar s40 flex-shrink-0 flex-grow-0", alt: '')
|
2018-11-08 19:23:39 +05:30
|
|
|
.user-info
|
|
|
|
= link_to group.full_name, group_path(group), class: 'member'
|
|
|
|
.cgray
|
|
|
|
Given access #{time_ago_with_tooltip(group_link.created_at)}
|
2021-01-03 14:25:43 +05:30
|
|
|
%span.js-expires-in{ class: ('gl-display-none' unless group_link.expires?) }
|
|
|
|
·
|
|
|
|
%span.js-expires-in-text{ class: ('text-warning' if group_link.expires_soon?) }
|
|
|
|
- if group_link.expires?
|
|
|
|
= _("Expires in %{expires_at}").html_safe % { expires_at: distance_of_time_in_words_to_now(group_link.expires_at) }
|
2019-09-04 21:01:54 +05:30
|
|
|
.controls.member-controls.align-items-center
|
2020-03-13 15:44:24 +05:30
|
|
|
= form_tag group_link_path, method: :put, remote: true, class: 'js-edit-member-form form-group d-sm-flex' do
|
2017-08-17 22:00:37 +05:30
|
|
|
= hidden_field_tag "group_link[group_access]", group_link.group_access
|
2019-09-04 21:01:54 +05:30
|
|
|
.member-form-control.dropdown.mr-sm-2.d-sm-inline-block
|
2017-08-17 22:00:37 +05:30
|
|
|
%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
|
2021-02-22 17:27:13 +05:30
|
|
|
= sprite_icon("chevron-down", css_class: "dropdown-menu-toggle-icon gl-top-3")
|
2018-11-08 19:23:39 +05:30
|
|
|
.dropdown-menu.dropdown-select.dropdown-menu-right.dropdown-menu-selectable
|
2019-02-15 15:39:39 +05:30
|
|
|
= dropdown_title(_("Change permissions"))
|
2017-08-17 22:00:37 +05:30
|
|
|
.dropdown-content
|
|
|
|
%ul
|
2020-03-13 15:44:24 +05:30
|
|
|
- Gitlab::Access.options_with_owner.each do |role, role_id|
|
2017-08-17 22:00:37 +05:30
|
|
|
%li
|
2019-12-04 20:38:33 +05:30
|
|
|
= link_to role, '#',
|
2017-08-17 22:00:37 +05:30
|
|
|
class: ("is-active" if group_link.group_access == role_id),
|
|
|
|
data: { id: role_id, el_id: dom_id }
|
2019-09-04 21:01:54 +05:30
|
|
|
.clearable-input.member-form-control.d-sm-inline-block
|
2019-02-15 15:39:39 +05:30
|
|
|
= 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
|
2020-11-24 15:15:51 +05:30
|
|
|
= sprite_icon('close', size: 16, css_class: 'clear-icon js-clear-input gl-text-gray-200')
|
2016-11-03 12:29:30 +05:30
|
|
|
- if can_admin_member
|
2020-03-13 15:44:24 +05:30
|
|
|
= link_to group_link_path,
|
2016-11-03 12:29:30 +05:30
|
|
|
method: :delete,
|
2019-12-04 20:38:33 +05:30
|
|
|
data: { confirm: _("Are you sure you want to remove %{group_name}?") % { group_name: group.name }, qa_selector: 'delete_group_access_link' },
|
2021-01-03 14:25:43 +05:30
|
|
|
class: 'gl-button btn btn-danger m-0 ml-sm-2 align-self-center' do
|
2018-11-08 19:23:39 +05:30
|
|
|
%span.d-block.d-sm-none
|
2019-02-15 15:39:39 +05:30
|
|
|
= _("Delete")
|
2020-10-24 23:57:45 +05:30
|
|
|
= sprite_icon('remove', css_class: 'd-none d-sm-block')
|