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 #2
+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 - {{ template "user/fragments/pic" (list $user "size-6") }} 50 - <span class="hidden md:inline">{{ $user | resolve | truncateAt30 }}</span> 51 </summary> 52 <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;"> 53 - {{ $active := .Active.Did }} 54 {{ $linkStyle := "flex items-center gap-3 px-4 py-2 hover:no-underline hover:bg-gray-50 hover:dark:bg-gray-700/50" }} 55 56 - {{ $others := .Accounts | otherAccounts $active }} 57 {{ if $others }} 58 <div class="text-sm text-gray-500 dark:text-gray-400 px-3 py-1 pt-2">switch account</div> 59 {{ range $others }} ··· 81 </a> 82 83 <div class="border-t border-gray-200 dark:border-gray-700"> 84 - <a href="/{{ $active }}" class="{{$linkStyle}}"> 85 {{ i "user" "size-4" }} 86 profile 87 </a> 88 - <a href="/{{ $active }}?tab=repos" class="{{$linkStyle}}"> 89 {{ i "book-marked" "size-4" }} 90 repositories 91 </a> 92 - <a href="/{{ $active }}?tab=strings" class="{{$linkStyle}}"> 93 {{ i "line-squiggle" "size-4" }} 94 strings 95 </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 + {{ template "user/fragments/pic" (list .Did "size-6") }} 50 + <span class="hidden md:inline">{{ $handle | truncateAt30 }}</span> 51 </summary> 52 <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;"> 53 {{ $linkStyle := "flex items-center gap-3 px-4 py-2 hover:no-underline hover:bg-gray-50 hover:dark:bg-gray-700/50" }} 54 55 + {{ $others := .Accounts | otherAccounts .Did }} 56 {{ if $others }} 57 <div class="text-sm text-gray-500 dark:text-gray-400 px-3 py-1 pt-2">switch account</div> 58 {{ range $others }} ··· 80 </a> 81 82 <div class="border-t border-gray-200 dark:border-gray-700"> 83 + <a href="/{{ $handle }}" class="{{$linkStyle}}"> 84 {{ i "user" "size-4" }} 85 profile 86 </a> 87 + <a href="/{{ $handle }}?tab=repos" class="{{$linkStyle}}"> 88 {{ i "book-marked" "size-4" }} 89 repositories 90 </a> 91 + <a href="/{{ $handle }}?tab=strings" class="{{$linkStyle}}"> 92 {{ i "line-squiggle" "size-4" }} 93 strings 94 </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
1 commit
expand
appview/pages: don't access MultiAccountUser.Active from template
2/3 failed, 1/3 success
expand
expand 0 comments