39 lines
1.7 KiB
Text
39 lines
1.7 KiB
Text
- user = member.user
|
|
- return unless user
|
|
- show_roles = true if show_roles.nil?
|
|
|
|
%li{class: "#{dom_class(member)} js-toggle-container", id: dom_id(member)}
|
|
%span{class: ("list-item-name" if show_controls)}
|
|
= image_tag avatar_icon(user.email, 16), class: "avatar s16"
|
|
%strong= user.name
|
|
%span.cgray= user.username
|
|
- if user == current_user
|
|
%span.label.label-success It's you
|
|
- if user.blocked?
|
|
%label.label.label-danger
|
|
%strong Blocked
|
|
|
|
- if show_roles
|
|
%span.pull-right
|
|
%strong= member.human_access
|
|
- if show_controls
|
|
- if can?(current_user, :modify_group_member, member)
|
|
= button_tag class: "btn-xs btn js-toggle-button",
|
|
title: 'Edit access level', type: 'button' do
|
|
%i.fa.fa-pencil-square-o
|
|
- if can?(current_user, :destroy_group_member, member)
|
|
|
|
- if current_user == user
|
|
= link_to leave_group_group_members_path(@group), data: { confirm: leave_group_message(@group.name)}, method: :delete, class: "btn-xs btn btn-remove", title: 'Remove user from group' do
|
|
%i.fa.fa-minus.fa-inverse
|
|
- else
|
|
= link_to group_group_member_path(@group, member), data: { confirm: remove_user_from_group_message(@group, user) }, method: :delete, remote: true, class: "btn-xs btn btn-remove", title: 'Remove user from group' do
|
|
%i.fa.fa-minus.fa-inverse
|
|
|
|
.edit-member.hide.js-toggle-content
|
|
%br
|
|
= form_for [@group, member], remote: true do |f|
|
|
.prepend-top-10
|
|
= f.select :access_level, options_for_select(GroupMember.access_level_roles, member.access_level), {}, class: 'form-control'
|
|
.prepend-top-10
|
|
= f.submit 'Save', class: 'btn btn-save btn-sm'
|