2015-04-26 12:48:37 +05:30
|
|
|
- user = member.user
|
|
|
|
- return unless user || member.invite?
|
|
|
|
- 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)}
|
|
|
|
- if member.user
|
2015-10-24 18:46:33 +05:30
|
|
|
= image_tag avatar_icon(user, 16), class: "avatar s16", alt: ''
|
2015-09-11 14:41:01 +05:30
|
|
|
%strong
|
|
|
|
= link_to user.name, user_path(user)
|
2015-04-26 12:48:37 +05:30
|
|
|
%span.cgray= user.username
|
|
|
|
- if user == current_user
|
|
|
|
%span.label.label-success It's you
|
|
|
|
- if user.blocked?
|
|
|
|
%label.label.label-danger
|
|
|
|
%strong Blocked
|
|
|
|
- else
|
|
|
|
= image_tag avatar_icon(member.invite_email, 16), class: "avatar s16", alt: ''
|
|
|
|
%strong
|
|
|
|
= member.invite_email
|
|
|
|
%span.cgray
|
|
|
|
invited
|
|
|
|
- if member.created_by
|
|
|
|
by
|
|
|
|
= link_to member.created_by.name, user_path(member.created_by)
|
|
|
|
= time_ago_with_tooltip(member.created_at)
|
|
|
|
|
2015-09-11 14:41:01 +05:30
|
|
|
- if show_controls && can?(current_user, :admin_group_member, member)
|
2015-04-26 12:48:37 +05:30
|
|
|
= link_to resend_invite_group_group_member_path(@group, member), method: :post, class: "btn-xs btn", title: 'Resend invite' do
|
|
|
|
Resend invite
|
|
|
|
|
|
|
|
- if show_roles
|
|
|
|
%span.pull-right
|
|
|
|
%strong= member.human_access
|
|
|
|
- if show_controls
|
2015-09-11 14:41:01 +05:30
|
|
|
- if can?(current_user, :update_group_member, member)
|
2015-04-26 12:48:37 +05:30
|
|
|
= 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
|
2015-09-11 14:41:01 +05:30
|
|
|
= icon("sign-out")
|
|
|
|
Leave
|
2015-04-26 12:48:37 +05:30
|
|
|
- else
|
|
|
|
= link_to group_group_member_path(@group, member), data: { confirm: remove_user_from_group_message(@group, member) }, 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'
|