1{{ define "title" }}{{ or .UserHandle .UserDid }}{{ end }}
2
3{{ define "content" }}
4<div class="grid grid-cols-1 md:grid-cols-5 gap-6">
5 <div class="md:col-span-1 order-1 md:order-1">
6 {{ block "profileCard" . }}{{ end }}
7 </div>
8 <div class="md:col-span-2 order-2 md:order-2">
9 {{ block "ownRepos" . }}{{ end }}
10 {{ block "collaboratingRepos" . }}{{ end }}
11 </div>
12
13 <div class="md:col-span-2 order-3 md:order-3">
14 {{ block "profileTimeline" . }}{{ end }}
15 </div>
16</div>
17{{ end }}
18
19
20{{ define "profileTimeline" }}
21 <div class="flex flex-col gap-3 relative">
22 <p class="px-6 text-sm font-bold py-2 dark:text-white">ACTIVITY</p>
23 {{ range .ProfileTimeline }}
24 {{ if eq .Type "issue" }}
25 <div class="px-6 py-2 bg-white dark:bg-gray-800 rounded drop-shadow-sm w-fit max-w-full flex items-center gap-2">
26 {{ $textColor := "text-gray-800 dark:text-gray-400" }}
27 {{ $icon := "ban" }}
28 {{ if .Issue.Open }}
29 {{ $textColor = "text-green-600 dark:text-green-500" }}
30 {{ $icon = "circle-dot" }}
31 {{ end }}
32 <div class="p-1 {{ $textColor }}">
33 {{ i $icon "w-5 h-5" }}
34 </div>
35 <div>
36 <p class="text-gray-600 dark:text-gray-300">
37 <a href="/{{ index $.DidHandleMap .Repo.Did }}/{{ .Repo.Name }}/issues/{{ .Issue.IssueId }}" class="no-underline hover:underline">{{ .Issue.Title }} <span class="text-gray-500 dark:text-gray-400">#{{ .Issue.IssueId }}</span></a>
38 on
39 <a href="/{{ index $.DidHandleMap .Repo.Did }}/{{ .Repo.Name }}" class="no-underline hover:underline">{{ index $.DidHandleMap .Repo.Did }}<span class="select-none">/</span>{{ .Repo.Name }}</a>
40 <time class="text-gray-700 dark:text-gray-400 text-xs ml-2">{{ .Issue.Created | shortTimeFmt }}</time>
41 </p>
42 </div>
43 </div>
44 {{ else if eq .Type "pull" }}
45 <div class="px-6 py-2 bg-white dark:bg-gray-800 rounded drop-shadow-sm w-fit flex items-center gap-3">
46 {{ $textColor := "text-gray-800 dark:text-gray-400" }}
47 {{ $icon := "git-pull-request-closed" }}
48 {{ if .Pull.State.IsOpen }}
49 {{ $textColor = "text-green-600 dark:text-green-500" }}
50 {{ $icon = "git-pull-request" }}
51 {{ else if .Pull.State.IsMerged }}
52 {{ $textColor = "text-purple-600 dark:text-purple-500" }}
53 {{ $icon = "git-merge" }}
54 {{ end }}
55 <div class="{{ $textColor }} p-1">
56 {{ i $icon "w-5 h-5" }}
57 </div>
58 <div>
59 <p class="text-gray-600 dark:text-gray-300">
60 <a href="/{{ index $.DidHandleMap .Repo.Did }}/{{ .Repo.Name }}/pulls/{{ .Pull.PullId }}" class="no-underline hover:underline">{{ .Pull.Title }} <span class="text-gray-500 dark:text-gray-400">#{{ .Pull.PullId }}</span></a>
61 on
62 <a href="/{{ index $.DidHandleMap .Repo.Did }}/{{ .Repo.Name }}" class="no-underline hover:underline">
63 {{ index $.DidHandleMap .Repo.Did }}<span class="select-none">/</span>{{ .Repo.Name }}</a>
64 <time class="text-gray-700 dark:text-gray-400 text-xs ml-2">{{ .Pull.Created | shortTimeFmt }}</time>
65 </p>
66 </div>
67 </div>
68 {{ else if eq .Type "repo" }}
69 <div class="px-6 py-2 bg-white dark:bg-gray-800 rounded drop-shadow-sm w-fit flex items-center gap-3">
70 <div class="text-gray-800 dark:text-gray-400 p-1">
71 {{ i "book-plus" "w-5 h-5" }}
72 </div>
73 <div>
74 <p class="text-gray-600 dark:text-gray-300">
75 created <a href="/{{ index $.DidHandleMap .Repo.Did }}/{{ .Repo.Name }}" class="no-underline hover:underline">{{ .Repo.Name }}</a>
76 <time class="text-gray-700 dark:text-gray-400 text-xs ml-2">{{ .Repo.Created | shortTimeFmt }}</time>
77 </p>
78 </div>
79 </div>
80 {{ end }}
81 {{ else }}
82 <p class="px-6 dark:text-white">This user does not have any activity yet.</p>
83 {{ end }}
84 </div>
85{{ end }}
86
87{{ define "profileCard" }}
88 <div class="bg-white dark:bg-gray-800 px-6 py-4 rounded drop-shadow-sm max-h-fit">
89 <div class="flex justify-center items-center">
90 {{ if .AvatarUri }}
91 <img class="w-3/4 rounded-full p-2" src="{{ .AvatarUri }}" />
92 {{ end }}
93 </div>
94 <p class="text-xl font-bold text-center dark:text-white">
95 {{ truncateAt30 (didOrHandle .UserDid .UserHandle) }}
96 </p>
97 <div class="text-sm text-center dark:text-gray-300">
98 <span>{{ .ProfileStats.Followers }} followers</span>
99 <div
100 class="inline-block px-1 select-none after:content-['·']"
101 ></div>
102 <span>{{ .ProfileStats.Following }} following</span>
103 </div>
104
105 {{ if ne .FollowStatus.String "IsSelf" }}
106 {{ template "fragments/follow" . }}
107 {{ end }}
108 </div>
109{{ end }}
110
111{{ define "ownRepos" }}
112 <p class="text-sm font-bold py-2 px-6 dark:text-white">REPOS</p>
113 <div id="repos" class="grid grid-cols-1 gap-4 mb-6">
114 {{ range .Repos }}
115 <div
116 id="repo-card"
117 class="py-4 px-6 drop-shadow-sm rounded bg-white dark:bg-gray-800"
118 >
119 <div id="repo-card-name" class="font-medium dark:text-white">
120 <a href="/@{{ or $.UserHandle $.UserDid }}/{{ .Name }}"
121 >{{ .Name }}</a
122 >
123 </div>
124 {{ if .Description }}
125 <div class="text-gray-600 dark:text-gray-300 text-sm">
126 {{ .Description }}
127 </div>
128 {{ end }}
129 <div
130 class="text-gray-400 pt-1 text-sm font-mono inline-flex gap-4 mt-auto"
131 >
132
133 {{ if .RepoStats.StarCount }}
134 <div class="flex gap-1 items-center text-sm">
135 {{ i "star" "w-3 h-3 fill-current" }}
136 <span>{{ .RepoStats.StarCount }}</span>
137 </div>
138 {{ end }}
139 </div>
140 </div>
141 {{ else }}
142 <p class="px-6 dark:text-white">This user does not have any repos yet.</p>
143 {{ end }}
144 </div>
145
146 <p class="text-sm font-bold py-2 px-6 dark:text-white">COLLABORATING ON</p>
147 <div id="collaborating" class="grid grid-cols-1 gap-4 mb-6">
148 {{ range .CollaboratingRepos }}
149 <div
150 id="repo-card"
151 class="py-4 px-6 drop-shadow-sm rounded bg-white dark:bg-gray-800 flex flex-col"
152 >
153 <div id="repo-card-name" class="font-medium dark:text-white">
154 <a href="/{{ index $.DidHandleMap .Did }}/{{ .Name }}">
155 {{ index $.DidHandleMap .Did }}/{{ .Name }}
156 </a>
157 </div>
158 {{ if .Description }}
159 <div class="text-gray-600 dark:text-gray-300 text-sm">
160 {{ .Description }}
161 </div>
162 {{ end }}
163 <div class="text-gray-400 pt-1 text-sm font-mono inline-flex gap-4 mt-auto">
164
165 {{ if .RepoStats.StarCount }}
166 <div class="flex gap-1 items-center text-sm">
167 {{ i "star" "w-3 h-3 fill-current" }}
168 <span>{{ .RepoStats.StarCount }}</span>
169 </div>
170 {{ end }}
171 </div>
172 </div>
173 {{ else }}
174 <p class="px-6 dark:text-white">This user is not collaborating.</p>
175 {{ end }}
176 </div>
177{{ end }}