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:underline"> 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"> 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 <time class="text-gray-700 dark:text-gray-400 text-xs ml-2">{{ .Repo.Created | shortTimeFmt }}</time> 82 </div> 83 {{ end }} 84 </div> 85 </details> 86 {{ end }} 87{{ end }} 88 89{{ define "issueEvents" }} 90 {{ $i := index . 0 }} 91 {{ $items := $i.Items }} 92 {{ $stats := $i.Stats }} 93 {{ $handleMap := index . 1 }} 94 95 {{ if gt (len $items) 0 }} 96 <details> 97 <summary class="list-none cursor-pointer hover:underline"> 98 <div class="flex items-center gap-2"> 99 {{ i "circle-dot" "w-4 h-4" }} 100 101 <div> 102 created {{ len $items }} {{if eq (len $items) 1 }}issue{{else}}issues{{end}} 103 </div> 104 105 {{ if gt $stats.Open 0 }} 106 <span class="px-2 py-1/2 text-sm rounded text-white bg-green-600 dark:bg-green-700"> 107 {{$stats.Open}} open 108 </span> 109 {{ end }} 110 111 {{ if gt $stats.Closed 0 }} 112 <span class="px-2 py-1/2 text-sm rounded text-white bg-gray-800 dark:bg-gray-700"> 113 {{$stats.Closed}} closed 114 </span> 115 {{ end }} 116 117 </div> 118 </summary> 119 <div class="p-2 pr-0 text-sm flex flex-col gap-3"> 120 {{ range $items }} 121 {{ $repoOwner := index $handleMap .Metadata.Repo.Did }} 122 {{ $repoName := .Metadata.Repo.Name }} 123 {{ $repoUrl := printf "%s/%s" $repoOwner $repoName }} 124 125 <div class="flex flex-wrap items-center gap-2 text-gray-600 dark:text-gray-300"> 126 {{ if .Open }} 127 <span class="text-green-600 dark:text-green-500"> 128 {{ i "circle-dot" "w-4 h-4" }} 129 </span> 130 {{ else }} 131 <span class="text-gray-500 dark:text-gray-400"> 132 {{ i "ban" "w-4 h-4" }} 133 </span> 134 {{ end }} 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 <time class="text-gray-700 dark:text-gray-400 text-xs ml-2">{{ .Created | shortTimeFmt }}</time> 144 </p> 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:underline"> 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"> 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 flex-wrap items-center 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 <a href="/{{$repoUrl}}/pulls/{{ .PullId }}" class="no-underline hover:underline"> 208 <span class="text-gray-500 dark:text-gray-400">#{{ .PullId }}</span> 209 {{ .Title -}} 210 </a> 211 on 212 <a href="/{{$repoUrl}}" class="no-underline hover:underline"> 213 {{$repoUrl}} 214 </a> 215 <time class="text-gray-700 dark:text-gray-400 text-xs ml-2">{{ .Created | shortTimeFmt }}</time> 216 </div> 217 {{ end }} 218 </div> 219 </details> 220 {{ end }} 221{{ end }} 222 223{{ define "profileCard" }} 224 <div class="bg-white dark:bg-gray-800 px-6 py-4 rounded drop-shadow-sm max-h-fit"> 225 <div class="flex justify-center items-center"> 226 {{ if .AvatarUri }} 227 <img class="w-3/4 rounded-full p-2" src="{{ .AvatarUri }}" /> 228 {{ end }} 229 </div> 230 <p 231 title="{{ didOrHandle .UserDid .UserHandle }}" 232 class="text-lg font-bold text-center dark:text-white overflow-hidden text-ellipsis whitespace-nowrap max-w-full" 233 > 234 {{ didOrHandle .UserDid .UserHandle }} 235 </p> 236 <div class="text-sm text-center dark:text-gray-300"> 237 <span>{{ .ProfileStats.Followers }} followers</span> 238 <div 239 class="inline-block px-1 select-none after:content-['·']" 240 ></div> 241 <span>{{ .ProfileStats.Following }} following</span> 242 </div> 243 244 {{ if ne .FollowStatus.String "IsSelf" }} 245 {{ template "fragments/follow" . }} 246 {{ end }} 247 </div> 248{{ end }} 249 250{{ define "ownRepos" }} 251 <p class="text-sm font-bold py-2 px-6 dark:text-white">REPOS</p> 252 <div id="repos" class="grid grid-cols-1 gap-4 mb-6"> 253 {{ range .Repos }} 254 <div 255 id="repo-card" 256 class="py-4 px-6 drop-shadow-sm rounded bg-white dark:bg-gray-800" 257 > 258 <div id="repo-card-name" class="font-medium dark:text-white"> 259 <a href="/@{{ or $.UserHandle $.UserDid }}/{{ .Name }}" 260 >{{ .Name }}</a 261 > 262 </div> 263 {{ if .Description }} 264 <div class="text-gray-600 dark:text-gray-300 text-sm"> 265 {{ .Description }} 266 </div> 267 {{ end }} 268 <div 269 class="text-gray-400 pt-1 text-sm font-mono inline-flex gap-4 mt-auto" 270 > 271 272 {{ if .RepoStats.StarCount }} 273 <div class="flex gap-1 items-center text-sm"> 274 {{ i "star" "w-3 h-3 fill-current" }} 275 <span>{{ .RepoStats.StarCount }}</span> 276 </div> 277 {{ end }} 278 </div> 279 </div> 280 {{ else }} 281 <p class="px-6 dark:text-white">This user does not have any repos yet.</p> 282 {{ end }} 283 </div> 284 285 <p class="text-sm font-bold py-2 px-6 dark:text-white">COLLABORATING ON</p> 286 <div id="collaborating" class="grid grid-cols-1 gap-4 mb-6"> 287 {{ range .CollaboratingRepos }} 288 <div 289 id="repo-card" 290 class="py-4 px-6 drop-shadow-sm rounded bg-white dark:bg-gray-800 flex flex-col" 291 > 292 <div id="repo-card-name" class="font-medium dark:text-white"> 293 <a href="/{{ index $.DidHandleMap .Did }}/{{ .Name }}"> 294 {{ index $.DidHandleMap .Did }}/{{ .Name }} 295 </a> 296 </div> 297 {{ if .Description }} 298 <div class="text-gray-600 dark:text-gray-300 text-sm"> 299 {{ .Description }} 300 </div> 301 {{ end }} 302 <div class="text-gray-400 pt-1 text-sm font-mono inline-flex gap-4 mt-auto"> 303 304 {{ if .RepoStats.StarCount }} 305 <div class="flex gap-1 items-center text-sm"> 306 {{ i "star" "w-3 h-3 fill-current" }} 307 <span>{{ .RepoStats.StarCount }}</span> 308 </div> 309 {{ end }} 310 </div> 311 </div> 312 {{ else }} 313 <p class="px-6 dark:text-white">This user is not collaborating.</p> 314 {{ end }} 315 </div> 316{{ end }}