1{{ define "title" }}{{ or .UserHandle .UserDid }}{{ end }}
2
3{{ define "content" }}
4<div class="grid grid-cols-1 lg:grid-cols-4 gap-6">
5 <div class="lg:col-span-1">
6 {{ block "profileCard" . }} {{ end }}
7 </div>
8
9 <div class="lg:col-span-3">
10 {{ block "ownRepos" . }} {{ end }}
11 {{ block "collaboratingRepos" . }} {{ end }}
12 </div>
13</div>
14{{ end }}
15
16{{ define "profileCard" }}
17<div class="bg-white px-6 py-4 rounded drop-shadow-sm max-h-fit">
18 <div class="flex justify-center items-center">
19 {{ if .AvatarUri }}
20 <img class="w-1/2 lg:w-full rounded-full p-2" src="{{ .AvatarUri }}" />
21 {{ end }}
22 </div>
23 <p class="text-xl font-bold text-center">
24 {{ didOrHandle .UserDid .UserHandle }}
25 </p>
26 <div class="text-sm text-center">
27 <span>{{ .ProfileStats.Followers }} followers</span>
28 <div class="inline-block px-1 select-none after:content-['·']"></div>
29 <span>{{ .ProfileStats.Following }} following</span>
30 </div>
31
32 {{ if ne .FollowStatus.String "IsSelf" }}
33 {{ template "fragments/follow" . }}
34 {{ end }}
35</div>
36{{ end }}
37
38{{ define "ownRepos" }}
39<p class="text-sm font-bold py-2 px-6">REPOS</p>
40<div id="repos" class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6">
41 {{ range .Repos }}
42 <div
43 id="repo-card"
44 class="py-4 px-6 drop-shadow-sm rounded bg-white"
45 >
46 <div id="repo-card-name" class="font-medium">
47 <a href="/@{{ or $.UserHandle $.UserDid }}/{{ .Name }}"
48 >{{ .Name }}</a
49 >
50 </div>
51 {{ if .Description }}
52 <div class="text-gray-600 text-sm">
53 {{ .Description }}
54 </div>
55 {{ end }}
56 <div class="text-gray-600 text-sm font-mono">
57 {{ .Knot }}
58 </div>
59 </div>
60 {{ else }}
61 <p class="px-6">This user does not have any repos yet.</p>
62 {{ end }}
63</div>
64{{ end }}
65
66{{ define "collaboratingRepos" }}
67<p class="text-sm font-bold py-2 px-6">COLLABORATING ON</p>
68<div id="collaborating" class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6">
69 {{ range .CollaboratingRepos }}
70 <div
71 id="repo-card"
72 class="py-4 px-6 drop-shadow-sm rounded bg-white"
73 >
74 <div id="repo-card-name" class="font-medium">
75 <a href="/{{ index $.DidHandleMap .Did }}/{{ .Name }}">
76 {{ index $.DidHandleMap .Did }}/{{ .Name }}
77 </a>
78 </div>
79 {{ if .Description }}
80 <div class="text-gray-600 text-sm">
81 {{ .Description }}
82 </div>
83 {{ end }}
84 <div class="text-gray-600 text-sm font-mono">
85 {{ .Knot }}
86 </div>
87 </div>
88 {{ else }}
89 <p class="px-6">This user is not collaborating.</p>
90 {{ end }}
91</div>
92{{ end }}