68 lines
2.5 kB
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">Repository creation is currently invite-only. Join our IRC on <code>#tangled</code> on Libera Chat for an invite!
27
Want to know more? 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">{{ .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">{{ .Follow.FollowedAt | timeFmt }}</time>
61
</p>
62
</div>
63
{{ end }}
64
</div>
65
{{ end }}
66
</div>
67
</div>
68
{{ end }}
69