this repo has no description
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 <div class="md:col-span-2 order-3 md:order-3"> 13 {{ block "profileTimeline" . }}{{ end }} 14 </div> 15</div> 16{{ end }} 17 18{{ define "profileTimeline" }} 19 <p class="text-sm font-bold py-2 dark:text-white px-6">ACTIVITY</p> 20 <div class="flex flex-col gap-6 relative"> 21 {{ with .ProfileTimeline }} 22 {{ range $idx, $byMonth := .ByMonth }} 23 {{ with $byMonth }} 24 <div class="bg-white dark:bg-gray-800 px-6 py-4 rounded drop-shadow-sm"> 25 {{ if eq $idx 0 }} 26 27 {{ else }} 28 {{ $s := "s" }} 29 {{ if eq $idx 1 }} 30 {{ $s = "" }} 31 {{ end }} 32 <p class="text-sm font-bold dark:text-white mb-2">{{$idx}} month{{$s}} ago</p> 33 {{ end }} 34 35 {{ if .IsEmpty }} 36 <div class="text-gray-500 dark:text-gray-400"> 37 No activity for this month 38 </div> 39 {{ else }} 40 <div class="flex flex-col gap-1"> 41 {{ block "repoEvents" (list .RepoEvents $.DidHandleMap) }} {{ end }} 42 {{ block "issueEvents" (list .IssueEvents $.DidHandleMap) }} {{ end }} 43 {{ block "pullEvents" (list .PullEvents $.DidHandleMap) }} {{ end }} 44 </div> 45 {{ end }} 46 </div> 47 48 {{ end }} 49 {{ else }} 50 <p class="dark:text-white">This user does not have any activity yet.</p> 51 {{ end }} 52 {{ end }} 53 </div> 54{{ end }} 55 56{{ define "repoEvents" }} 57 {{ $items := index . 0 }} 58 {{ $handleMap := index . 1 }} 59 60 {{ if gt (len $items) 0 }} 61 <details> 62 <summary class="list-none cursor-pointer hover:text-gray-500 hover:dark:text-gray-400"> 63 <div class="flex items-center gap-2"> 64 {{ i "book-plus" "w-4 h-4" }} 65 created {{ len $items }} {{if eq (len $items) 1 }}repository{{else}}repositories{{end}} 66 </div> 67 </summary> 68 <div class="p-2 pr-0 text-sm flex flex-col gap-3 mb-2"> 69 {{ range $items }} 70 <div class="flex flex-wrap items-center gap-2"> 71 <span class="text-gray-500 dark:text-gray-400"> 72 {{ if .Source }} 73 {{ i "git-fork" "w-4 h-4" }} 74 {{ else }} 75 {{ i "book-plus" "w-4 h-4" }} 76 {{ end }} 77 </span> 78 <a href="/{{ index $handleMap .Repo.Did }}/{{ .Repo.Name }}" class="no-underline hover:underline"> 79 {{- .Repo.Name -}} 80 </a> 81 </div> 82 {{ end }} 83 </div> 84 </details> 85 {{ end }} 86{{ end }} 87 88{{ define "issueEvents" }} 89 {{ $i := index . 0 }} 90 {{ $items := $i.Items }} 91 {{ $stats := $i.Stats }} 92 {{ $handleMap := index . 1 }} 93 94 {{ if gt (len $items) 0 }} 95 <details> 96 <summary class="list-none cursor-pointer hover:text-gray-500 hover:dark:text-gray-400"> 97 <div class="flex items-center gap-2"> 98 {{ i "circle-dot" "w-4 h-4" }} 99 100 <div> 101 created {{ len $items }} {{if eq (len $items) 1 }}issue{{else}}issues{{end}} 102 </div> 103 104 {{ if gt $stats.Open 0 }} 105 <span class="px-2 py-1/2 text-sm rounded text-white bg-green-600 dark:bg-green-700"> 106 {{$stats.Open}} open 107 </span> 108 {{ end }} 109 110 {{ if gt $stats.Closed 0 }} 111 <span class="px-2 py-1/2 text-sm rounded text-white bg-gray-800 dark:bg-gray-700"> 112 {{$stats.Closed}} closed 113 </span> 114 {{ end }} 115 116 </div> 117 </summary> 118 <div class="p-2 pr-0 text-sm flex flex-col gap-3 mb-2"> 119 {{ range $items }} 120 {{ $repoOwner := index $handleMap .Metadata.Repo.Did }} 121 {{ $repoName := .Metadata.Repo.Name }} 122 {{ $repoUrl := printf "%s/%s" $repoOwner $repoName }} 123 124 <div class="flex gap-2 text-gray-600 dark:text-gray-300"> 125 {{ if .Open }} 126 <span class="text-green-600 dark:text-green-500"> 127 {{ i "circle-dot" "w-4 h-4" }} 128 </span> 129 {{ else }} 130 <span class="text-gray-500 dark:text-gray-400"> 131 {{ i "ban" "w-4 h-4" }} 132 </span> 133 {{ end }} 134 <div class="break-words max-w-full"> 135 <a href="/{{$repoUrl}}/issues/{{ .IssueId }}" class="no-underline hover:underline"> 136 <span class="text-gray-500 dark:text-gray-400">#{{ .IssueId }}</span> 137 {{ .Title -}} 138 </a> 139 on 140 <a href="/{{$repoUrl}}" class="no-underline hover:underline"> 141 {{$repoUrl}} 142 </a> 143 </div> 144 </div> 145 {{ end }} 146 </div> 147 </details> 148 {{ end }} 149{{ end }} 150 151{{ define "pullEvents" }} 152 {{ $i := index . 0 }} 153 {{ $items := $i.Items }} 154 {{ $stats := $i.Stats }} 155 {{ $handleMap := index . 1 }} 156 {{ if gt (len $items) 0 }} 157 <details> 158 <summary class="list-none cursor-pointer hover:text-gray-500 hover:dark:text-gray-400"> 159 <div class="flex items-center gap-2"> 160 {{ i "git-pull-request" "w-4 h-4" }} 161 162 <div> 163 created {{ len $items }} {{if eq (len $items) 1 }}pull request{{else}}pull requests{{end}} 164 </div> 165 166 {{ if gt $stats.Open 0 }} 167 <span class="px-2 py-1/2 text-sm rounded text-white bg-green-600 dark:bg-green-700"> 168 {{$stats.Open}} open 169 </span> 170 {{ end }} 171 172 {{ if gt $stats.Merged 0 }} 173 <span class="px-2 py-1/2 text-sm rounded text-white bg-purple-600 dark:bg-purple-700"> 174 {{$stats.Merged}} merged 175 </span> 176 {{ end }} 177 178 179 {{ if gt $stats.Closed 0 }} 180 <span class="px-2 py-1/2 text-sm rounded text-black dark:text-white bg-gray-50 dark:bg-gray-700 "> 181 {{$stats.Closed}} closed 182 </span> 183 {{ end }} 184 185 </div> 186 </summary> 187 <div class="p-2 pr-0 text-sm flex flex-col gap-3 mb-2"> 188 {{ range $items }} 189 {{ $repoOwner := index $handleMap .Repo.Did }} 190 {{ $repoName := .Repo.Name }} 191 {{ $repoUrl := printf "%s/%s" $repoOwner $repoName }} 192 193 <div class="flex gap-2 text-gray-600 dark:text-gray-300"> 194 {{ if .State.IsOpen }} 195 <span class="text-green-600 dark:text-green-500"> 196 {{ i "git-pull-request" "w-4 h-4" }} 197 </span> 198 {{ else if .State.IsMerged }} 199 <span class="text-purple-600 dark:text-purple-500"> 200 {{ i "git-merge" "w-4 h-4" }} 201 </span> 202 {{ else }} 203 <span class="text-gray-600 dark:text-gray-300"> 204 {{ i "git-pull-request-closed" "w-4 h-4" }} 205 </span> 206 {{ end }} 207 <div class="break-words max-w-full"> 208 <a href="/{{$repoUrl}}/pulls/{{ .PullId }}" class="no-underline hover:underline"> 209 <span class="text-gray-500 dark:text-gray-400">#{{ .PullId }}</span> 210 {{ .Title -}} 211 </a> 212 on 213 <a href="/{{$repoUrl}}" class="no-underline hover:underline"> 214 {{$repoUrl}} 215 </a> 216 </div> 217 </div> 218 {{ end }} 219 </div> 220 </details> 221 {{ end }} 222{{ end }} 223 224{{ define "profileCard" }} 225 <div class="bg-white dark:bg-gray-800 px-6 py-4 rounded drop-shadow-sm max-h-fit"> 226 <div class="flex justify-center items-center"> 227 {{ if .AvatarUri }} 228 <img class="w-3/4 rounded-full p-2" src="{{ .AvatarUri }}" /> 229 {{ end }} 230 </div> 231 <p 232 title="{{ didOrHandle .UserDid .UserHandle }}" 233 class="text-lg font-bold text-center dark:text-white overflow-hidden text-ellipsis whitespace-nowrap max-w-full" 234 > 235 {{ didOrHandle .UserDid .UserHandle }} 236 </p> 237 <div class="text-sm text-center dark:text-gray-300"> 238 <span>{{ .ProfileStats.Followers }} followers</span> 239 <div 240 class="inline-block px-1 select-none after:content-['·']" 241 ></div> 242 <span>{{ .ProfileStats.Following }} following</span> 243 </div> 244 245 {{ if ne .FollowStatus.String "IsSelf" }} 246 {{ template "fragments/follow" . }} 247 {{ end }} 248 </div> 249{{ end }} 250 251{{ define "ownRepos" }} 252 <p class="text-sm font-bold py-2 px-6 dark:text-white">REPOS</p> 253 <div id="repos" class="grid grid-cols-1 gap-4 mb-6"> 254 {{ range .Repos }} 255 <div 256 id="repo-card" 257 class="py-4 px-6 drop-shadow-sm rounded bg-white dark:bg-gray-800" 258 > 259 <div id="repo-card-name" class="font-medium dark:text-white"> 260 <a href="/@{{ or $.UserHandle $.UserDid }}/{{ .Name }}" 261 >{{ .Name }}</a 262 > 263 </div> 264 {{ if .Description }} 265 <div class="text-gray-600 dark:text-gray-300 text-sm"> 266 {{ .Description }} 267 </div> 268 {{ end }} 269 <div 270 class="text-gray-400 pt-1 text-sm font-mono inline-flex gap-4 mt-auto" 271 > 272 273 {{ if .RepoStats.StarCount }} 274 <div class="flex gap-1 items-center text-sm"> 275 {{ i "star" "w-3 h-3 fill-current" }} 276 <span>{{ .RepoStats.StarCount }}</span> 277 </div> 278 {{ end }} 279 </div> 280 </div> 281 {{ else }} 282 <p class="px-6 dark:text-white">This user does not have any repos yet.</p> 283 {{ end }} 284 </div> 285 286 <p class="text-sm font-bold py-2 px-6 dark:text-white">COLLABORATING ON</p> 287 <div id="collaborating" class="grid grid-cols-1 gap-4 mb-6"> 288 {{ range .CollaboratingRepos }} 289 <div 290 id="repo-card" 291 class="py-4 px-6 drop-shadow-sm rounded bg-white dark:bg-gray-800 flex flex-col" 292 > 293 <div id="repo-card-name" class="font-medium dark:text-white"> 294 <a href="/{{ index $.DidHandleMap .Did }}/{{ .Name }}"> 295 {{ index $.DidHandleMap .Did }}/{{ .Name }} 296 </a> 297 </div> 298 {{ if .Description }} 299 <div class="text-gray-600 dark:text-gray-300 text-sm"> 300 {{ .Description }} 301 </div> 302 {{ end }} 303 <div class="text-gray-400 pt-1 text-sm font-mono inline-flex gap-4 mt-auto"> 304 305 {{ if .RepoStats.StarCount }} 306 <div class="flex gap-1 items-center text-sm"> 307 {{ i "star" "w-3 h-3 fill-current" }} 308 <span>{{ .RepoStats.StarCount }}</span> 309 </div> 310 {{ end }} 311 </div> 312 </div> 313 {{ else }} 314 <p class="px-6 dark:text-white">This user is not collaborating.</p> 315 {{ end }} 316 </div> 317{{ end }}