Monorepo for Tangled tangled.org
836
fork

Configure Feed

Select the types of activity you want to include in your feed.

appview/timeline: announce vouching in timeline #15

open opened by oppi.li targeting master from op/uxqspoupnxkp
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:qfpnj4og54vl56wngdriaxug/sh.tangled.repo.pull/3mkavb2ffyu22
+37 -36
Interdiff #1 #2
appview/pages/pages.go

This file has not been changed.

appview/pages/templates/timeline/fragments/announcements.html

This file has not been changed.

appview/pages/templates/timeline/fragments/timeline.html

This file has not been changed.

appview/pages/templates/timeline/fragments/trending.html

This file has not been changed.

+20 -20
appview/pages/templates/timeline/fragments/vouchSuggestions.html
··· 1 1 {{ define "timeline/fragments/vouchSuggestions" }} 2 - {{ if and .LoggedInUser .VouchSuggestions }} 3 - <div> 4 - <h3 class="text-xl font-bold dark:text-white flex items-center gap-4 px-4 pb-4"> 5 - {{ i "shield-plus" "size-5 flex-shrink-0" }} 6 - Suggested 7 - </h3> 8 - <div class="flex flex-col gap-4 bg-white dark:bg-gray-800 p-4 border border-gray-200 dark:border-gray-700 shadow-sm"> 9 - {{ range .VouchSuggestions }} 10 - <div class="flex items-center gap-3 "> 11 - {{ template "user/fragments/picLink" (list .Did "size-10") }} 12 - <div class="flex flex-col min-w-0 flex-1"> 13 - <a href="/{{ resolve .Did }}" class="text-sm font-medium dark:text-white hover:underline truncate">{{ resolve .Did }}</a> 14 - <span class="text-xs text-gray-500 dark:text-gray-400 truncate" title="{{ .Reason }}">{{ .Reason }}</span> 15 - </div> 16 - <div class="shrink-0"> 17 - {{ template "user/fragments/vouch" . }} 2 + {{ if and .LoggedInUser .VouchSuggestions }} 3 + <div> 4 + <h3 class="text-xl font-bold dark:text-white flex items-center gap-4 px-4 pb-4"> 5 + {{ i "shield-plus" "size-5 flex-shrink-0" }} 6 + Suggested 7 + </h3> 8 + <div class="flex flex-col gap-4 bg-white dark:bg-gray-800 p-4 border border-gray-200 dark:border-gray-700 shadow-sm"> 9 + {{ range .VouchSuggestions }} 10 + <div class="flex items-center gap-3 "> 11 + {{ template "user/fragments/picLink" (list .Did.String "size-10") }} 12 + <div class="flex flex-col min-w-0 flex-1"> 13 + <a href="/{{ resolve .Did.String }}" class="text-sm font-medium dark:text-white hover:underline truncate">{{ resolve .Did.String }}</a> 14 + <span class="text-xs text-gray-500 dark:text-gray-400 truncate" title="{{ .Reason }}">{{ .Reason }}</span> 15 + </div> 16 + <div class="shrink-0"> 17 + {{ template "user/fragments/vouch" . }} 18 + </div> 19 + </div> 20 + {{ end }} 18 21 </div> 19 22 </div> 20 - {{ end }} 21 - </div> 22 - </div> 23 - {{ end }} 23 + {{ end }} 24 24 {{ end }}
appview/pages/templates/timeline/timeline.html

This file has not been changed.

+2 -2
appview/pages/templates/user/fragments/vouchPopover.html
··· 17 17 {{ $userIdent := "" }} 18 18 {{ $userDid := "" }} 19 19 {{ with .VouchRelationship }} 20 - {{ $userDid = .SubjectDid }} 21 - {{ $userIdent = resolve .SubjectDid }} 20 + {{ $userDid = .SubjectDid.String }} 21 + {{ $userIdent = resolve .SubjectDid.String }} 22 22 {{ end }} 23 23 <div 24 24 id="vouch-modal-{{ normalizeForHtmlId $userDid }}"
+6 -6
appview/pulls/pulls.go
··· 805 805 } 806 806 807 807 s.pages.RepoPulls(w, pages.RepoPullsParams{ 808 + LoggedInUser: s.oauth.GetMultiAccountUser(r), 809 + RepoInfo: repoInfo, 810 + Pulls: pulls, 811 + LabelDefs: defs, 812 + FilterState: filterState, 813 + FilterQuery: query.String(), 808 - LoggedInUser: s.oauth.GetMultiAccountUser(r), 809 - RepoInfo: repoInfo, 810 - Pulls: pulls, 811 - LabelDefs: defs, 812 - FilterState: filterState, 813 - FilterQuery: query.String(), 814 814 Stacks: stacks, 815 815 Pipelines: m, 816 816 Page: page,
+4 -3
appview/state/timeline.go
··· 3 3 import ( 4 4 "net/http" 5 5 6 + "github.com/bluesky-social/indigo/atproto/syntax" 6 7 "tangled.org/core/appview/db" 7 8 "tangled.org/core/appview/models" 8 9 "tangled.org/core/appview/oauth" ··· 78 79 s.logger.Error("failed to get vouch suggestions", "err", err) 79 80 } 80 81 if len(vouchSuggestions) > 0 { 81 - suggestionDids := make([]string, len(vouchSuggestions)) 82 + suggestionDids := make([]syntax.DID, len(vouchSuggestions)) 82 83 for i, sv := range vouchSuggestions { 83 - suggestionDids[i] = sv.Did 84 + suggestionDids[i] = syntax.DID(sv.Did) 84 85 } 85 - relationships, err := db.GetVouchRelationshipsBatch(s.db, user.Did, suggestionDids) 86 + relationships, err := db.GetVouchRelationshipsBatch(s.db, syntax.DID(user.Did), suggestionDids) 86 87 if err != nil { 87 88 s.logger.Error("failed to get vouch relationships for suggestions", "err", err) 88 89 } else {
+4 -4
appview/pages/templates/user/fragments/networkVouches.html
··· 4 4 {{ $denounces := (list) }} 5 5 {{ range .IndirectVouches }} 6 6 {{ if .IsVouch }} 7 - {{ $vouches = append $vouches .Did }} 7 + {{ $vouches = append $vouches .Did.String }} 8 8 {{ else if .IsDenounce }} 9 - {{ $denounces = append $denounces .Did }} 9 + {{ $denounces = append $denounces .Did.String }} 10 10 {{ end }} 11 11 {{ end }} 12 12 ··· 18 18 border-x border-green-600/25 dark:border-green-400/25 19 19 {{ if $denounces }} border-t {{ else }} border-y {{ end }} 20 20 "> 21 - <a class="text-sm text-green-800 dark:text-green-200 hover:no-underline" href="/{{ .SubjectDid }}?tab=vouches"> 21 + <a class="text-sm text-green-800 dark:text-green-200 hover:no-underline" href="/{{ .SubjectDid.String }}?tab=vouches"> 22 22 vouched for by {{ len $vouches }} {{ if eq (len $vouches) 1 }}user{{ else }}users{{ end }} 23 23 </a> 24 24 {{ template "fragments/tinyAvatarList" (dict "all" $vouches "classes" "size-6") }} ··· 32 32 border-x border-red-600/25 dark:border-red-400/25 33 33 {{ if $vouches }} border-b {{ else }} border-y {{ end }} 34 34 "> 35 - <a class="text-sm text-red-800 dark:text-red-200 hover:no-underline" href="/{{ .SubjectDid }}?tab=vouches"> 35 + <a class="text-sm text-red-800 dark:text-red-200 hover:no-underline" href="/{{ .SubjectDid.String }}?tab=vouches"> 36 36 denounced by {{ len $denounces }} {{ if eq (len $denounces) 1 }}user{{ else }}users{{ end }} 37 37 </a> 38 38 {{ template "fragments/tinyAvatarList" (dict "all" $denounces "classes" "size-6") }}
+1 -1
appview/pages/templates/user/fragments/vouchButton.html
··· 11 11 12 12 {{ $userDid := "" }} 13 13 {{ with .VouchRelationship }} 14 - {{ $userDid = .SubjectDid }} 14 + {{ $userDid = .SubjectDid.String }} 15 15 {{ end }} 16 16 <button 17 17 id="vouch-btn-{{ normalizeForHtmlId $userDid }}"

History

3 rounds 0 comments
sign up or login to add to the discussion
oppi.li submitted #2
1 commit
expand
appview/timeline: announce vouching in timeline
merge conflicts detected
expand
  • api/tangled/cbor_gen.go:9735
  • cmd/cborgen/cborgen.go:24
expand 0 comments
1 commit
expand
appview/timeline: announce vouching in timeline
expand 0 comments
oppi.li submitted #0
1 commit
expand
appview/timeline: announce vouching in timeline
expand 0 comments