Use generic AvatarLink() function

This commit is contained in:
Eduard Urbach 2018-03-05 17:49:24 +01:00
parent b46110a913
commit 5fba65ddc0
6 changed files with 9 additions and 9 deletions

View File

@ -1,4 +1,4 @@
<svg version="1.1" width="50" height="50"> <svg version="1.1" width="50" height="50" xmlns="http://www.w3.org/2000/svg">
<circle cx="25" cy="19" r="10" fill="rgb(60, 60, 60)" /> <circle cx="25" cy="19" r="10" fill="rgb(60, 60, 60)" />
<circle cx="25" cy="50" r="20" fill="rgb(60, 60, 60)" /> <circle cx="25" cy="50" r="20" fill="rgb(60, 60, 60)" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 166 B

After

Width:  |  Height:  |  Size: 200 B

View File

@ -7,13 +7,13 @@ component CustomAvatar(user *arn.User, link string, title string)
component AvatarNoLink(user *arn.User) component AvatarNoLink(user *arn.User)
if user.HasAvatar() if user.HasAvatar()
img.user-image.lazy(data-src=user.SmallAvatar(), data-webp="true", alt=user.Nick) img.user-image.lazy(data-src=user.AvatarLink("small"), data-webp="true", alt=user.Nick)
else else
SVGAvatar(user) SVGAvatar(user)
component ProfileImage(user *arn.User) component ProfileImage(user *arn.User)
if user.HasAvatar() if user.HasAvatar()
img.profile-image.lazy(data-src=user.LargeAvatar(), data-webp="true", alt="Profile image") img.profile-image.lazy(data-src=user.AvatarLink("large"), data-webp="true", alt="Profile image")
else else
SVGProfileImage(user) SVGProfileImage(user)

View File

@ -88,7 +88,7 @@ func Success(ctx *aero.Context) string {
admin.SendNotification(&arn.PushNotification{ admin.SendNotification(&arn.PushNotification{
Title: user.Nick + " bought " + strconv.Itoa(payment.Gems()) + " gems", Title: user.Nick + " bought " + strconv.Itoa(payment.Gems()) + " gems",
Message: user.Nick + " paid " + payment.Amount + " " + payment.Currency + " making his new balance " + strconv.Itoa(user.Balance), Message: user.Nick + " paid " + payment.Amount + " " + payment.Currency + " making his new balance " + strconv.Itoa(user.Balance),
Icon: user.LargeAvatar(), Icon: user.AvatarLink("large"),
Link: "https://" + ctx.App.Config.Domain + "/api/paypalpayment/" + payment.ID, Link: "https://" + ctx.App.Config.Domain + "/api/paypalpayment/" + payment.ID,
Type: arn.NotificationTypePurchase, Type: arn.NotificationTypePurchase,
}) })

View File

@ -31,7 +31,7 @@ func Profile(ctx *aero.Context, viewUser *arn.User) string {
openGraph := &arn.OpenGraph{ openGraph := &arn.OpenGraph{
Tags: map[string]string{ Tags: map[string]string{
"og:title": viewUser.Nick, "og:title": viewUser.Nick,
"og:image": viewUser.LargeAvatar(), "og:image": viewUser.AvatarLink("large"),
"og:url": "https://" + ctx.App.Config.Domain + viewUser.Link(), "og:url": "https://" + ctx.App.Config.Domain + viewUser.Link(),
"og:site_name": "notify.moe", "og:site_name": "notify.moe",
"og:description": viewUser.Tagline, "og:description": viewUser.Tagline,

View File

@ -56,9 +56,9 @@ component SettingsPersonal(user *arn.User)
.profile-image-container.avatar-preview .profile-image-container.avatar-preview
if user.HasAvatar() if user.HasAvatar()
img#avatar-input-preview.profile-image.mountable(src=user.LargeAvatar(), alt="Profile image", title="Recommended: 560 x 560 | PNG or JPG") img#avatar-input-preview.profile-image.mountable(src=user.AvatarLink("large"), alt="Profile image", title="Recommended: 560 x 560 | PNG or JPG")
else else
img#avatar-input-preview.profile-image.hidden(src=user.LargeAvatar(), alt="Profile image", title="Recommended: 560 x 560 | PNG or JPG") img#avatar-input-preview.profile-image.hidden(src=user.AvatarLink("large"), alt="Profile image", title="Recommended: 560 x 560 | PNG or JPG")
#avatar-input-preview-svg #avatar-input-preview-svg
SVGProfileImage(user) SVGProfileImage(user)

View File

@ -32,5 +32,5 @@ func Avatar(ctx *aero.Context) string {
// Save avatar information // Save avatar information
user.Save() user.Save()
return user.SmallAvatar() return user.AvatarLink("small")
} }