forked from tangled.org/core
this repo has no description

add banner for unlogged-in users

Changed files
+99 -65
appview
pages
templates
+1 -1
appview/pages/templates/layouts/topbar.html
··· 26 26 {{ didOrHandle .Did .Handle }} 27 27 </summary> 28 28 <div 29 - class="absolute flex flex-col right-0 mt-4 p-4 rounded w-48 bg-white border border-gray-200 z-50" 29 + class="absolute flex flex-col right-0 mt-4 p-4 rounded w-48 bg-white border border-gray-200 z-999" 30 30 > 31 31 <a 32 32 href="/{{ didOrHandle .Did .Handle }}"
+42 -36
appview/pages/templates/repo/new.html
··· 1 1 {{ define "title" }}new repo{{ end }} 2 2 3 3 {{ define "content" }} 4 - <h1>new repo</h1> 5 - <form hx-post="/repo/new" class="mt-6 space-y-6" hx-swap="none"> 6 - <div class="space-y-2"> 7 - <label for="name" class="block">repo name</label> 4 + <div class="p-6"> 5 + <p class="text-xl font-bold">Create a new repository</p> 6 + </div> 7 + <div class="p-6 bg-white drop-shadow-sm rounded"> 8 + <form hx-post="/repo/new" class="space-y-12" hx-swap="none"> 9 + <div class="space-y-2"> 10 + <label for="name" class="block uppercase font-bold text-sm">Repository name</label> 11 + <input 12 + type="text" 13 + id="name" 14 + name="name" 15 + required 16 + class="w-full max-w-md" 17 + /> 18 + <p class="text-sm text-gray-500">All repositories are publicly visible.</p> 19 + </div> 20 + 21 + <fieldset class="space-y-3"> 22 + <legend class="uppercase font-bold text-sm">Select a knot</legend> 23 + <div class="space-y-2"> 24 + {{ range .Knots }} 25 + <div> 26 + <label class="inline-flex items-center"> 8 27 <input 9 - type="text" 10 - id="name" 11 - name="name" 12 - required 13 - class="w-full max-w-md" 14 - /> 28 + type="radio" 29 + name="domain" 30 + value="{{ . }}" 31 + class="mr-2" 32 + /> 33 + <span>{{ . }}</span> 34 + </label> 15 35 </div> 36 + {{ else }} 37 + <p>No knots available.</p> 38 + {{ end }} 39 + </div> 40 + <p class="text-sm text-gray-500">A knot hosts repository data. <a href="/knots" class="underline">Learn how to register your own knot.</a></p> 41 + </fieldset> 16 42 17 - <fieldset class="space-y-3"> 18 - <legend class="font-medium">select a knot</legend> 19 - <div class="space-y-2"> 20 - {{ range .Knots }} 21 - <div> 22 - <label class="inline-flex items-center"> 23 - <input 24 - type="radio" 25 - name="domain" 26 - value="{{ . }}" 27 - class="mr-2" 28 - /> 29 - <span>{{ . }}</span> 30 - </label> 31 - </div> 32 - {{ else }} 33 - <p>No knots available</p> 34 - {{ end }} 35 - </div> 36 - </fieldset> 37 - 38 - <div class="space-y-2"> 39 - <button type="submit" class="btn">create repo</button> 40 - <div id="repo" class="error"></div> 41 - </div> 42 - </form> 43 + <div class="space-y-2"> 44 + <button type="submit" class="btn">create repo</button> 45 + <div id="repo" class="error"></div> 46 + </div> 47 + </form> 48 + </div> 43 49 {{ end }}
+56 -28
appview/pages/templates/timeline.html
··· 1 1 {{ define "title" }}timeline{{ end }} 2 2 3 + {{ define "topbar" }} 4 + {{ with .LoggedInUser }} 5 + {{ template "layouts/topbar" $ }} 6 + {{ else }} 7 + {{ end }} 8 + {{ end }} 9 + 3 10 {{ define "content" }} 4 - <div class="p-6"> 5 - <p class="text-xl font-bold">Timeline</p> 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 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 + </div> 6 27 </div> 28 + {{ end }} 7 29 8 - <div class="flex flex-col gap-3 relative"> 9 - <div class="absolute left-8 top-0 bottom-0 w-px bg-gray-300"></div> 10 - {{ range .Timeline }} 11 - <div class="px-6 py-2 bg-white rounded drop-shadow-sm w-fit"> 12 - {{ if .Repo }} 13 - {{ $userHandle := index $.DidHandleMap .Repo.Did }} 14 - <div class="flex items-center"> 15 - <p class="text-gray-600"> 16 - <a href="/{{ $userHandle }}" class="no-underline hover:underline">{{ $userHandle }}</a> 17 - created 18 - <a href="/{{ $userHandle }}/{{ .Repo.Name }}" class="no-underline hover:underline">{{ .Repo.Name }}</a> 19 - <time class="text-gray-700">{{ .Repo.Created | timeFmt }}</time> 20 - </p> 21 - </div> 22 - {{ else if .Follow }} 23 - {{ $userHandle := index $.DidHandleMap .Follow.UserDid }} 24 - {{ $subjectHandle := index $.DidHandleMap .Follow.SubjectDid }} 25 - <div class="flex items-center"> 26 - <p class="text-gray-600"> 27 - <a href="/{{ $userHandle }}" class="no-underline hover:underline">{{ $userHandle }}</a> 28 - followed 29 - <a href="/{{ $subjectHandle }}" class="no-underline hover:underline">{{ $subjectHandle }}</a> 30 - <time class="text-gray-700">{{ .Follow.FollowedAt | timeFmt }}</time> 31 - </p> 30 + {{ define "timeline" }} 31 + <div> 32 + <div class="p-6"> 33 + <p class="text-xl font-bold">Timeline</p> 34 + </div> 35 + 36 + <div class="flex flex-col gap-3 relative"> 37 + <div class="absolute left-8 top-0 bottom-0 w-px bg-gray-300"></div> 38 + {{ range .Timeline }} 39 + <div class="px-6 py-2 bg-white rounded drop-shadow-sm w-fit"> 40 + {{ if .Repo }} 41 + {{ $userHandle := index $.DidHandleMap .Repo.Did }} 42 + <div class="flex items-center"> 43 + <p class="text-gray-600"> 44 + <a href="/{{ $userHandle }}" class="no-underline hover:underline">{{ $userHandle }}</a> 45 + created 46 + <a href="/{{ $userHandle }}/{{ .Repo.Name }}" class="no-underline hover:underline">{{ .Repo.Name }}</a> 47 + <time class="text-gray-700">{{ .Repo.Created | timeFmt }}</time> 48 + </p> 49 + </div> 50 + {{ else if .Follow }} 51 + {{ $userHandle := index $.DidHandleMap .Follow.UserDid }} 52 + {{ $subjectHandle := index $.DidHandleMap .Follow.SubjectDid }} 53 + <div class="flex items-center"> 54 + <p class="text-gray-600"> 55 + <a href="/{{ $userHandle }}" class="no-underline hover:underline">{{ $userHandle }}</a> 56 + followed 57 + <a href="/{{ $subjectHandle }}" class="no-underline hover:underline">{{ $subjectHandle }}</a> 58 + <time class="text-gray-700">{{ .Follow.FollowedAt | timeFmt }}</time> 59 + </p> 60 + </div> 61 + {{ end }} 32 62 </div> 33 63 {{ end }} 34 64 </div> 35 - {{ end }} 36 65 </div> 37 - 38 66 {{ end }}