Monorepo for Tangled tangled.org

appview/pages: don't access MultiAccountUser.Active from template #1026

open opened by boltless.me targeting master from sl/uvpzuszrulvq

We are using MultiAccountUser.Did() to get current DID instead.

Signed-off-by: Seongmin Lee git@boltless.me

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:xasnlahkri4ewmbuzly2rlc5/sh.tangled.repo.pull/3mdcq5ouzin22
+7 -8
Diff #0
+7 -8
appview/pages/templates/layouts/fragments/topbar.html
··· 43 {{ end }} 44 45 {{ define "profileDropdown" }} 46 <details class="relative inline-block text-left nav-dropdown"> 47 <summary class="cursor-pointer list-none flex items-center gap-1"> 48 - {{ $user := .Active.Did }} 49 <img 50 - src="{{ tinyAvatar $user }}" 51 alt="" 52 class="rounded-full h-6 w-6 border border-gray-300 dark:border-gray-700" 53 /> 54 - <span class="hidden md:inline">{{ $user | resolve | truncateAt30 }}</span> 55 </summary> 56 <div class="absolute right-0 mt-4 rounded bg-white dark:bg-gray-800 dark:text-white border border-gray-200 dark:border-gray-700 shadow-lg z-50 text-sm" style="width: 14rem;"> 57 - {{ $active := .Active.Did }} 58 {{ $linkStyle := "flex items-center gap-3 px-4 py-2 hover:no-underline hover:bg-gray-50 hover:dark:bg-gray-700/50" }} 59 60 - {{ $others := .Accounts | otherAccounts $active }} 61 {{ if $others }} 62 <div class="text-sm text-gray-500 dark:text-gray-400 px-3 py-1 pt-2">switch account</div> 63 {{ range $others }} ··· 85 </a> 86 87 <div class="border-t border-gray-200 dark:border-gray-700"> 88 - <a href="/{{ $active }}" class="{{$linkStyle}}"> 89 {{ i "user" "size-4" }} 90 profile 91 </a> 92 - <a href="/{{ $active }}?tab=repos" class="{{$linkStyle}}"> 93 {{ i "book-marked" "size-4" }} 94 repositories 95 </a> 96 - <a href="/{{ $active }}?tab=strings" class="{{$linkStyle}}"> 97 {{ i "line-squiggle" "size-4" }} 98 strings 99 </a>
··· 43 {{ end }} 44 45 {{ define "profileDropdown" }} 46 + {{ $handle := resolve .Did }} 47 <details class="relative inline-block text-left nav-dropdown"> 48 <summary class="cursor-pointer list-none flex items-center gap-1"> 49 <img 50 + src="{{ tinyAvatar .Did }}" 51 alt="" 52 class="rounded-full h-6 w-6 border border-gray-300 dark:border-gray-700" 53 /> 54 + <span class="hidden md:inline">{{ $handle | truncateAt30 }}</span> 55 </summary> 56 <div class="absolute right-0 mt-4 rounded bg-white dark:bg-gray-800 dark:text-white border border-gray-200 dark:border-gray-700 shadow-lg z-50 text-sm" style="width: 14rem;"> 57 {{ $linkStyle := "flex items-center gap-3 px-4 py-2 hover:no-underline hover:bg-gray-50 hover:dark:bg-gray-700/50" }} 58 59 + {{ $others := .Accounts | otherAccounts .Did }} 60 {{ if $others }} 61 <div class="text-sm text-gray-500 dark:text-gray-400 px-3 py-1 pt-2">switch account</div> 62 {{ range $others }} ··· 84 </a> 85 86 <div class="border-t border-gray-200 dark:border-gray-700"> 87 + <a href="/{{ $handle }}" class="{{$linkStyle}}"> 88 {{ i "user" "size-4" }} 89 profile 90 </a> 91 + <a href="/{{ $handle }}?tab=repos" class="{{$linkStyle}}"> 92 {{ i "book-marked" "size-4" }} 93 repositories 94 </a> 95 + <a href="/{{ $handle }}?tab=strings" class="{{$linkStyle}}"> 96 {{ i "line-squiggle" "size-4" }} 97 strings 98 </a>

History

3 rounds 0 comments
sign up or login to add to the discussion
1 commit
expand
appview/pages: don't access MultiAccountUser.Active from template
2/3 failed, 1/3 success
expand
merge conflicts detected
expand
  • appview/pages/templates/user/login.html:33
  • appview/state/profile.go:817
  • appview/pages/templates/user/login.html:31
  • appview/pages/templates/user/login.html:93
expand 0 comments
1 commit
expand
appview/pages: don't access MultiAccountUser.Active from template
1/3 failed, 2/3 success
expand
expand 0 comments
boltless.me submitted #0
1 commit
expand
appview/pages: don't access MultiAccountUser.Active from template
2/3 failed, 1/3 success
expand
expand 0 comments