From 8cf9ec266055f065c428216d53018c83b63675c6 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Fri, 19 Jun 2015 14:39:38 +0200 Subject: Allow a user to edit its profile or avatar from a member popover Fixes the data context on the member popover in the details pane. Also change the way Popover detect if the click is initiated from a parent popover -- from reading Blaze context, to looking at the event target parents. --- client/components/users/userAvatar.jade | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'client/components/users/userAvatar.jade') diff --git a/client/components/users/userAvatar.jade b/client/components/users/userAvatar.jade index 2ea3aa20..d6527a5d 100644 --- a/client/components/users/userAvatar.jade +++ b/client/components/users/userAvatar.jade @@ -9,6 +9,11 @@ template(name="userAvatar") span.member-presence-status(class=presenceStatusClassName) span.member-type(class=memberType) + if showEdit + if $eq currentUser._id userData._id + a.edit-avatar.js-change-avatar + i.fa.fa-pencil + template(name="userAvatarInitials") svg.avatar.avatar-initials(viewBox="0 0 {{viewPortWidth}} 15") text(x="0" y="13")= initials @@ -18,9 +23,8 @@ template(name="userPopup") .mini-profile-info +userAvatar(userId=user._id) .info - h3.bottom - = user.profile.fullname - p.quiet.bottom @{{ user.username }} + h3= user.profile.fullname + p.quiet @{{ user.username }} template(name="memberName") if showBoth @@ -61,10 +65,14 @@ template(name="changeAvatarPopup") template(name="cardMemberPopup") .board-member-menu .mini-profile-info - +userAvatar(userId=user._id) + +userAvatar(userId=user._id showEdit=true) .info - h3.bottom= user.profile.fullname - p.quiet.bottom @{{ user.username }} + h3= user.profile.fullname + p.quiet @{{ user.username }} if currentUser.isBoardMember ul.pop-over-list li: a.js-remove-member {{_ 'remove-member-from-card'}} + + if $eq currentUser._id user._id + with currentUser + li: a.js-edit-profile Edit Profile -- cgit v1.2.3-1-g7c22