forked from tangled.org/core
Monorepo for Tangled

restore timeline and follow changes

Changed files
+35 -28
appview
db
pages
templates
-1
appview/db/db.go
··· 60 60 create table if not exists follows ( 61 61 user_did text not null, 62 62 subject_did text not null, 63 - at_uri text not null unique, 64 63 rkey text not null, 65 64 followed_at text not null default (strftime('%Y-%m-%dT%H:%M:%SZ', 'now')), 66 65 primary key (user_did, subject_did),
+35 -27
appview/pages/templates/timeline.html
··· 4 4 <h1>Timeline</h1> 5 5 6 6 {{ range .Timeline }} 7 + <div class="relative 8 + px-4 9 + py-2 10 + border-l 11 + border-black 12 + before:content-[''] 13 + before:absolute 14 + before:w-1 15 + before:h-1 16 + before:bg-black 17 + before:rounded-full 18 + before:left-[-2.2px] 19 + before:top-1/2 20 + before:-translate-y-1/2 21 + "> 7 22 {{ if .Repo }} 8 - <div class="border border-black p-4 m-2 bg-white w-1/2"> 9 - <div class="flex items-center"> 10 - <div class="text-sm text-gray-600"> 11 - {{ .Repo.Did }} created 12 - </div> 13 - div> 14 - <div class="px-3">{{ .Repo.Name }}</div> 15 - </div> 16 - 17 - <time class="text-sm text-gray-700" 18 - >{{ .Repo.Created | timeFmt }}</time 19 - > 20 - </div> 23 + {{ $userHandle := index $.DidHandleMap .Repo.Did }} 24 + <div class="flex items-center"> 25 + <p class="text-gray-600"> 26 + <a href="/{{ $userHandle }}" class="no-underline hover:underline">{{ $userHandle }}</a> 27 + created 28 + <a href="/{{ $userHandle }}/{{ .Repo.Name }}" class="no-underline hover:underline">{{ .Repo.Name }}</a> 29 + <time class="text-gray-700">{{ .Repo.Created | timeFmt }}</time> 30 + </p> 31 + </div> 21 32 {{ else if .Follow }} 22 - <div class="border border-black p-4 m-2 bg-white w-1/2"> 23 - <div class="flex items-center"> 24 - <div class="text-sm text-gray-600"> 25 - {{ .Follow.UserDid }} followed 26 - </div> 27 - <div class="text-sm text-gray-800"> 28 - {{ .Follow.SubjectDid }} 29 - </div> 30 - </div> 31 - 32 - <time class="text-sm text-gray-700" 33 - >{{ .Follow.FollowedAt | timeFmt }}</time 34 - > 35 - </div> 33 + {{ $userHandle := index $.DidHandleMap .Follow.UserDid }} 34 + {{ $subjectHandle := index $.DidHandleMap .Follow.SubjectDid }} 35 + <div class="flex items-center"> 36 + <p class="text-gray-600"> 37 + <a href="/{{ $userHandle }}" class="no-underline hover:underline">{{ $userHandle }}</a> 38 + followed 39 + <a href="/{{ $subjectHandle }}" class="no-underline hover:underline">{{ $subjectHandle }}</a> 40 + <time class="text-gray-700">{{ .Follow.FollowedAt | timeFmt }}</time> 41 + </p> 42 + </div> 36 43 {{ end }} 44 + </div> 37 45 {{ end }} 38 46 39 47 {{ end }}