1{{ define "title" }}timeline{{ end }}
2
3{{ define "topbar" }}
4 {{ with .LoggedInUser }}
5 {{ template "layouts/topbar" $ }}
6 {{ else }}
7 {{ end }}
8{{ end }}
9
10{{ define "content" }}
11 {{ with .LoggedInUser }}
12 {{ block "timeline" $ }} {{ end }}
13 {{ else }}
14 {{ block "hero" $ }} {{ end }}
15 {{ block "timeline" $ }} {{ end }}
16 {{ end }}
17{{ end }}
18
19{{ define "hero" }}
20<div class="flex flex-col items-center justify-center text-center rounded drop-shadow bg-white text-black py-4 px-10">
21 <div class="font-bold italic text-4xl mb-4">
22 tangled
23 </div>
24 <div class="italic text-lg">
25 tightly-knit social coding, <a href="/login" class="underline inline-flex gap-1 items-center">join now <i data-lucide="arrow-right" class="w-4 h-4"></i></a>
26 <p class="pt-5 px-10 text-sm text-gray-500">Join our IRC channel: <a href="https://web.libera.chat/#tangled"><code>#tangled</code> on Libera Chat</a>.
27 Read an introduction to Tangled <a href="https://blog.tangled.sh/intro">here</a>.</p>
28 </div>
29</div>
30{{ end }}
31
32{{ define "timeline" }}
33<div>
34 <div class="p-6">
35 <p class="text-xl font-bold">Timeline</p>
36 </div>
37
38 <div class="flex flex-col gap-3 relative">
39 <div class="absolute left-8 top-0 bottom-0 w-px bg-gray-300"></div>
40 {{ range .Timeline }}
41 <div class="px-6 py-2 bg-white rounded drop-shadow-sm w-fit">
42 {{ if .Repo }}
43 {{ $userHandle := index $.DidHandleMap .Repo.Did }}
44 <div class="flex items-center">
45 <p class="text-gray-600">
46 <a href="/{{ $userHandle }}" class="no-underline hover:underline">{{ $userHandle }}</a>
47 created
48 <a href="/{{ $userHandle }}/{{ .Repo.Name }}" class="no-underline hover:underline">{{ .Repo.Name }}</a>
49 <time class="text-gray-700 text-xs">{{ .Repo.Created | timeFmt }}</time>
50 </p>
51 </div>
52 {{ else if .Follow }}
53 {{ $userHandle := index $.DidHandleMap .Follow.UserDid }}
54 {{ $subjectHandle := index $.DidHandleMap .Follow.SubjectDid }}
55 <div class="flex items-center">
56 <p class="text-gray-600">
57 <a href="/{{ $userHandle }}" class="no-underline hover:underline">{{ $userHandle }}</a>
58 followed
59 <a href="/{{ $subjectHandle }}" class="no-underline hover:underline">{{ $subjectHandle }}</a>
60 <time class="text-gray-700 text-xs">{{ .Follow.FollowedAt | timeFmt }}</time>
61 </p>
62 </div>
63 {{ else if .Star }}
64 {{ $starrerHandle := index $.DidHandleMap .Star.StarredByDid }}
65 {{ $repoOwnerHandle := index $.DidHandleMap .Star.Repo.Did }}
66 <div class="flex items-center">
67 <p class="text-gray-600">
68 <a href="/{{ $starrerHandle }}" class="no-underline hover:underline">{{ $starrerHandle }}</a>
69 starred
70 <a href="/{{ $repoOwnerHandle }}/{{ .Star.Repo.Name }}" class="no-underline hover:underline">{{ $repoOwnerHandle }}/{{ .Star.Repo.Name }}</a>
71 <time class="text-gray-700 text-xs">{{ .Star.Created | timeFmt }}</time>
72 </p>
73 </div>
74 {{ end }}
75 </div>
76 {{ end }}
77 </div>
78</div>
79{{ end }}
80