this repo has no description
1{{ define "title" }}{{ or .Card.UserHandle .Card.UserDid }}{{ end }}
2
3{{ define "extrameta" }}
4 <meta property="og:title" content="{{ or .Card.UserHandle .Card.UserDid }}" />
5 <meta property="og:type" content="profile" />
6 <meta property="og:url" content="https://tangled.org/{{ or .Card.UserHandle .Card.UserDid }}?tab={{ .Active }}" />
7 <meta property="og:description" content="{{ or .Card.Profile.Description .Card.UserHandle .Card.UserDid }}" />
8{{ end }}
9
10{{ define "content" }}
11 {{ template "profileTabs" . }}
12 <section class="bg-white dark:bg-gray-800 px-2 py-6 md:p-6 rounded w-full dark:text-white drop-shadow-sm">
13 <div class="grid grid-cols-1 md:grid-cols-11 gap-4">
14 {{ $style := "hidden md:block md:col-span-3" }}
15 {{ if eq $.Active "overview" }}
16 {{ $style = "md:col-span-3" }}
17 {{ end }}
18 <div class="{{ $style }} order-1 order-1">
19 <div class="flex flex-col gap-4">
20 {{ template "user/fragments/profileCard" .Card }}
21 {{ block "punchcard" .Card.Punchcard }} {{ end }}
22 </div>
23 </div>
24
25 {{ block "profileContent" . }} {{ end }}
26 </div>
27 </section>
28{{ end }}
29
30{{ define "profileTabs" }}
31<nav class="w-full pl-4 overflow-x-auto overflow-y-hidden">
32 <div class="flex z-60">
33 {{ $activeTabStyles := "-mb-px bg-white dark:bg-gray-800" }}
34 {{ $tabs := .Card.GetTabs }}
35 {{ $tabmeta := dict "x" "y" }}
36 {{ range $item := $tabs }}
37 {{ $key := index $item 0 }}
38 {{ $value := index $item 1 }}
39 {{ $icon := index $item 2 }}
40 {{ $meta := index $item 3 }}
41 <a
42 href="?tab={{ $value }}"
43 class="relative -mr-px group no-underline hover:no-underline"
44 hx-boost="true">
45 <div
46 class="px-4 py-1 mr-1 text-black dark:text-white min-w-[80px] text-center relative rounded-t whitespace-nowrap
47 {{ if eq $.Active $key }}
48 {{ $activeTabStyles }}
49 {{ else }}
50 group-hover:bg-gray-100/25 group-hover:dark:bg-gray-700/25
51 {{ end }}
52 ">
53 <span class="flex items-center justify-center">
54 {{ i $icon "w-4 h-4 mr-2" }}
55 {{ $key }}
56 {{ if $meta }}
57 <span class="bg-gray-200 dark:bg-gray-700 rounded py-1/2 px-1 text-sm ml-1">{{ $meta }}</span>
58 {{ end }}
59 </span>
60 </div>
61 </a>
62 {{ end }}
63 </div>
64</nav>
65{{ end }}
66
67{{ define "punchcard" }}
68 {{ $now := now }}
69 <div>
70 <p class="px-2 pb-4 flex gap-2 text-sm font-bold dark:text-white">
71 PUNCHCARD
72 <span class="font-mono font-normal text-sm text-gray-500 dark:text-gray-400 ">
73 {{ .Total | int64 | commaFmt }} commits
74 </span>
75 </p>
76 <div class="grid grid-cols-28 md:grid-cols-14 gap-y-3 w-full h-full">
77 {{ range .Punches }}
78 {{ $count := .Count }}
79 {{ $theme := "bg-gray-200 dark:bg-gray-700 size-[4px]" }}
80 {{ if lt $count 1 }}
81 {{ $theme = "bg-gray-200 dark:bg-gray-700 size-[4px]" }}
82 {{ else if lt $count 2 }}
83 {{ $theme = "bg-green-200 dark:bg-green-900 size-[5px]" }}
84 {{ else if lt $count 4 }}
85 {{ $theme = "bg-green-300 dark:bg-green-800 size-[5px]" }}
86 {{ else if lt $count 8 }}
87 {{ $theme = "bg-green-400 dark:bg-green-700 size-[6px]" }}
88 {{ else }}
89 {{ $theme = "bg-green-500 dark:bg-green-600 size-[7px]" }}
90 {{ end }}
91
92 {{ if .Date.After $now }}
93 {{ $theme = "border border-gray-200 dark:border-gray-700 size-[4px]" }}
94 {{ end }}
95 <div class="w-full h-full flex justify-center items-center">
96 <div
97 class="aspect-square rounded-full transition-all duration-300 {{ $theme }} max-w-full max-h-full"
98 title="{{ .Date.Format "2006-01-02" }}: {{ .Count }} commits">
99 </div>
100 </div>
101 {{ end }}
102 </div>
103 </div>
104{{ end }}
105
106{{ define "layouts/profilebase" }}
107 {{ template "layouts/base" . }}
108{{ end }}