diff --git a/pages/profile/profile.pixy b/pages/profile/profile.pixy index 464cda20..641ead74 100644 --- a/pages/profile/profile.pixy +++ b/pages/profile/profile.pixy @@ -2,7 +2,7 @@ component ProfileHeader(viewUser *arn.User, user *arn.User, uri string) .profile img.profile-cover(src=viewUser.CoverImageURL(), alt="Cover image") - .image-container.mountable.never-unmount + .profile-image-container.mountable.never-unmount ProfileImage(viewUser) .intro-container.mountable.never-unmount diff --git a/pages/profile/profile.scarlet b/pages/profile/profile.scarlet index 29cec37b..74ff58a2 100644 --- a/pages/profile/profile.scarlet +++ b/pages/profile/profile.scarlet @@ -68,7 +68,7 @@ profile-boot-duration = 2s width 100% height auto -.image-container +.profile-image-container flex 1 max-width 280px max-height 280px diff --git a/pages/settings/settings.pixy b/pages/settings/settings.pixy index 06c9ec58..bfd0e87c 100644 --- a/pages/settings/settings.pixy +++ b/pages/settings/settings.pixy @@ -106,6 +106,20 @@ component Settings(user *arn.User) a.button(href="https://www.youtube.com/watch?v=opyt4cw0ep8", target="_blank", rel="noopener") Icon("android") 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) //- h3.widget-title diff --git a/pages/settings/settings.scarlet b/pages/settings/settings.scarlet index a773b757..85f1c180 100644 --- a/pages/settings/settings.scarlet +++ b/pages/settings/settings.scarlet @@ -1,4 +1,7 @@ .widget-input button, .button - margin-bottom 1rem \ No newline at end of file + margin-bottom 1rem + +.avatar-preview + margin 0 auto \ No newline at end of file diff --git a/patches/update-user-struct/update-user-struct.go b/patches/update-user-struct/update-user-struct.go new file mode 100644 index 00000000..2045746b --- /dev/null +++ b/patches/update-user-struct/update-user-struct.go @@ -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.") +}