summaryrefslogtreecommitdiffstats
path: root/client/components/users/userAvatar.jade
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-06-10 17:10:32 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-06-10 17:10:32 +0200
commit765b0168eaaeb28550dfb698de0b6cec9f9c2113 (patch)
treee9e7c6545e35042e3086262684a8128e95f5666f /client/components/users/userAvatar.jade
parent0b6c229b6cec2329752013393e83ebd122e3d2eb (diff)
downloadwekan-765b0168eaaeb28550dfb698de0b6cec9f9c2113.tar.gz
wekan-765b0168eaaeb28550dfb698de0b6cec9f9c2113.tar.bz2
wekan-765b0168eaaeb28550dfb698de0b6cec9f9c2113.zip
(Re-)implement default avatar using user initials
We use a embedded svg to scale the initials text to its container size. The user is free to overwrite its initials in the profile form.
Diffstat (limited to 'client/components/users/userAvatar.jade')
-rw-r--r--client/components/users/userAvatar.jade22
1 files changed, 18 insertions, 4 deletions
diff --git a/client/components/users/userAvatar.jade b/client/components/users/userAvatar.jade
index 9542f6c4..4c0e5c63 100644
--- a/client/components/users/userAvatar.jade
+++ b/client/components/users/userAvatar.jade
@@ -1,15 +1,22 @@
template(name="userAvatar")
- .member.js-member(title="{{userData.profile.fullname}} ({{userData.username}})")
+ a.member.js-member(title="{{userData.profile.fullname}} ({{userData.username}})")
if userData.profile.avatarUrl
img.avatar.avatar-image(src=userData.profile.avatarUrl)
+ else
+ +userAvatarInitials(userId=userData._id)
+
if showStatus
span.member-presence-status(class=presenceStatusClassName)
span.member-type(class=memberType)
+template(name="userAvatarInitials")
+ svg.avatar.avatar-initials(viewBox="0 0 {{viewPortWidth}} 15")
+ text(x="0" y="13")= initials
+
template(name="userPopup")
.board-member-menu
.mini-profile-info
- +userAvatar(user=user)
+ +userAvatar(userId=user._id)
.info
h3.bottom
a.js-profile(href="{{pathFor route='Profile' username=user.username}}")= user.profile.name
@@ -25,8 +32,8 @@ template(name="changeAvatarPopup")
ul.pop-over-list
each uploadedAvatars
li: a.js-select-avatar
- .member: .avatar
- img.avatar-image(src="{{url avatarUrlOptions}}")
+ .member
+ img.avatar.avatar-image(src="{{url avatarUrlOptions}}")
| Uploaded avatar
if isSelected
i.fa.fa-check
@@ -36,6 +43,13 @@ template(name="changeAvatarPopup")
| Delete
| -
= original.name
+ li: a.js-select-initials
+ .member
+ +userAvatarInitials(userId=currentUser._id)
+ | Initials
+ if noAvatarUrl
+ i.fa.fa-check
+ p.sub-name Default avatar
input.hide.js-upload-avatar-input(accept="image/*;capture=camera" type="file")
button.full.js-upload-avatar
i.fa.fa-upload