2016-11-03 12:29:30 +05:30
|
|
|
- group_link = local_assigns[:group_link]
|
|
|
|
- group = group_link.group
|
|
|
|
- can_admin_member = can?(current_user, :admin_project_member, @project)
|
2017-08-17 22:00:37 +05:30
|
|
|
- dom_id = "group_member_#{group_link.id}"
|
|
|
|
%li.member.group_member{ id: dom_id }
|
|
|
|
%span.list-item-name
|
2018-03-17 18:26:18 +05:30
|
|
|
= group_icon(group, class: "avatar s40", 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)}
|
|
|
|
- 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-11-03 12:29:30 +05:30
|
|
|
.controls.member-controls
|
2018-11-08 19:23:39 +05:30
|
|
|
= 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
|
2017-08-17 22:00:37 +05:30
|
|
|
= 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-11-08 19:23:39 +05:30
|
|
|
.dropdown-menu.dropdown-select.dropdown-menu-right.dropdown-menu-selectable
|
2017-08-17 22:00:37 +05:30
|
|
|
= 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-11-03 12:29:30 +05:30
|
|
|
.prepend-left-5.clearable-input.member-form-control
|
|
|
|
= 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
|
|
|
|
%i.clear-icon.js-clear-input
|
|
|
|
- if can_admin_member
|
2017-09-10 17:25:29 +05:30
|
|
|
= link_to project_group_link_path(@project, group_link),
|
2016-11-03 12:29:30 +05:30
|
|
|
method: :delete,
|
|
|
|
data: { confirm: "Are you sure you want to remove #{group.name}?" },
|
|
|
|
class: 'btn btn-remove prepend-left-10' do
|
2018-11-08 19:23:39 +05:30
|
|
|
%span.d-block.d-sm-none
|
2016-11-03 12:29:30 +05:30
|
|
|
Delete
|
2018-11-08 19:23:39 +05:30
|
|
|
= icon('trash', class: 'd-none d-sm-block')
|