Signed-off-by: Anirudh Oppiliappan anirudh@tangled.org
-17
appview/pages/funcmap.go
-17
appview/pages/funcmap.go
···
360
"fullAvatar": func(handle string) string {
361
return p.AvatarUrl(handle, "")
362
},
363
-
"placeholderAvatar": func(size string) template.HTML {
364
-
sizeClass := "size-6"
365
-
iconSize := "size-4"
366
-
if size == "tiny" {
367
-
sizeClass = "size-6"
368
-
iconSize = "size-4"
369
-
} else if size == "small" {
370
-
sizeClass = "size-8"
371
-
iconSize = "size-5"
372
-
} else {
373
-
sizeClass = "size-12"
374
-
iconSize = "size-8"
375
-
}
376
-
icon, _ := p.icon("user-round", []string{iconSize, "text-gray-400", "dark:text-gray-500"})
377
-
return template.HTML(fmt.Sprintf(`<div class="%s rounded-full bg-gray-200 dark:bg-gray-700 flex items-center justify-center flex-shrink-0">%s</div>`, sizeClass, icon))
378
-
},
379
"profileAvatarUrl": func(profile *models.Profile, size string) string {
380
return p.ProfileAvatarUrl(profile, size)
381
},
···
437
438
func (p *Pages) AvatarUrl(handle, size string) string {
439
handle = strings.TrimPrefix(handle, "@")
440
-
441
handle = p.resolveDid(handle)
442
443
secret := p.avatar.SharedSecret
···
360
"fullAvatar": func(handle string) string {
361
return p.AvatarUrl(handle, "")
362
},
363
"profileAvatarUrl": func(profile *models.Profile, size string) string {
364
return p.ProfileAvatarUrl(profile, size)
365
},
···
421
422
func (p *Pages) AvatarUrl(handle, size string) string {
423
handle = strings.TrimPrefix(handle, "@")
424
handle = p.resolveDid(handle)
425
426
secret := p.avatar.SharedSecret
appview/pages/templates/repo/commit.html
appview/pages/templates/repo/commit.html
This file has not been changed.
appview/pages/templates/repo/index.html
appview/pages/templates/repo/index.html
This file has not been changed.
appview/pages/templates/repo/log.html
appview/pages/templates/repo/log.html
This file has not been changed.
History
6 rounds
1 comment
anirudh.fi
submitted
#5
1 commit
expand
collapse
appview/pages: render a placeholder avatar when there's no did
Signed-off-by: Anirudh Oppiliappan <anirudh@tangled.org>
3/3 success
expand
collapse
expand 0 comments
pull request successfully merged
anirudh.fi
submitted
#4
1 commit
expand
collapse
appview/pages: render a placeholder avatar when there's no did
Signed-off-by: Anirudh Oppiliappan <anirudh@tangled.org>
3/3 success
expand
collapse
expand 0 comments
anirudh.fi
submitted
#3
1 commit
expand
collapse
appview/pages: render a placeholder avatar when there's no did
Signed-off-by: Anirudh Oppiliappan <anirudh@tangled.org>
3/3 success
expand
collapse
expand 0 comments
anirudh.fi
submitted
#2
1 commit
expand
collapse
appview/pages: render a placeholder avatar when there's no did
Signed-off-by: Anirudh Oppiliappan <anirudh@tangled.org>
3/3 success
expand
collapse
expand 0 comments
anirudh.fi
submitted
#1
1 commit
expand
collapse
appview/pages: render a placeholder avatar when there's no did
Signed-off-by: Anirudh Oppiliappan <anirudh@tangled.org>
expand 0 comments
anirudh.fi
submitted
#0
1 commit
expand
collapse
appview/pages: render a placeholder avatar when there's no did
Signed-off-by: Anirudh Oppiliappan <anirudh@tangled.org>
stack looks good to me!
Haven't tested yet. I should configure avatar service in my local setup to test this.