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