tangled
alpha
login
or
join now
moll.dev
/
core
forked from
tangled.org/core
this repo has no description
0
fork
atom
overview
issues
pulls
pipelines
resolve dids in profile page
oppi.li
11 months ago
ec0558e5
ab45e810
+24
-8
6 changed files
expand all
collapse all
unified
split
appview
pages
pages.go
templates
layouts
repobase.html
user
profile.html
state
repo.go
state.go
tailwind.config.js
+1
appview/pages/pages.go
···
145
145
CollaboratingRepos []db.Repo
146
146
ProfileStats ProfileStats
147
147
FollowStatus db.FollowStatus
148
148
+
DidHandleMap map[string]string
148
149
}
149
150
150
151
type ProfileStats struct {
+6
-3
appview/pages/templates/layouts/repobase.html
···
29
29
hx-boost="true"
30
30
>
31
31
<div
32
32
-
class="px-4 py-2 mr-1 text-black min-w-[80px] text-center relative group-hover:bg-gray-200 rounded-t
33
33
-
{{ if eq $.Active $key }}
32
32
+
class="px-4 py-1 mr-1 text-black min-w-[80px] text-center relative rounded-t
33
33
+
{{ if eq $.Active $key }}
34
34
{{ $activeTabStyles }}
35
35
-
{{ end }}"
35
35
+
{{ else }}
36
36
+
group-hover:bg-gray-200
37
37
+
{{ end }}
38
38
+
"
36
39
>
37
40
{{ $key }}
38
41
</div>
+2
-2
appview/pages/templates/user/profile.html
···
58
58
class="py-4 px-6 drop-shadow-sm rounded bg-white"
59
59
>
60
60
<div id="repo-card-name" class="font-medium">
61
61
-
<a href="/{{ .Did }}/{{ .Name }}">
62
62
-
@{{ .Did }}/{{ .Name }}
61
61
+
<a href="/{{ index $.DidHandleMap .Did }}/{{ .Name }}">
62
62
+
{{ index $.DidHandleMap .Did }}/{{ .Name }}
63
63
</a>
64
64
</div>
65
65
<div
-2
appview/state/repo.go
···
219
219
baseTreeLink := path.Join(f.OwnerDid(), f.RepoName, "tree", ref, treePath)
220
220
baseBlobLink := path.Join(f.OwnerDid(), f.RepoName, "blob", ref, treePath)
221
221
222
222
-
log.Println(result)
223
223
-
224
222
s.pages.RepoTree(w, pages.RepoTreeParams{
225
223
LoggedInUser: user,
226
224
BreadCrumbs: breadcrumbs,
+14
appview/state/state.go
···
642
642
if err != nil {
643
643
log.Printf("getting collaborating repos for %s: %s", ident.DID.String(), err)
644
644
}
645
645
+
var didsToResolve []string
646
646
+
for _, r := range collaboratingRepos {
647
647
+
didsToResolve = append(didsToResolve, r.Did)
648
648
+
}
649
649
+
resolvedIds := s.resolver.ResolveIdents(r.Context(), didsToResolve)
650
650
+
didHandleMap := make(map[string]string)
651
651
+
for _, identity := range resolvedIds {
652
652
+
if !identity.Handle.IsInvalidHandle() {
653
653
+
didHandleMap[identity.DID.String()] = fmt.Sprintf("@%s", identity.Handle.String())
654
654
+
} else {
655
655
+
didHandleMap[identity.DID.String()] = identity.DID.String()
656
656
+
}
657
657
+
}
645
658
646
659
followers, following, err := s.db.GetFollowerFollowing(ident.DID.String())
647
660
if err != nil {
···
665
678
Following: following,
666
679
},
667
680
FollowStatus: db.FollowStatus(followStatus),
681
681
+
DidHandleMap: didHandleMap,
668
682
})
669
683
}
670
684
+1
-1
tailwind.config.js
···
10
10
md: "650px",
11
11
lg: "900px",
12
12
xl: "1100px",
13
13
-
"2xl": "1300x",
13
13
+
"2xl": "1300px"
14
14
},
15
15
},
16
16
extend: {