Avatar improvements

This commit is contained in:
2017-06-13 00:06:35 +02:00
parent d3f49ad53d
commit 5d97a87152
11 changed files with 171 additions and 145 deletions

View File

@ -4,15 +4,12 @@ component Avatar(user *arn.User)
component AvatarNoLink(user *arn.User)
if user.Avatar != ""
if strings.Contains(user.Avatar, "gravatar.com")
img.user-image(src=user.Avatar + "?s=100&r=x&d=mm", alt=user.Nick)
else
img.user-image(src=user.Avatar, alt=user.Nick)
img.user-image(src=user.Avatar + "/small", alt=user.Nick)
else
SVGAvatar(50)
SVGAvatar
component SVGAvatar(size int)
svg.user-image(width=size, height=size, viewBox="0 0 50 50")
component SVGAvatar
svg.user-image(viewBox="0 0 50 50")
circle.head(cx="25", cy="19", r="10")
circle.body(cx="25", cy="50", r="20")
//- text(x="25", y="44", text-anchor="middle") TODO

View File

@ -1,7 +1,7 @@
component ProfileImage(user *arn.User)
if user.Avatar != ""
img.profile-image(src=user.Avatar + "?s=560&r=x&d=mm", alt="Profile image")
img.profile-image(src=user.Avatar, alt="Profile image")
else
svg.profile-image(width=280, height=280, viewBox="0 0 50 50", alt="Profile image")
svg.profile-image(viewBox="0 0 50 50", alt="Profile image")
circle.head(cx="25", cy="19", r="10")
circle.body(cx="25", cy="50", r="20")

13
mixins/ThreadLink.pixy Normal file
View File

@ -0,0 +1,13 @@
component ThreadLink(thread *arn.Thread)
.thread-link(data-sticky=thread.Sticky)
.post-author.thread-author
Avatar(thread.Author())
.thread-content-container
.thread-content
if thread.Sticky
Icon("thumb-tack")
a.thread-link-title.ajax(href="/threads/" + thread.ID)= thread.Title
.spacer
.thread-reply-count= thread.Replies
.thread-icons
Icon(arn.GetForumIcon(thread.Tags[0]))