22 lines
693 B
Plaintext
22 lines
693 B
Plaintext
component Avatar(user *arn.User)
|
|
CustomAvatar(user, user.Link(), user.Nick)
|
|
|
|
component CustomAvatar(user *arn.User, link string, title string)
|
|
a.user.ajax(href=link, title=title)
|
|
AvatarNoLink(user)
|
|
|
|
component AvatarNoLink(user *arn.User)
|
|
if user.HasAvatar()
|
|
img.user-image.lazy(data-src=user.SmallAvatar(), data-webp="true", alt=user.Nick)
|
|
else
|
|
SVGAvatar(user)
|
|
|
|
component SVGAvatar(user *arn.User)
|
|
svg.user-image(viewBox="0 0 50 50")
|
|
circle.head(cx="25", cy="19", r="10")
|
|
circle.body(cx="25", cy="50", r="20")
|
|
|
|
if len(user.Nick) <= 6
|
|
text.svg-nick(x="25", y="44", text-anchor="middle")= user.Nick
|
|
else
|
|
text.svg-nick(x="25", y="44", text-anchor="middle")= user.Nick[:6] |