diff --git a/appview/pages/funcmap.go b/appview/pages/funcmap.go --- a/appview/pages/funcmap.go +++ b/appview/pages/funcmap.go @@ -360,6 +360,28 @@ }, "fullAvatar": func(handle string) string { return p.AvatarUrl(handle, "") }, + "placeholderAvatar": func(size string) template.HTML { + sizeClass := "size-6" + iconSize := "size-4" + if size == "tiny" { + sizeClass = "size-6" + iconSize = "size-4" + } else if size == "small" { + sizeClass = "size-8" + iconSize = "size-5" + } else { + sizeClass = "size-12" + iconSize = "size-8" + } + icon, _ := p.icon("user-round", []string{iconSize, "text-gray-400", "dark:text-gray-500"}) + return template.HTML(fmt.Sprintf(`
%s
`, sizeClass, icon)) + }, + "profileAvatarUrl": func(profile *models.Profile, size string) string { + if profile != nil { + return p.AvatarUrl(profile.Did, size) + } + return "" + }, "langColor": enry.GetColor, "layoutSide": func() string { return "col-span-1 md:col-span-2 lg:col-span-3" diff --git a/appview/pages/templates/layouts/profilebase.html b/appview/pages/templates/layouts/profilebase.html --- a/appview/pages/templates/layouts/profilebase.html +++ b/appview/pages/templates/layouts/profilebase.html @@ -2,7 +2,7 @@ {{ define "title" }}{{ resolve .Card.UserDid }}{{ end }} {{ define "extrameta" }} {{ $handle := resolve .Card.UserDid }} - {{ $avatarUrl := fullAvatar $handle }} + {{ $avatarUrl := profileAvatarUrl .Card.Profile "" }} diff --git a/appview/pages/templates/user/fragments/editAvatar.html b/appview/pages/templates/user/fragments/editAvatar.html new file mode 100644 --- /dev/null +++ b/appview/pages/templates/user/fragments/editAvatar.html @@ -0,0 +1,44 @@ +{{ define "user/fragments/editAvatar" }} +
+ +

Select an image (PNG or JPEG, max 1MB)

+ +
+ + +
+
+
+{{ end }} diff --git a/appview/pages/templates/user/fragments/profileCard.html b/appview/pages/templates/user/fragments/profileCard.html --- a/appview/pages/templates/user/fragments/profileCard.html +++ b/appview/pages/templates/user/fragments/profileCard.html @@ -3,8 +3,23 @@ {{ $userIdent := resolve .UserDid }}
- + + {{ if eq .FollowStatus.String "IsSelf" }} + + {{ end }}
+
+
+ {{ template "user/fragments/editAvatar" . }}
@@ -36,7 +51,7 @@ -
+
{{ if .Location }}
{{ i "map-pin" "size-4" }} @@ -111,4 +126,3 @@ {{ .Stats.FollowingCount }} following
{{ end }} {{ end }} - diff --git a/appview/pages/templates/user/settings/emails.html b/appview/pages/templates/user/settings/emails.html --- a/appview/pages/templates/user/settings/emails.html +++ b/appview/pages/templates/user/settings/emails.html @@ -62,7 +62,9 @@ hx-indicator="#spinner" hx-swap="none" class="flex flex-col gap-2" > -

ADD EMAIL

+

Commits using this email will be associated with your profile.

-{{ end }} \ No newline at end of file +{{ end }} diff --git a/appview/pages/templates/user/settings/keys.html b/appview/pages/templates/user/settings/keys.html --- a/appview/pages/templates/user/settings/keys.html +++ b/appview/pages/templates/user/settings/keys.html @@ -21,7 +21,7 @@

SSH Keys

- SSH public keys added here will be broadcasted to knots that you are a member of, + SSH public keys added here will be broadcasted to knots that you are a member of, allowing you to push to repositories there.

@@ -63,7 +63,9 @@ hx-indicator="#spinner" hx-swap="none" class="flex flex-col gap-2" > -

ADD SSH KEY

+

SSH keys allow you to push to repositories in knots you're a member of.