From 46cc69153482a6138e1057ece9cec836dd95451e Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Mon, 8 Jun 2015 11:47:06 +0200 Subject: Re-factor the avatar system and support avatar uploads The user is now able to upload an avatar, and pick one in a list. This functionality should eventually be abstracted in a community package but we still need to work on a great public API. We rely on collectionFS to manage uploaded avatars. We also removed bengott:avatar which was trying to solve the wrong problem (namely displaying the avatar, which is as simple as displaying an image), and not a avatar system as it should be. Gravatar support is coming (back) soon. We may also want to have a list of default fun avatars the user can choose instead of uploading its own one. --- client/components/users/userAvatar.jade | 38 +++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 9 deletions(-) (limited to 'client/components/users/userAvatar.jade') diff --git a/client/components/users/userAvatar.jade b/client/components/users/userAvatar.jade index 98682eb5..9542f6c4 100644 --- a/client/components/users/userAvatar.jade +++ b/client/components/users/userAvatar.jade @@ -1,22 +1,42 @@ template(name="userAvatar") - .member.js-member(class="{{class}}" title="{{userData.profile.name}} ({{userData.username}})") - +avatar(user=userData size=size) + .member.js-member(title="{{userData.profile.fullname}} ({{userData.username}})") + if userData.profile.avatarUrl + img.avatar.avatar-image(src=userData.profile.avatarUrl) if showStatus span.member-presence-status(class=presenceStatusClassName) span.member-type(class=memberType) - template(name="userPopup") .board-member-menu .mini-profile-info +userAvatar(user=user) - .info - h3.bottom - a.js-profile(href="{{ pathFor route='Profile' username=user.username }}")= user.profile.name - p.quiet.bottom @{{ user.username }} + .info + h3.bottom + a.js-profile(href="{{pathFor route='Profile' username=user.username}}")= user.profile.name + p.quiet.bottom @{{ user.username }} template(name="memberName") - a.inline-object.js-show-mem-menu(href="{{ pathFor route='Profile' username=user.username }}") - = user.profile.name + a.js-show-mem-menu(href="{{pathFor route='Profile' username=user.username}}") + = user.profile.fullname if username | ({{ user.username }}) + +template(name="changeAvatarPopup") + ul.pop-over-list + each uploadedAvatars + li: a.js-select-avatar + .member: .avatar + img.avatar-image(src="{{url avatarUrlOptions}}") + | Uploaded avatar + if isSelected + i.fa.fa-check + p.sub-name + unless isSelected + a.js-delete-avatar + | Delete + | - + = original.name + input.hide.js-upload-avatar-input(accept="image/*;capture=camera" type="file") + button.full.js-upload-avatar + i.fa.fa-upload + | Upload an avatar -- cgit v1.2.3-1-g7c22