Signed-off-by: oppiliappan me@oppi.li
+24
-13
Diff
round #0
+5
appview/pages/funcmap.go
+5
appview/pages/funcmap.go
···
23
23
chromahtml "github.com/alecthomas/chroma/v2/formatters/html"
24
24
"github.com/alecthomas/chroma/v2/lexers"
25
25
"github.com/alecthomas/chroma/v2/styles"
26
+
"github.com/bluesky-social/indigo/atproto/syntax"
26
27
"github.com/dustin/go-humanize"
27
28
"github.com/dustin/go-humanize/english"
28
29
"github.com/go-enry/go-enry/v2"
···
504
505
"PdsUserDomain": p.pdsCfg.UserDomain,
505
506
}
506
507
},
508
+
"did": func(s string) syntax.DID {
509
+
// cast to DID
510
+
return syntax.DID(s)
511
+
},
507
512
}
508
513
}
509
514
+2
-2
appview/pages/templates/repo/issues/fragments/commentList.html
+2
-2
appview/pages/templates/repo/issues/fragments/commentList.html
···
15
15
"LoggedInUser" $root.LoggedInUser
16
16
"Issue" $root.Issue
17
17
"Comment" $comment.Self
18
-
"VouchRelationship" (index $root.VouchRelationships $comment.Self.Did)
18
+
"VouchRelationship" (index $root.VouchRelationships (did $comment.Self.Did))
19
19
) }}
20
20
21
21
<div class="rounded border border-gray-200 dark:border-gray-700 w-full overflow-hidden shadow-sm bg-gray-50 dark:bg-gray-800/50">
···
31
31
"LoggedInUser" $root.LoggedInUser
32
32
"Issue" $root.Issue
33
33
"Comment" $reply
34
-
"VouchRelationship" (index $root.VouchRelationships $reply.Did)
34
+
"VouchRelationship" (index $root.VouchRelationships (did $reply.Did))
35
35
) }}
36
36
</div>
37
37
{{ end }}
+1
-1
appview/pages/templates/repo/issues/fragments/issueListing.html
+1
-1
appview/pages/templates/repo/issues/fragments/issueListing.html
···
27
27
</span>
28
28
29
29
<span class="ml-1 flex items-center gap-1">
30
-
{{ template "user/fragments/picLink" (list .Did "size-6" (index $.VouchRelationships .Did)) }}
30
+
{{ template "user/fragments/picLink" (list .Did "size-6" (index $.VouchRelationships (did .Did))) }}
31
31
<a href="/{{ resolve .Did }}">{{ resolve .Did }}</a>
32
32
</span>
33
33
+1
-1
appview/pages/templates/repo/issues/issue.html
+1
-1
appview/pages/templates/repo/issues/issue.html
···
68
68
69
69
<span class="text-gray-500 dark:text-gray-400 text-sm flex flex-wrap items-center gap-1">
70
70
opened by
71
-
{{ template "user/fragments/picLink" (list .Issue.Did "size-6" (index .VouchRelationships .Issue.Did)) }}
71
+
{{ template "user/fragments/picLink" (list .Issue.Did "size-6" (index .VouchRelationships (did .Issue.Did))) }}
72
72
<a href="/{{ resolve .Issue.Did }}">{{ resolve .Issue.Did }}</a>
73
73
<span class="select-none before:content-['\00B7']"></span>
74
74
{{ if .Issue.Edited }}
+1
-1
appview/pages/templates/repo/pulls/fragments/pullHeader.html
+1
-1
appview/pages/templates/repo/pulls/fragments/pullHeader.html
···
11
11
{{ template "repo/pulls/fragments/pullState" .Pull.State }}
12
12
<span class="text-gray-500 dark:text-gray-400 text-sm flex flex-wrap items-center gap-1">
13
13
opened by
14
-
{{ template "user/fragments/picLink" (list .Pull.OwnerDid "size-6" (index .VouchRelationships .Pull.OwnerDid)) }}
14
+
{{ template "user/fragments/picLink" (list .Pull.OwnerDid "size-6" (index .VouchRelationships (did .Pull.OwnerDid))) }}
15
15
<a href="/{{ resolve .Pull.OwnerDid }}">{{ resolve .Pull.OwnerDid }}</a>
16
16
<span class="select-none before:content-['\00B7']"></span>
17
17
{{ template "repo/fragments/time" .Pull.Created }}
+2
-2
appview/pages/templates/repo/pulls/pull.html
+2
-2
appview/pages/templates/repo/pulls/pull.html
···
300
300
flex gap-2 sticky top-0 z-20">
301
301
<!-- left column: just profile picture -->
302
302
<div class="flex-shrink-0 pt-2">
303
-
{{ template "user/fragments/picLink" (list $root.Pull.OwnerDid "size-8" (index $root.VouchRelationships $root.Pull.OwnerDid)) }}
303
+
{{ template "user/fragments/picLink" (list $root.Pull.OwnerDid "size-8" (index $root.VouchRelationships (did $root.Pull.OwnerDid))) }}
304
304
</div>
305
305
<!-- right column -->
306
306
<div class="flex-1 min-w-0 flex flex-col gap-1">
···
630
630
<div id="comment-{{$comment.ID}}" class="flex gap-2 -ml-4 py-4 w-full mx-auto group/comment">
631
631
<!-- left column: profile picture -->
632
632
<div class="flex-shrink-0 h-fit relative">
633
-
{{ template "user/fragments/picLink" (list $comment.OwnerDid "size-8" (index $root.VouchRelationships $comment.OwnerDid)) }}
633
+
{{ template "user/fragments/picLink" (list $comment.OwnerDid "size-8" (index $root.VouchRelationships (did $comment.OwnerDid))) }}
634
634
</div>
635
635
<!-- right column: name and body in two rows -->
636
636
<div class="flex-1 min-w-0">
+1
-1
appview/pages/templates/repo/pulls/pulls.html
+1
-1
appview/pages/templates/repo/pulls/pulls.html
···
82
82
<div class="text-sm text-gray-500 dark:text-gray-400 flex flex-wrap items-center gap-1">
83
83
{{ template "repo/pulls/fragments/pullState" $topPR.State }}
84
84
<span class="ml-1 flex items-center gap-1">
85
-
{{ template "user/fragments/picLink" (list $topPR.OwnerDid "size-6" (index $.VouchRelationships $topPR.OwnerDid)) }}
85
+
{{ template "user/fragments/picLink" (list $topPR.OwnerDid "size-6" (index $.VouchRelationships (did $topPR.OwnerDid))) }}
86
86
<a href="/{{ resolve $topPR.OwnerDid }}">{{ resolve $topPR.OwnerDid }}</a>
87
87
</span>
88
88
+1
-1
appview/pages/templates/user/fragments/picLink.html
+1
-1
appview/pages/templates/user/fragments/picLink.html
···
18
18
{{ if ne $did $vr.ViewerDid }}
19
19
<button
20
20
type="button"
21
-
popovertarget="vouch-modal-{{ normalizeForHtmlId $vr.SubjectDid }}"
21
+
popovertarget="vouch-modal-{{ normalizeForHtmlId $vr.SubjectDid.String }}"
22
22
popovertargetaction="toggle"
23
23
class="absolute -bottom-0.5 -right-0.5 w-1/2 h-1/2 cursor-pointer"
24
24
title="{{ template "user/fragments/vouchTooltip" $vr }}">
+2
-2
appview/pages/templates/user/fragments/vouchTooltip.html
+2
-2
appview/pages/templates/user/fragments/vouchTooltip.html
···
14
14
{{- $direct := $vr.GetDirectVouch -}}
15
15
{{- if $direct -}}
16
16
{{- if $direct.IsVouch -}}
17
-
You vouched for {{ resolve $vr.SubjectDid }} {{ relTimeFmt $direct.CreatedAt }}. {{ $networkPart }}
17
+
You vouched for {{ resolve $vr.SubjectDid.String }} {{ relTimeFmt $direct.CreatedAt }}. {{ $networkPart }}
18
18
{{- else -}}
19
-
You denounced {{ resolve $vr.SubjectDid }} {{ relTimeFmt $direct.CreatedAt }}. {{ $networkPart }}
19
+
You denounced {{ resolve $vr.SubjectDid.String }} {{ relTimeFmt $direct.CreatedAt }}. {{ $networkPart }}
20
20
{{- end -}}
21
21
{{- else -}}
22
22
{{- $networkPart -}}.
+8
-2
appview/pulls/pulls.go
+8
-2
appview/pulls/pulls.go
···
297
297
diff = patchutil.Interdiff(previousPatch, currentPatch)
298
298
}
299
299
300
-
s.pages.RepoSinglePull(w, pages.RepoSinglePullParams{
300
+
err = s.pages.RepoSinglePull(w, pages.RepoSinglePullParams{
301
301
LoggedInUser: user,
302
302
RepoInfo: s.repoResolver.GetRepoInfo(r, user),
303
303
Pull: pull,
···
318
318
LabelDefs: defs,
319
319
VouchRelationships: vouchRelationships,
320
320
})
321
+
if err != nil {
322
+
l.Error("failed to render page", "err", err)
323
+
}
321
324
}
322
325
323
326
func (s *Pulls) RepoSinglePull(w http.ResponseWriter, r *http.Request) {
···
804
807
}
805
808
}
806
809
807
-
s.pages.RepoPulls(w, pages.RepoPullsParams{
810
+
err = s.pages.RepoPulls(w, pages.RepoPullsParams{
808
811
LoggedInUser: s.oauth.GetMultiAccountUser(r),
809
812
RepoInfo: repoInfo,
810
813
Pulls: pulls,
···
817
820
PullCount: totalPulls,
818
821
VouchRelationships: vouchRelationships,
819
822
})
823
+
if err != nil {
824
+
l.Error("failed to render page", "err", err)
825
+
}
820
826
}
821
827
822
828
func (s *Pulls) PullComment(w http.ResponseWriter, r *http.Request) {
History
1 round
0 comments
oppi.li
submitted
#0
1 commit
expand
collapse
appview/pages: add DID <-> string casts where necessary
Signed-off-by: oppiliappan <me@oppi.li>
merge conflicts detected
expand
collapse
expand
collapse
- appview/pages/funcmap.go:23
- appview/pages/templates/repo/issues/fragments/commentList.html:15
- appview/pages/templates/repo/issues/fragments/issueListing.html:27
- appview/pages/templates/repo/issues/issue.html:68
- appview/pages/templates/repo/pulls/fragments/pullHeader.html:11
- appview/pages/templates/repo/pulls/pull.html:300
- appview/pages/templates/repo/pulls/pulls.html:82
- appview/pages/templates/user/fragments/picLink.html:18
- appview/pages/templates/user/fragments/vouchTooltip.html:14
- appview/pulls/pulls.go:297