forked from tangled.org/core
Monorepo for Tangled

profile page styles

Changed files
+64 -55
appview
pages
templates
layouts
user
+7
appview/pages/pages.go
··· 31 31 "add": func(a, b int) int { 32 32 return a + b 33 33 }, 34 + "didOrHandle": func(did, handle string) string { 35 + if handle != "" { 36 + return fmt.Sprintf("@%s", handle) 37 + } else { 38 + return did 39 + } 40 + }, 34 41 } 35 42 } 36 43
+45 -46
appview/pages/templates/layouts/topbar.html
··· 1 1 {{ define "layouts/topbar" }} 2 - {{ with .LoggedInUser }} 3 - <nav class="flex items-center space-x-4"> 4 - <a 5 - href="/" 6 - hx-boost="true" 7 - class="text-gray-600 hover:text-gray-900" 8 - >timeline</a 9 - > 10 - <a 11 - href="/settings" 12 - hx-boost="true" 13 - class="text-gray-600 hover:text-gray-900" 14 - >settings</a 15 - > 16 - <a 17 - href="/knots" 18 - hx-boost="true" 19 - class="text-gray-600 hover:text-gray-900" 20 - >knots</a 21 - > 22 - <a 23 - href="/repo/new" 24 - hx-boost="true" 25 - class="text-gray-600 hover:text-gray-900" 26 - >add repos</a 27 - > 28 - {{ if .Handle }} 29 - <a 30 - href="/@{{ .Handle }}" 31 - hx-boost="true" 32 - class="text-gray-600 hover:text-gray-900" 33 - >my profile</a 34 - > 35 - {{ else }} 36 - <a 37 - href="/{{ .Did }}" 38 - hx-boost="true" 39 - class="text-gray-600 hover:text-gray-900" 40 - >my profile</a 41 - > 42 - {{ end }} 43 - </nav> 44 - {{ else }} 45 - <a href="/login" class="btn my-2">login</a> 46 - {{ end }} 47 - 2 + <nav class="flex items-center space-x-4"> 3 + <a 4 + href="/" 5 + hx-boost="true" 6 + class="text-gray-600 hover:text-gray-900" 7 + >timeline</a 8 + > 9 + {{ with .LoggedInUser }} 10 + <a 11 + href="/settings" 12 + hx-boost="true" 13 + class="text-gray-600 hover:text-gray-900" 14 + >settings</a 15 + > 16 + <a 17 + href="/knots" 18 + hx-boost="true" 19 + class="text-gray-600 hover:text-gray-900" 20 + >knots</a 21 + > 22 + <a 23 + href="/repo/new" 24 + hx-boost="true" 25 + class="text-gray-600 hover:text-gray-900" 26 + >add repos</a 27 + > 28 + {{ if .Handle }} 29 + <a 30 + href="/@{{ .Handle }}" 31 + hx-boost="true" 32 + class="text-gray-600 hover:text-gray-900" 33 + >my profile</a 34 + > 35 + {{ else }} 36 + <a 37 + href="/{{ .Did }}" 38 + hx-boost="true" 39 + class="text-gray-600 hover:text-gray-900" 40 + >my profile</a 41 + > 42 + {{ end }} 43 + {{ else }} 44 + <a href="/login" class="btn my-2">login</a> 45 + {{ end }} 46 + </nav> 48 47 {{ end }}
+12 -9
appview/pages/templates/user/profile.html
··· 1 1 {{define "title"}}{{ or .UserHandle .UserDid }}{{end}} 2 2 3 3 {{define "content"}} 4 - <h1>{{ or .UserHandle .UserDid }} profile</h1> 4 + <h1>{{ didOrHandle .UserDid .UserHandle }}</h1> 5 5 6 - <h3>repos</h3> 7 - <ul id="my-knots"> 6 + <div id="my-repos" class="grid grid-cols-1 md:grid-cols-2 gap-4"> 8 7 {{range .Repos}} 9 - <li> 10 - <code>name: <a href="/@{{or $.UserHandle $.UserDid }}/{{.Name}}">{{.Name}}</a></code><br> 11 - <code>knot: {{.Knot}}</code><br> 12 - </li> 8 + <div id="repo-card" class="border border-black p-4 shadow-sm bg-white"> 9 + <div id="repo-card-name" class="font-medium"> 10 + <a href="/@{{or $.UserHandle $.UserDid }}/{{.Name}}">{{.Name}}</a> 11 + </div> 12 + <div id="repo-knot-name" class="text-gray-600 text-sm font-mono"> 13 + {{.Knot}} 14 + </div> 15 + </div> 13 16 {{else}} 14 - <p>does not have any repos yet</p> 17 + <p>This user does not have any repos yet.</p> 15 18 {{end}} 16 - </ul> 19 + </div> 17 20 {{end}}