forked from tangled.org/core
Monorepo for Tangled

appview/pages: render a placeholder avatar when there's no did

Signed-off-by: Anirudh Oppiliappan <anirudh@tangled.org>

anirudh.fi 8697a7a3 fa732f2b

verified
Changed files
+15 -5
appview
pages
-1
appview/pages/funcmap.go
··· 421 422 func (p *Pages) AvatarUrl(handle, size string) string { 423 handle = strings.TrimPrefix(handle, "@") 424 - 425 handle = p.resolveDid(handle) 426 427 secret := p.avatar.SharedSecret
··· 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
+4 -1
appview/pages/templates/repo/commit.html
··· 100 {{ if $did }} 101 {{ template "user/fragments/picHandleLink" $did }} 102 {{ else }} 103 - <a href="mailto:{{ $email }}" class="no-underline hover:underline text-gray-500 dark:text-gray-300">{{ $name }}</a> 104 {{ end }} 105 {{ end }} 106
··· 100 {{ if $did }} 101 {{ template "user/fragments/picHandleLink" $did }} 102 {{ else }} 103 + <span class="flex items-center gap-1"> 104 + {{ placeholderAvatar "tiny" }} 105 + <a href="mailto:{{ $email }}" class="no-underline hover:underline text-gray-500 dark:text-gray-300">{{ $name }}</a> 106 + </span> 107 {{ end }} 108 {{ end }} 109
+6 -2
appview/pages/templates/repo/index.html
··· 259 {{ define "attribution" }} 260 {{ $commit := index . 0 }} 261 {{ $map := index . 1 }} 262 - <span class="flex items-center"> 263 {{ $author := index $map $commit.Author.Email }} 264 {{ $coauthors := $commit.CoAuthors }} 265 {{ $all := list }} ··· 274 {{ end }} 275 {{ end }} 276 277 - {{ template "fragments/tinyAvatarList" (dict "all" $all "classes" "size-6") }} 278 <a href="{{ if $author }}/{{ $author }}{{ else }}mailto:{{ $commit.Author.Email }}{{ end }}" 279 class="no-underline hover:underline"> 280 {{ if $author }}{{ resolve $author }}{{ else }}{{ $commit.Author.Name }}{{ end }}
··· 259 {{ define "attribution" }} 260 {{ $commit := index . 0 }} 261 {{ $map := index . 1 }} 262 + <span class="flex items-center gap-1"> 263 {{ $author := index $map $commit.Author.Email }} 264 {{ $coauthors := $commit.CoAuthors }} 265 {{ $all := list }} ··· 274 {{ end }} 275 {{ end }} 276 277 + {{ if $author }} 278 + {{ template "fragments/tinyAvatarList" (dict "all" $all "classes" "size-6") }} 279 + {{ else }} 280 + {{ placeholderAvatar "tiny" }} 281 + {{ end }} 282 <a href="{{ if $author }}/{{ $author }}{{ else }}mailto:{{ $commit.Author.Email }}{{ end }}" 283 class="no-underline hover:underline"> 284 {{ if $author }}{{ resolve $author }}{{ else }}{{ $commit.Author.Name }}{{ end }}
+5 -1
appview/pages/templates/repo/log.html
··· 186 {{ end }} 187 {{ end }} 188 189 - {{ template "fragments/tinyAvatarList" (dict "all" $all "classes" "size-6") }} 190 <a href="{{ if $author }}/{{ $author }}{{ else }}mailto:{{ $commit.Author.Email }}{{ end }}" 191 class="no-underline hover:underline"> 192 {{ if $author }}{{ resolve $author }}{{ else }}{{ $commit.Author.Name }}{{ end }}
··· 186 {{ end }} 187 {{ end }} 188 189 + {{ if $author }} 190 + {{ template "fragments/tinyAvatarList" (dict "all" $all "classes" "size-6") }} 191 + {{ else }} 192 + {{ placeholderAvatar "tiny" }} 193 + {{ end }} 194 <a href="{{ if $author }}/{{ $author }}{{ else }}mailto:{{ $commit.Author.Email }}{{ end }}" 195 class="no-underline hover:underline"> 196 {{ if $author }}{{ resolve $author }}{{ else }}{{ $commit.Author.Name }}{{ end }}