From fd643114b6cdd306a5501a529db0ae7342d8c1f5 Mon Sep 17 00:00:00 2001 From: Asaf Gartner Date: Tue, 25 Jun 2024 22:49:24 +0300 Subject: [PATCH] User settings --- src/templates/mapping.go | 1 + src/templates/src/user_settings.html | 206 ++++++++++++++++++++++++++- src/templates/types.go | 1 + src/website/user.go | 2 +- 4 files changed, 208 insertions(+), 2 deletions(-) diff --git a/src/templates/mapping.go b/src/templates/mapping.go index c53fab39..7466f816 100644 --- a/src/templates/mapping.go +++ b/src/templates/mapping.go @@ -222,6 +222,7 @@ func UserToTemplate(u *models.User) User { Signature: u.Signature, DateJoined: u.DateJoined, ProfileUrl: hmnurl.BuildUserProfile(u.Username), + Avatar: AssetToTemplate(u.AvatarAsset), AvatarUrl: UserAvatarUrl(u), Timezone: u.Timezone, diff --git a/src/templates/src/user_settings.html b/src/templates/src/user_settings.html index f9c073f7..93d14c51 100644 --- a/src/templates/src/user_settings.html +++ b/src/templates/src/user_settings.html @@ -1,4 +1,4 @@ -{{ template "base.html" . }} +{{ template "base-2024.html" . }} {{ define "extrahead" }} @@ -6,6 +6,207 @@ {{ end }} {{ define "content" }} +
+
+
+ +
+
+
+ {{ csrftoken .Session }} + + + + + + + +
+
+ Reset your password +
+ {{ if .HasPassword }} + + {{ end }} + +
+ Your password must be 8 or more characters, and must differ from your username{{ if .HasPassword }} and current password{{ end }}. + Other than that, please follow best practices. +
+
+
+ +
+ +
+
+ {{ if .DiscordUser }} + Linked account: + {{ .DiscordUser.Username }}#{{ .DiscordUser.Discriminator }} + + Unlink account + + {{ else }} + You haven't linked your Discord account. + Link account + {{ end }} +
+
+
+ + +
+
Snippets will only be created while this setting is on.
+
+
+
+ + +
+
+ {{ if .DiscordUser }} +
+ + Create snippets from all of my #project-showcase posts + +
+ Use this if you have a backlog of content in #project-showcase that you want on your profile. +
+ {{ if gt .DiscordNumUnsavedMessages 0 }} +
+ WARNING: {{ .DiscordNumUnsavedMessages }} of your messages are currently waiting to be processed. If you run this command now, some snippets may still be missing. +
+ {{ end }} +
+ {{ end }} +
+
+
+
+
+ +