Avatar struct patch
This commit is contained in:
parent
98519b7b02
commit
98c4b90e9f
@ -2,7 +2,7 @@ component ProfileHeader(viewUser *arn.User, user *arn.User, uri string)
|
|||||||
.profile
|
.profile
|
||||||
img.profile-cover(src=viewUser.CoverImageURL(), alt="Cover image")
|
img.profile-cover(src=viewUser.CoverImageURL(), alt="Cover image")
|
||||||
|
|
||||||
.image-container.mountable.never-unmount
|
.profile-image-container.mountable.never-unmount
|
||||||
ProfileImage(viewUser)
|
ProfileImage(viewUser)
|
||||||
|
|
||||||
.intro-container.mountable.never-unmount
|
.intro-container.mountable.never-unmount
|
||||||
|
@ -68,7 +68,7 @@ profile-boot-duration = 2s
|
|||||||
width 100%
|
width 100%
|
||||||
height auto
|
height auto
|
||||||
|
|
||||||
.image-container
|
.profile-image-container
|
||||||
flex 1
|
flex 1
|
||||||
max-width 280px
|
max-width 280px
|
||||||
max-height 280px
|
max-height 280px
|
||||||
|
@ -107,6 +107,20 @@ component Settings(user *arn.User)
|
|||||||
Icon("android")
|
Icon("android")
|
||||||
span Get the Android App
|
span Get the Android App
|
||||||
|
|
||||||
|
.widget.mountable
|
||||||
|
h3.widget-title
|
||||||
|
Icon("picture-o")
|
||||||
|
span Avatar
|
||||||
|
|
||||||
|
.widget-input
|
||||||
|
label(for="AvatarSource") Source:
|
||||||
|
select.widget-element.action(id="AvatarSource", data-field="AvatarSource", value="Gravatar", data-action="save", data-trigger="change")
|
||||||
|
option(value="Gravatar") Gravatar
|
||||||
|
|
||||||
|
if "Gravatar" == "Gravatar"
|
||||||
|
.profile-image-container.avatar-preview
|
||||||
|
img.profile-image(src=user.Gravatar(), alt="Gravatar")
|
||||||
|
|
||||||
//- .widget.mountable(data-api="/api/settings/" + user.ID)
|
//- .widget.mountable(data-api="/api/settings/" + user.ID)
|
||||||
//- h3.widget-title
|
//- h3.widget-title
|
||||||
//- Icon("cogs")
|
//- Icon("cogs")
|
||||||
|
@ -2,3 +2,6 @@
|
|||||||
button,
|
button,
|
||||||
.button
|
.button
|
||||||
margin-bottom 1rem
|
margin-bottom 1rem
|
||||||
|
|
||||||
|
.avatar-preview
|
||||||
|
margin 0 auto
|
24
patches/update-user-struct/update-user-struct.go
Normal file
24
patches/update-user-struct/update-user-struct.go
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/animenotifier/arn"
|
||||||
|
"github.com/fatih/color"
|
||||||
|
"github.com/jinzhu/copier"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
color.Yellow("Updating user struct")
|
||||||
|
|
||||||
|
// Iterate over the stream
|
||||||
|
for user := range arn.MustStreamUsers() {
|
||||||
|
newUser := &arn.UserNew{}
|
||||||
|
|
||||||
|
copier.Copy(newUser, user)
|
||||||
|
newUser.Avatar.Extension = user.Avatar
|
||||||
|
|
||||||
|
// Save in DB
|
||||||
|
arn.PanicOnError(arn.DB.Set("User", user.ID, newUser))
|
||||||
|
}
|
||||||
|
|
||||||
|
color.Green("Finished.")
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user