forked from tangled.org/core
Monorepo for Tangled — https://tangled.org

appview/pages: show user avatar in profile dropdown

Renames user/fragments/picHandle to user/fragments/picHandleLink, since it now wraps a simpler user/fragments/picHandle that doesn't include the link. The topbar should now display the avatar next to the handle in the same style, without the link as it was before.

authored by uncenter.dev and committed by Tangled 9b2bf899 9ff59341

Changed files
+23 -19
appview
pages
templates
+4 -3
appview/pages/templates/layouts/topbar.html
··· 36 {{ define "dropDown" }} 37 <details class="relative inline-block text-left"> 38 <summary 39 - class="cursor-pointer list-none" 40 > 41 - {{ didOrHandle .Did .Handle }} 42 </summary> 43 <div 44 class="absolute flex flex-col right-0 mt-4 p-4 rounded w-48 bg-white dark:bg-gray-800 dark:text-white border border-gray-200 dark:border-gray-700" 45 > 46 - <a href="/{{ didOrHandle .Did .Handle }}">profile</a> 47 <a href="/knots">knots</a> 48 <a href="/spindles">spindles</a> 49 <a href="/settings">settings</a>
··· 36 {{ define "dropDown" }} 37 <details class="relative inline-block text-left"> 38 <summary 39 + class="cursor-pointer list-none flex items-center" 40 > 41 + {{ $user := didOrHandle .Did .Handle }} 42 + {{ template "user/fragments/picHandle" $user }} 43 </summary> 44 <div 45 class="absolute flex flex-col right-0 mt-4 p-4 rounded w-48 bg-white dark:bg-gray-800 dark:text-white border border-gray-200 dark:border-gray-700" 46 > 47 + <a href="/{{ $user }}">profile</a> 48 <a href="/knots">knots</a> 49 <a href="/spindles">spindles</a> 50 <a href="/settings">settings</a>
+1 -1
appview/pages/templates/repo/issues/issue.html
··· 33 <span class="text-gray-500 dark:text-gray-400 text-sm flex flex-wrap items-center gap-1"> 34 opened by 35 {{ $owner := didOrHandle .Issue.OwnerDid .IssueOwnerHandle }} 36 - {{ template "user/fragments/picHandle" $owner }} 37 <span class="select-none before:content-['\00B7']"></span> 38 <time title="{{ .Issue.Created | longTimeFmt }}"> 39 {{ .Issue.Created | timeFmt }}
··· 33 <span class="text-gray-500 dark:text-gray-400 text-sm flex flex-wrap items-center gap-1"> 34 opened by 35 {{ $owner := didOrHandle .Issue.OwnerDid .IssueOwnerHandle }} 36 + {{ template "user/fragments/picHandleLink" $owner }} 37 <span class="select-none before:content-['\00B7']"></span> 38 <time title="{{ .Issue.Created | longTimeFmt }}"> 39 {{ .Issue.Created | timeFmt }}
+1 -1
appview/pages/templates/repo/issues/issues.html
··· 66 67 <span class="ml-1"> 68 {{ $owner := index $.DidHandleMap .OwnerDid }} 69 - {{ template "user/fragments/picHandle" $owner }} 70 </span> 71 72 <span class="before:content-['·']">
··· 66 67 <span class="ml-1"> 68 {{ $owner := index $.DidHandleMap .OwnerDid }} 69 + {{ template "user/fragments/picHandleLink" $owner }} 70 </span> 71 72 <span class="before:content-['·']">
+1 -1
appview/pages/templates/repo/pulls/fragments/pullHeader.html
··· 29 <span class="text-gray-500 dark:text-gray-400 text-sm flex flex-wrap items-center gap-1"> 30 opened by 31 {{ $owner := index $.DidHandleMap .Pull.OwnerDid }} 32 - {{ template "user/fragments/picHandle" $owner }} 33 <span class="select-none before:content-['\00B7']"></span> 34 <time>{{ .Pull.Created | timeFmt }}</time> 35
··· 29 <span class="text-gray-500 dark:text-gray-400 text-sm flex flex-wrap items-center gap-1"> 30 opened by 31 {{ $owner := index $.DidHandleMap .Pull.OwnerDid }} 32 + {{ template "user/fragments/picHandleLink" $owner }} 33 <span class="select-none before:content-['\00B7']"></span> 34 <time>{{ .Pull.Created | timeFmt }}</time> 35
+1 -1
appview/pages/templates/repo/pulls/pulls.html
··· 76 </span> 77 78 <span class="ml-1"> 79 - {{ template "user/fragments/picHandle" $owner }} 80 </span> 81 82 <span>
··· 76 </span> 77 78 <span class="ml-1"> 79 + {{ template "user/fragments/picHandleLink" $owner }} 80 </span> 81 82 <span>
+4 -4
appview/pages/templates/timeline.html
··· 61 {{ $userHandle := index $.DidHandleMap .Repo.Did }} 62 <div class="flex items-center"> 63 <p class="text-gray-600 dark:text-gray-300 flex flex-wrap items-center gap-2"> 64 - {{ template "user/fragments/picHandle" $userHandle }} 65 {{ if .Source }} 66 forked 67 <a ··· 95 {{ $subjectHandle := index $.DidHandleMap .Follow.SubjectDid }} 96 <div class="flex items-center"> 97 <p class="text-gray-600 dark:text-gray-300 flex flex-wrap items-center gap-2"> 98 - {{ template "user/fragments/picHandle" $userHandle }} 99 followed 100 - {{ template "user/fragments/picHandle" $subjectHandle }} 101 <time 102 class="text-gray-700 dark:text-gray-400 text-xs" 103 >{{ .Follow.FollowedAt | timeFmt }}</time ··· 109 {{ $repoOwnerHandle := index $.DidHandleMap .Star.Repo.Did }} 110 <div class="flex items-center"> 111 <p class="text-gray-600 dark:text-gray-300 flex flex-wrap items-center gap-2"> 112 - {{ template "user/fragments/picHandle" $starrerHandle }} 113 starred 114 <a 115 href="/{{ $repoOwnerHandle }}/{{ .Star.Repo.Name }}"
··· 61 {{ $userHandle := index $.DidHandleMap .Repo.Did }} 62 <div class="flex items-center"> 63 <p class="text-gray-600 dark:text-gray-300 flex flex-wrap items-center gap-2"> 64 + {{ template "user/fragments/picHandleLink" $userHandle }} 65 {{ if .Source }} 66 forked 67 <a ··· 95 {{ $subjectHandle := index $.DidHandleMap .Follow.SubjectDid }} 96 <div class="flex items-center"> 97 <p class="text-gray-600 dark:text-gray-300 flex flex-wrap items-center gap-2"> 98 + {{ template "user/fragments/picHandleLink" $userHandle }} 99 followed 100 + {{ template "user/fragments/picHandleLink" $subjectHandle }} 101 <time 102 class="text-gray-700 dark:text-gray-400 text-xs" 103 >{{ .Follow.FollowedAt | timeFmt }}</time ··· 109 {{ $repoOwnerHandle := index $.DidHandleMap .Star.Repo.Did }} 110 <div class="flex items-center"> 111 <p class="text-gray-600 dark:text-gray-300 flex flex-wrap items-center gap-2"> 112 + {{ template "user/fragments/picHandleLink" $starrerHandle }} 113 starred 114 <a 115 href="/{{ $repoOwnerHandle }}/{{ .Star.Repo.Name }}"
+6 -8
appview/pages/templates/user/fragments/picHandle.html
··· 1 {{ define "user/fragments/picHandle" }} 2 - <a href="/{{ . }}" class="flex items-center"> 3 - <img 4 - src="{{ tinyAvatar . }}" 5 - alt="{{ . }}" 6 - class="rounded-full h-6 w-6 mr-1 border border-gray-300 dark:border-gray-700" 7 - /> 8 - {{ . | truncateAt30 }} 9 - </a> 10 {{ end }}
··· 1 {{ define "user/fragments/picHandle" }} 2 + <img 3 + src="{{ tinyAvatar . }}" 4 + alt="{{ . }}" 5 + class="rounded-full h-6 w-6 mr-1 border border-gray-300 dark:border-gray-700" 6 + /> 7 + {{ . | truncateAt30 }} 8 {{ end }}
+5
appview/pages/templates/user/fragments/picHandleLink.html
···
··· 1 + {{ define "user/fragments/picHandleLink" }} 2 + <a href="/{{ . }}" class="flex items-center"> 3 + {{ template "user/fragments/picHandle" . }} 4 + </a> 5 + {{ end }}