Improved upload scripts

This commit is contained in:
2018-03-03 18:29:39 +01:00
parent 634fed8e87
commit 58b54fe908
5 changed files with 42 additions and 17 deletions

View File

@ -11,6 +11,12 @@ component AvatarNoLink(user *arn.User)
else
SVGAvatar(user)
component ProfileImage(user *arn.User)
if user.HasAvatar()
img.profile-image.lazy(data-src=user.LargeAvatar(), data-webp="true", alt="Profile image")
else
SVGProfileImage(user)
component SVGAvatar(user *arn.User)
svg.user-image(viewBox="0 0 50 50")
circle.head(cx="25", cy="19", r="10")
@ -19,4 +25,9 @@ component SVGAvatar(user *arn.User)
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]
text.svg-nick(x="25", y="44", text-anchor="middle")= user.Nick[:6]
component SVGProfileImage(user *arn.User)
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")

View File

@ -30,7 +30,7 @@ component InputSelection(id string, value string, label string, placeholder stri
each option in options
option(value=option.Value)= option.Label
component InputImage(id string, label string, src string)
component InputImage(id string, label string)
.widget-section
label(for=id)= label + ":"
button.action(data-action="selectFile", data-trigger="click", data-preview-image-id=id + "-preview")

View File

@ -1,7 +0,0 @@
component ProfileImage(user *arn.User)
if user.HasAvatar()
img.profile-image.lazy(data-src=user.LargeAvatar(), data-webp="true", alt="Profile image")
else
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")